Muhseen

ErrorException : Non-static method Illuminate\Routing\Route::middleware() should not be called statically

laravel Icon

ErrorException (E_DEPRECATED)

Non-static method Illuminate\Routing\Route::middleware() should not be called statically

An unhandled exception occurred on line 19
17
Auth::routes();
18
 
19
Route::middleware(['auth'])->group(function () {
20
 
21
    Route::get('/', function () {

Solution

The Route class being used here is the wrong class. it should be 
 "use Illuminate\Support|\Facades\Route;"            
Apr 07, 2021 Anyone

0 replies


Install the browser extension

Found this solution helpful? Try our extension for quick solutions to your Laravel errors.

Chrome logo Add to Chrome - It's free