for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yeelight\Providers;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
/**
* Class ApiServiceProvider
*
* @category Yeelight
* @package Yeelight\Providers
* @author Sheldon Lee <[email protected]>
* @license https://opensource.org/licenses/MIT MIT
* @link https://www.yeelight.com
*/
class ApiServiceProvider extends ServiceProvider
{
* Bootstrap the application services.
* @return void
public function boot()
$handler = app('Dingo\Api\Exception\Handler');
$handler->register(function (AuthenticationException $exception) {
throw new UnauthorizedHttpException(null, $exception->getMessage());
});
$handler->register(function (AuthorizationException $exception) {
throw new AccessDeniedHttpException($exception->getMessage());
}
* Register the application services.
public function register()
//