kristijanhusak / laravel-form-builder

Laravel Form builder for version 5+!
https://packagist.org/packages/kris/laravel-form-builder
MIT License
1.69k stars 295 forks source link

View [] not found #358

Open Ajtak opened 7 years ago

Ajtak commented 7 years ago

Hi, Im use this library where your manual, but it generate error. Controller:

    public function create(FormBuilder $formBuilder)
    {
        $form = $formBuilder->createByArray([
                        [
                            'name' => 'name',
                            'type' => 'text',
                        ],
                        [
                            'name' => 'lyrics',
                            'type' => 'textarea',
                        ], 
                        [
                            'name' => 'publish',
                            'type' => 'checkbox'
                        ],
                    ]
            ,[
            'method' => 'POST',
            'url' => route('song.store')
        ]);

        return view('song.create', compact('form'));
    }

and songs/create.blade.php implementation:

{!! form($form) !!}

This implementation generate View [] not found error.

what is bad? How to fix it?

saeidraei commented 7 years ago

@Ajtak you probably haven't add the Kris\LaravelFormBuilder\FormBuilderServiceProvider::class to app/config.php providers