Working on overall app structure.
This commit is contained in:
27
app/src/Providers/AppServiceProvider.php
Normal file
27
app/src/Providers/AppServiceProvider.php
Normal 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()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
45
app/src/Providers/ArtisanServiceProvider.php
Normal file
45
app/src/Providers/ArtisanServiceProvider.php
Normal 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;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
46
app/src/Providers/ErrorServiceProvider.php
Normal file
46
app/src/Providers/ErrorServiceProvider.php
Normal 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);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
41
app/src/Providers/LogServiceProvider.php
Normal file
41
app/src/Providers/LogServiceProvider.php
Normal 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
26
app/src/User.php
Normal 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');
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user