Large refactor of HTTP and Console stack.
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
<?php namespace App\Providers;
|
||||
|
||||
use Illuminate\Routing\Router;
|
||||
use Illuminate\Routing\Stack\Builder as Stack;
|
||||
use Illuminate\Foundation\Support\Providers\AppServiceProvider as ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider {
|
||||
|
||||
/**
|
||||
* All of the application's route middleware keys.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
'auth' => 'App\Http\Middleware\AuthMiddleware',
|
||||
'auth.basic' => 'App\Http\Middleware\BasicAuthMiddleware',
|
||||
'csrf' => 'App\Http\Middleware\CsrfMiddleware',
|
||||
'guest' => 'App\Http\Middleware\GuestMiddleware',
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's middleware stack.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $stack = [
|
||||
'App\Http\Middleware\MaintenanceMiddleware',
|
||||
'Illuminate\Cookie\Middleware\Guard',
|
||||
'Illuminate\Cookie\Middleware\Queue',
|
||||
'Illuminate\Session\Middleware\Reader',
|
||||
'Illuminate\Session\Middleware\Writer',
|
||||
'Illuminate\View\Middleware\ErrorBinder',
|
||||
'App\Http\Middleware\CsrfMiddleware',
|
||||
];
|
||||
|
||||
/**
|
||||
* Build the application stack based on the provider properties.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function stack()
|
||||
{
|
||||
$this->app->stack(function(Stack $stack, Router $router)
|
||||
{
|
||||
return $stack
|
||||
->middleware($this->stack)->then(function($request) use ($router)
|
||||
{
|
||||
return $router->dispatch($request);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,7 +19,7 @@ class ArtisanServiceProvider extends ServiceProvider {
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->commands('App\Console\InspireCommand');
|
||||
$this->commands('App\Console\Commands\InspireCommand');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ class ArtisanServiceProvider extends ServiceProvider {
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return ['App\Console\InspireCommand'];
|
||||
return ['App\Console\Commands\InspireCommand'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php namespace App\Providers;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Contracts\Logging\Log;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Contracts\Exception\Handler;
|
||||
|
||||
class ErrorServiceProvider extends ServiceProvider {
|
||||
|
||||
/**
|
||||
* Register any error handlers.
|
||||
*
|
||||
* @param Handler $handler
|
||||
* @param Log $log
|
||||
* @return void
|
||||
*/
|
||||
public function boot(Handler $handler, Log $log)
|
||||
{
|
||||
// Here you may handle any errors that occur in your application, including
|
||||
// logging them or displaying custom views for specific errors. You may
|
||||
// even register several error handlers to handle different types of
|
||||
// exceptions. If nothing is returned, the default error view is
|
||||
// shown, which includes a detailed stack trace during debug.
|
||||
$handler->error(function(Exception $e) use ($log)
|
||||
{
|
||||
$log->error($e);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,13 +5,6 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider {
|
||||
|
||||
/**
|
||||
* The root namespace to assume when generating URLs to actions.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $rootUrlNamespace = 'App\Http\Controllers';
|
||||
|
||||
/**
|
||||
* The controllers to scan for route annotations.
|
||||
*
|
||||
@@ -23,6 +16,18 @@ class RouteServiceProvider extends ServiceProvider {
|
||||
'App\Http\Controllers\Auth\PasswordController',
|
||||
];
|
||||
|
||||
/**
|
||||
* All of the application's route middleware keys.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
'auth' => 'App\Http\Middleware\AuthMiddleware',
|
||||
'auth.basic' => 'App\Http\Middleware\BasicAuthMiddleware',
|
||||
'csrf' => 'App\Http\Middleware\CsrfMiddleware',
|
||||
'guest' => 'App\Http\Middleware\GuestMiddleware',
|
||||
];
|
||||
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user