37 lines
631 B
PHP
37 lines
631 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Leenooks\Traits\SingleOrFail;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
use SingleOrFail;
|
|
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
self::bootSingleOrfail();
|
|
|
|
Gate::define('wholesaler', function ($user) {
|
|
return $user->isWholesaler();
|
|
});
|
|
|
|
Gate::define('reseller', function ($user) {
|
|
return $user->isReseller();
|
|
});
|
|
}
|
|
}
|