Created
September 24, 2019 19:14
-
-
Save MaheKarim/f1be9b1d29e9ed3273a008cb3d5d97fd to your computer and use it in GitHub Desktop.
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 | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Register any application services. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
// | |
} | |
/** | |
* Bootstrap any application services. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
// custome direction | |
Blade::if('admin', function () { | |
return auth()->check() && auth()->user()->role_id == 1; | |
// admin is just a directive name that i want to create | |
// return korbe authentication check korbe login ache kina | |
// && auth () jodi login means user hoy ebong er role ID 1 kina | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment