laravel-6

Laravel 6: Class 'Form' not found

放肆的年华 提交于 2019-11-30 09:53:57
问题 I have a fresh Laravel 6 and I try to use Laravel forms but I got the error saying "Class 'Form' not found ". I tried the followings but still not working: 1). Add this to composer.json "require": { "laravelcollective/html": "~6.0" } 2). update composer from the Terminal: composer update 3). add this to the providers of config/app.php: 'providers' => [ // ... 'Collective\Html\HtmlServiceProvider', // ... ], 4). Finally, add two class aliases to the aliases array of config/app.php: 'aliases' =

Laravel: customize or extend notifications - database model

喜欢而已 提交于 2019-11-26 17:13:48
问题 IMHO, the current Database channel for saving notifications in Laravel is really bad design: You can't use foreign key cascades on items for cleaning up notifications of a deleted item for example Searching custom attributes in the data column (casted to Array) is not optimal How would you go about extending the DatabaseNotification Model in vendor package? I would like to add columns event_id , question_id , user_id (the user that created the notification) etc... to the default laravel

Laravel: How to Get Current Route Name? (v5 & v6)

Deadly 提交于 2019-11-26 06:14:49
问题 In Laravel v4 I was able to get the current route name using... Route::currentRouteName() How can I do it in Laravel v5 and Laravel v6 ? 回答1: Try this Route::getCurrentRoute()->getPath(); or \Request::route()->getName() from v5.1 use Illuminate\Support\Facades\Route; $currentPath= Route::getFacadeRoot()->current()->uri(); Laravel v5.2 Route::currentRouteName(); //use Illuminate\Support\Facades\Route; Or if you need the action name Route::getCurrentRoute()->getActionName(); Laravel 5.2 route