lundi 3 décembre 2018

Call to a member function named() on null in laravel 5.7

I have this route

Route::get('/books/science', 'BookController@science')->name('scientific');

When I wanted to check this condition (according to document: Inspecting The Current Route)

public function handle($request, Closure $next)
{
    if ($request->route()->named('scientific')) {
        //
    }

    return $next($request);
}

I got this error



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire