Form validation does not display results on laravel

My validation form did not show errors on my route posts/create. I parsed the solution and found that

Route::group(['middleware' => 'web'], function() {
    Route::resource('/posts','PostsController'); 
});

can be changed to

Route::group(['middlewareGroups' => 'web'], function() {
    Route::resource('/posts','PostsController');
});

I did this and the problem is solved now. I want to ask if this is considered good practice to change this so?

Also, if I delete this line from my routes, it works:

Route::group(['middleware' => 'web'], function() {

Can someone tell me what is really happening?

+4
source share
2 answers

, web . Laravel - app/Providers/RoutesServiceProvider.php, .php , web .php.

0

, Laravel 5.3 . . https://laravel.com/docs/5.3/middleware#middleware-groups

, :

:: (['middleware' = > 'web'], function() {

, , "web".

laravel. .

0

Source: https://habr.com/ru/post/1658745/


All Articles