55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\Blade;
|
|
use Illuminate\Support\Facades\URL;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
URL::forceScheme('https');
|
|
|
|
Blade::directive('owner', function() {
|
|
return '<?php if(Auth::check() && Auth::user()->hasRoleset(\'Owner\')): ?>';
|
|
});
|
|
|
|
Blade::directive('endowner', function() {
|
|
return '<?php endif; ?>';
|
|
});
|
|
|
|
Blade::directive('admin', function() {
|
|
return '<?php if(Auth::check() && Auth::user()->hasRoleset(\'Administrator\')): ?>';
|
|
});
|
|
|
|
Blade::directive('endadmin', function() {
|
|
return '<?php endif; ?>';
|
|
});
|
|
|
|
Blade::directive('moderator', function() {
|
|
return '<?php if(Auth::check() && Auth::user()->hasRoleset(\'Moderator\')): ?>';
|
|
});
|
|
|
|
Blade::directive('endmoderator', function() {
|
|
return '<?php endif; ?>';
|
|
});
|
|
}
|
|
}
|