Route redirection is not working in Laravel
After successfully login in my Laravel application, it takes me to dashbaord. After logout from the application it takes me to the login page again. But if I click back icon from the browser It will take me to dashboard again though I have log out.
routes
Route::get('/admin-login', 'userController@index');
Route::post('/admin-login', 'userController@admin_login');
Route::get('/admin-logout', 'userController@admin_logout');
Route::get('/dashboard', 'dashboardController@index');
dashboardController.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class dashboardController extends Controller
{
public function __construct()
{
if (!Auth::check()) {
return redirect('/admin-login'); //This Redirection Doesn't Work
}
}
public function index()
{
return view('admin.dashboard.dashboard');
}
}
Where is the problem I can't find out. Please Anybody help ? Thanks in advance.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2YszgOG
via IFTTT
تعليقات
إرسال تعليق