Skip to main content
Back to packages
830 GitHub stars

spatie/laravel-html

View on GitHub

Description

Painless html generation

This package helps you generate HTML using a clean, simple and easy to read API. All elements can be dynamically generated and put together. The HTML builder helps you generate dynamically assigned form elements based on your selected model, the session or a default value.

Here's a quick example that builds a basic form with an e-mail input:

{{ html()->form('PUT', '/post')->open() }}
 
{{ html()->email('email')->placeholder('Your e-mail address') }}
 
{{ html()->form()->close() }}
 
The generated HTML will look like this:
```html
<form method="POST" action="/post">
<input type="hidden" name="_method" id="_method" value="PUT">
<input type="hidden" name="_token" id="_token" value="csrf_token_will_be_here">
<input type="email" name="email" id="email" placeholder="Your e-mail address">
</form>
 

Recent Courses on Laravel Daily

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.