Laravel 5.2: Undefined class form

拈花ヽ惹草 提交于 2019-12-04 19:28:45

Actually i'm not even mad that's amazing because I found a solution to my problem... just around 5 min after I post my question... And I spend around 2 hours to find a solution...

All I did was:

php artisan clear-compiled
php artisan ide-helper:generate
php artisan optimize

and reload the blade.php.

I have no idea why, but it works now. It seems I forgot to run the above commands after I got Laravel Collective 5.2 in the project. This could be the reason that form command didn't work. .___.;;

I hope someone could use this information for their own project.

masuduzzaman

You can get full solution about form builder in Laravel 5.2.

Run command prompt and execute

  1. composer require laravelcollective/html
  2. Open config/app.php In providers array add Collective\Html\HtmlServiceProvider::class and in aliases array add
‘Form’ => Collective\Html\FormFacade::class,
‘Html’ => Collective\Html\HtmlFacade::class

For more details, See there http://laraveldeveloper.me/form-in-laravel-5-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!