tissue/app/Providers/AuthServiceProvider.php

33 lines
661 B
PHP
Raw Normal View History

2017-08-27 04:44:53 +09:00
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
2019-01-15 00:05:01 +09:00
use Illuminate\Support\Facades\Gate;
2017-08-27 04:44:53 +09:00
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
2019-02-11 14:50:55 +09:00
Gate::define('admin', function ($user) {
return $user->is_admin;
});
2017-08-27 04:44:53 +09:00
}
}