简体   繁体   中英

Error in Router.php after composer update

After firing composer update on Laravel Framework 5.5.44, i see this error and app goes down.

在此处输入图片说明

I have compared the vendor/laravel folder before and after composer update and it is same. Nothing is added or removed.

Please help me with the possible cause of this error.

I believe your problem is in your web.php file. Where you define a group which is not proper. Your group route should look like this,

Route::group(['middleware' => 'auth'], function () {
      // your  route is here
});

Update this line code Form,

// Guest
Route::group([ 'middleware' => 'guest', 'fw-block-bl'], function () {
});

To,

// Guest
Route::group([ 'middleware' => ['guest', 'fw-block-bl']], function () {
});

Going from the document posted here :

Your issue seems to be in the Route::group() call right under // User :

Route::group([ 'middleware' => 'guest', 'fw-block-bl'], function () {
    // ...
});

The fw-block-bl middleware isn't properly being applied, and the framework doesn't know what to do with that piece. Either wrap the middleware in an array (like below), or use a chained method ( Route::group(function () { /* */ })->middleware('guest', 'fw-block-bl'); )

Route::group(['middleware' => ['guest', 'fw-block-bl'], function () {
    // ...
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM