This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_DATABASE = devopsschool | |
DB_USERNAME = root | |
DB_PASSWORD = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function run() | |
{ | |
$this->call(UsersTableSeeder::class); | |
$this->call(RolesTableSeeder::class); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(auth::check() && Auth::user()->role_id == 1){ | |
return $next($request); | |
} | |
else { | |
return redirect()->route('login'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
public function handle($request, Closure $next) | |
{ | |
if(auth::check() && Auth::user()->role_id == 2){ | |
return $next($request); | |
} | |
else { | |
return redirect()->route('login'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
public function handle($request, Closure $next, $guard = null) | |
{ | |
if (Auth::guard($guard)->check() && Auth::user()->role_id == 1) { | |
return redirect()->route('admin.dashboard'); | |
} elseif(Auth::guard($guard)->check() && Auth::user()->role_id == 2){ | |
return redirect()->route('user.dashboard'); | |
} else { | |
return $next($request); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
public function __construct() | |
{ | |
if(Auth::check() && Auth::user()->role_id == 1){ | |
$this->redirectTo = route('admin.dashboard'); | |
} elseif(Auth::check() && Auth::user()->role_id == 2){ | |
$this->redirectTo = route('user.dashboard'); | |
} | |
$this->middleware('guest')->except('logout'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
Route::group(['as'=>'admin.','prefix' => 'admin','namespace'=>'Admin','middleware'=>['auth','admin']], function () { | |
Route::get('dashboard', 'DashboardController@index')->name('dashboard'); | |
}); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Route::group(['as'=>'user.','prefix' => 'user','namespace'=>'User','middleware'=>['auth','user']], function () { | |
Route::get('dashboard', 'DashboardController@index')->name('dashboard'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews -Indexes | |
</IfModule> | |
RewriteEngine On | |
# Handle Authorization Header | |
RewriteCond %{HTTP:Authorization} . | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Auto Refresh Div Content Using jQuery and AJAX</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> | |
<style> | |
body | |
{ | |
margin:0; |