Working on new directory structure.

This commit is contained in:
Taylor Otwell
2014-08-11 10:13:20 -05:00
parent 8aa4a0a6dc
commit 6070d93c4a
25 changed files with 225 additions and 220 deletions

View File

@@ -1,4 +1,4 @@
<?php
<?php namespace Providers;
use Illuminate\Support\ServiceProvider;

View File

@@ -1,5 +1,6 @@
<?php
<?php namespace Providers;
use InspireCommand;
use Illuminate\Support\ServiceProvider;
class ArtisanServiceProvider extends ServiceProvider {
@@ -21,25 +22,7 @@ class ArtisanServiceProvider extends ServiceProvider {
*/
public function register()
{
$this->registerInspireCommand();
$this->commands('commands.inspire');
}
/**
* Register the Inspire Artisan command.
*
* @return void
*/
protected function registerInspireCommand()
{
// Each available Artisan command must be registered with the console so
// that it is available to be called. We'll register every command so
// the console gets access to each of the command object instances.
$this->app->bindShared('commands.inspire', function()
{
return new InspireCommand;
});
$this->commands('InspireCommand');
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php namespace Providers;
use Illuminate\Support\ServiceProvider;
@@ -11,7 +11,16 @@ class ErrorServiceProvider extends ServiceProvider {
*/
public function boot()
{
$this->setupErrorHandlers();
// 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.
$this->app->error(function(\Exception $exception, $code)
{
$this->app['log']->error($exception);
});
}
/**
@@ -24,23 +33,4 @@ class ErrorServiceProvider extends ServiceProvider {
//
}
/**
* Setup the error handlers for the application.
*
* @return void
*/
protected function setupErrorHandlers()
{
// 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.
$this->app->error(function(Exception $exception, $code)
{
Log::error($exception);
});
}
}

View File

@@ -0,0 +1,37 @@
<?php namespace Providers;
use Illuminate\Routing\FilterServiceProvider as ServiceProvider;
class FilterServiceProvider extends ServiceProvider {
/**
* The filters that should run before all requests.
*
* @var array
*/
protected $before = [
'MaintenanceFilter',
];
/**
* The filters that should run after all requests.
*
* @var array
*/
protected $after = [
//
];
/**
* All available route filters.
*
* @var array
*/
protected $filters = [
'auth' => 'AuthFilter',
'auth.basic' => 'BasicAuthFilter',
'csrf' => 'CsrfFilter',
'guest' => 'GuestFilter',
];
}

View File

@@ -1,4 +1,4 @@
<?php
<?php namespace Providers;
use Illuminate\Support\ServiceProvider;
@@ -11,7 +11,13 @@ class LogServiceProvider extends ServiceProvider {
*/
public function boot()
{
$this->setupLogging();
// Here we will configure the error logger setup for the application which
// is built on top of the wonderful Monolog library. By default we will
// build a basic log file setup which creates a single file for logs.
$this->app['log']->useFiles(
storage_path().'/logs/laravel.log'
);
}
/**
@@ -24,18 +30,4 @@ class LogServiceProvider extends ServiceProvider {
//
}
/**
* Setup the logging facilities for the application.
*
* @return void
*/
protected function setupLogging()
{
// Here we will configure the error logger setup for the application which
// is built on top of the wonderful Monolog library. By default we will
// build a basic log file setup which creates a single file for logs.
Log::useFiles(storage_path().'/logs/laravel.log');
}
}

View File

@@ -0,0 +1,29 @@
<?php namespace Providers;
use Illuminate\Routing\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider {
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @return void
*/
public function before()
{
//
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->get('/', 'HomeController@index');
}
}