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



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2KPCuTq
via IFTTT

Aucun commentaire:

Enregistrer un commentaire