A collection of partials Blade views for Bootstrap 4 forms controls.
Available controls
- Input
- Input Hidden
- Input Readonly
- Select
- Checkbox
- Datepicker
- Timepicker
- Textarea (with WYSWYG editor)
- Textarea plain
- Password
- Upload image
- Alert (to show an bootstrap alert)
You can install the package via composer:
composer require davide-casiraghi/laravel-form-partialsphp artisan vendor:publish --force
Then select the number that correspont to the package.
The partials can be included in any blade view in this way:
for a create view
@include('laravel-form-partials::input', [ 'title' => __('views.title'), 'name' => 'title', 'placeholder' => 'Post title', 'value' => old('title'), 'required' => true, ])for an edit view
@include('laravel-form-partials::input', [ 'title' => __('views.title'), 'name' => 'title', 'placeholder' => 'Post title', 'value' => $post->title, 'required' => true, ])for a create view
@include('laravel-form-partials::upload-image', [ 'title' => 'Card image', 'name' => 'image_file_name', 'folder' => 'cards', 'value' => '', 'required' => false, ])for an edit view
@include('laravel-form-partials::upload-image', [ 'title' => 'Card image', 'name' => 'image_file_name', 'folder' => 'cards', 'value' => $card->image_file_name, 'required' => false, ])In the controller store method
use DavideCasiraghi\LaravelFormPartials\Facades\LaravelFormPartials; ... $imageSubdir = 'cards'; $imageWidth = '1067'; $thumbWidth = '690'; $card->image_file_name = LaravelFormPartials::uploadImageOnServer($request->file('image_file_name'), $request->image_file_name, $imageSubdir, $imageWidth, $thumbWidth);Please see CONTRIBUTING for details.
If you discover any security related issues, please email davide.casiraghi@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.
