realcahsowan/laravel-bulma-form

Simple form builder for Laravel, using Bulma css

dev-master 2020-12-10 01:45 UTC

This package is auto-updated.

Last update: 2024-05-10 09:11:09 UTC


README

Laravel form builder using Bulma css

Installation

composer require realcahsowan/laravel-bulma-form

Usage

Form Class File

php artisan make:form BookForm

above command will generate BookForm class file in app/Http/Forms directory

Inside Controller

// Don't forget to import
use App\Http\Forms\BookForm;


public function create(BookForm $form)
{
	return view('books.create')->with('form', $form->generate('POST', route('books.store')));
}

Insde View

To render the form simply do {{ $form }}

NOTE: Handle disabled inputs

Add below lines insde the body tag of your layout blade file:

<!-- resources/views/layouts/master.blade.php -->

@yield('extra_script')