src/components/auth/src/Authorization/AuthorizationServiceProvider.php
<?php
/**
* Part of the Antares package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file.
*
* @package Antares Core
* @version 0.9.0
* @author Original Orchestral https://github.com/orchestral
* @author Antares Team
* @license BSD License (3-clause)
* @copyright (c) 2017, Antares
* @link http://antaresproject.io
*/
namespace Antares\Authorization;
use Illuminate\Support\ServiceProvider;
use Antares\Model\Permission;
use Antares\Model\Action;
class AuthorizationServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->singleton('antares.acl', function ($app) {
return new Factory($app->make('auth.driver'));
});
$this->app->bind('antares.auth.permission', function () {
return new Permission();
});
$this->app->bind('antares.auth.action', function () {
return new Action();
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return ['antares.acl'];
}
}