“Laravel Make: Middleware” Code-Antworten

Laravel Make: Middleware

php artisan make:middleware AdminMiddleware
Different Dogfish

Laravel Make: Middleware

public function handle($request, Closure $next)
{
    if ($request->user()->type != 'A')
    {
        return redirect('home');
    }

    return $next($request);
}
Different Dogfish

Laravel Make: Middleware

Route::group(['middleware' => 'App\Http\Middleware\AdminMiddleware'], function()
{
    Route::get ('/admin', ['uses' => 'AdminController@index', 'before' => 'admin']); 

});
Different Dogfish

Laravel Make: Middleware

if (Auth::user()->is_admin != 1) {...}
Different Dogfish

Ähnliche Antworten wie “Laravel Make: Middleware”

Fragen ähnlich wie “Laravel Make: Middleware”

Weitere verwandte Antworten zu “Laravel Make: Middleware” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen