osb/app/Providers/AuthServiceProvider.php

39 lines
768 B
PHP
Raw Normal View History

2017-11-03 05:26:07 +00:00
<?php
namespace App\Providers;
2018-06-05 11:13:57 +00:00
use Laravel\Passport\Passport;
2017-11-03 05:26:07 +00:00
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];
2017-11-03 05:26:07 +00:00
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
Passport::routes();
// Passport::enableImplicitGrant();
Gate::define('wholesaler', function ($user) {
return $user->isWholesaler();
});
Gate::define('reseller', function ($user) {
return $user->isReseller();
});
}
}