dashboard controller

This commit is contained in:
2019-09-27 19:54:24 -05:00
parent 0997b0b2dd
commit 72915405b9
3 changed files with 35 additions and 7 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Dashboard;
use Illuminate\Http\Request;
class DashboardController extends Controller
{
public function __construct() {
$this->middleware('role:Uesr');
}
public function index() {
return redirect('/');
}
public function profile() {
return redirect('/');
}
}
@@ -4,9 +4,18 @@ namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
use Socialite;
use DB;
use App\Models\User\User;
use Seat\Eseye\Cache\NullCache;
use Seat\Eseye\Configuration;
use Seat\Eseye\Containers\EsiAuthentication;
use Seat\Eseye\Eseye;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
@@ -17,10 +26,9 @@ class RedirectIfAuthenticated
*/
public function handle($request, Closure $next, $guard = null)
{
//if (Auth::guard($guard)->check()) {
// return redirect('/home');
//}
if (Auth::guard($guard)->check()) {
return redirect()->to('/dashboard');
}
return $next($request);
}
}
}
+2 -2
View File
@@ -22,8 +22,8 @@ Route::group(['middleware' => ['auth']], function(){
/**
* Dashboard Controller Display pages
*/
Route::get('/dashboard', 'Dashboard\DashboardController@index');
Route::get('/profile', 'Dashboard\DashboardController@profile');
//Route::get('/dashboard', 'Dashboard\DashboardController@index');
//Route::get('/profile', 'Dashboard\DashboardController@profile');
});