Faadil Farick Faadil Farick - 3 years ago 158
PHP Question

Laravel5 auth.basic not working

I'm having a "spotlight" page that should pass an authorization but even after i implemented these it's just going to that page directly

These are the codes in

web.php


Route::get('spotlight', array(
'before' => 'auth.basic',
function()
{
return view('spotlight');
}));


There were similar questions i tried but didn't find a solution. Anything missing here.
Browser based authentication not prompting

Answer Source

If you are using laravel 5.4 you can attach middleware using middleware() function

Route::get('spotlight', function () {
    return view('spotlight');
})->middleware('auth.basic');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download