This file contains hidden or 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::user()->user_role != 1){ | |
return redirect('/'); | |
} | |
return $next($request); | |
} |
This file contains hidden or 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
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Support\Facades\Auth; // Must Must use | |
use Illuminate\Support\Facades\Blade; // Must Must use | |
This file contains hidden or 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
// Add This Code To Register Controller | |
use Illuminate\Http\Request; | |
use Illuminate\Auth\Events\Registered; | |
public function register(Request $request) | |
{ | |
$this->validator($request->all())->validate(); |
This file contains hidden or 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
<?php | |
class Human{ | |
function accessFunction(){ | |
echo "Best of Mahe Karim "; | |
} | |
} | |
// Access Function | |
$accessFunctionByMethod = new Human(); | |
$accessFunctionByMethod->accessFunction(); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>List rendering</title> | |
</head> | |
<body> | |
<div id="root"> |
This file contains hidden or 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
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class Review extends Model | |
{ | |
// | |
protected $guarded = [ ]; |
This file contains hidden or 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
$user_id = User::insertGetId([ | |
'role_id' => 2, | |
'name' => $request->name, | |
'username' => $request->username, | |
'email' => $request->email, | |
'password' => Hash::make($request->password), | |
'phn_number' => $request->phn_number, | |
'created_at' => Carbon::now() | |
]); | |
if ($request->has('bmdc_cer')){ |
This file contains hidden or 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
protected function authenticated (Request $request, $user) | |
{ | |
if (Auth::check() && Auth::user()->role->id == 1 ) { | |
$this->redirectTo = route('admin.dashboard'); | |
} elseif(Auth::check() && Auth::user()->role->id == 2 ) { | |
$this->redirectTo = route('doctor.dashboard'); | |
} elseif(Auth::check() && Auth::user()->role->id == 3 ) { | |
$this->redirectTo = route('nurse.dashboard'); |
This file contains hidden or 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 update(Request $request) | |
{ | |
$products = Product::findOrfail($request)->first(); | |
$products->product_name = $request->product_name; | |
$products->description = $request->description; | |
$products->total_rate = $request->total_rate; | |
$products->package_rate = $request->package_rate; | |
$products->product_slug = $request->product_slug; | |
$products->package_image = $request->package_image; |