Working on overall app structure.

This commit is contained in:
Taylor Otwell
2014-07-31 15:13:50 -05:00
parent a5001352e6
commit 0e0fd73b43
15 changed files with 226 additions and 113 deletions

View File

@@ -0,0 +1,27 @@
<?php
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider {
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Support\ServiceProvider;
class ArtisanServiceProvider extends ServiceProvider {
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the service provider.
*
* @return void
*/
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;
});
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Support\ServiceProvider;
class ErrorServiceProvider extends ServiceProvider {
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->setupErrorHandlers();
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* 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,41 @@
<?php
use Illuminate\Support\ServiceProvider;
class LogServiceProvider extends ServiceProvider {
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->setupLogging();
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* 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');
}
}

26
app/src/User.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class User extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = array('password', 'remember_token');
}