Currently seeking new career opportunities in web development, particularly with Laravel, Hire Me

Laravel Blade Components Package

David Carr

Laravel Framework Packages

I've released a blade components package.

Components can be made in projects easily enough but often it's good to reuse components across projects, this is where [Laravel Blade components collection](https://github.com/dcblogdev/laravel-blade-components) comes in.

The first collection I've added is for forms. There are components for:

* form tags
* inputs 
* textareas
* checkboxes
* radios
* selects
* buttons

These allow you to write forms with less markup required, for instance, take the example login form:

<x-form.open action='login'>

<x-form.input name='username' class='form-control'>{{ request('username') }}</x-form.input>
<x-form.input name='password' type='password' class='form-control'></x-form.input>

<x-form.button class='btn btn-sm btn-info mt-3'>x Login</x-form.button>

</x-form.open>

Another example, populate forms for a typical edit form:

<x-form.open method='put' action='{{ route('post.update')}}'>

<x-form.input name='title' class='form-input'>{{ old('title', $post->title) }}</x-form.input>

<x-form.textarea name='content' class='form-input' cols='10' rows='10'>{{ old('content', $post->content) }}</x-form.textarea>

<x-form.button>x Login</x-form.button>

</x-form.open>

Check out the Laravel Blade components package.

Laravel Modules Your Logo Your Logo Your Logo

Become a sponsor

Help support the blog so that I can continue creating new content!

Sponsor

My Latest Book

Modular Laravel Book - Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Subscribe to my newsletter

Subscribe and get my books and product announcements.

Learn Laravel with Laracasts

Faster Laravel Hosting

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.