Simplify providers.
This commit is contained in:
parent
78c932f688
commit
198b54d4ad
|
@ -1,9 +1,7 @@
|
|||
<?php namespace App\Providers;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Contracts\Logging\Log;
|
||||
use App, Log, Exception;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Contracts\Exception\Handler;
|
||||
|
||||
class ErrorServiceProvider extends ServiceProvider {
|
||||
|
||||
|
@ -14,7 +12,7 @@ class ErrorServiceProvider extends ServiceProvider {
|
|||
* @param Log $log
|
||||
* @return void
|
||||
*/
|
||||
public function boot(Handler $handler, Log $log)
|
||||
public function boot()
|
||||
{
|
||||
// Here you may handle any errors that occur in your application, including
|
||||
// logging them or displaying custom views for specific errors. You may
|
||||
|
@ -22,9 +20,9 @@ public function boot(Handler $handler, Log $log)
|
|||
// exceptions. If nothing is returned, the default error view is
|
||||
// shown, which includes a detailed stack trace during debug.
|
||||
|
||||
$handler->error(function(Exception $e, $code) use ($log)
|
||||
App::error(function(Exception $e)
|
||||
{
|
||||
$log->error($e);
|
||||
Log::error($e);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php namespace App\Providers;
|
||||
|
||||
use Illuminate\Contracts\Logging\Log;
|
||||
use Log;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class LogServiceProvider extends ServiceProvider {
|
||||
|
@ -11,9 +11,9 @@ class LogServiceProvider extends ServiceProvider {
|
|||
* @param Log $log
|
||||
* @return void
|
||||
*/
|
||||
public function boot(Log $log)
|
||||
public function boot()
|
||||
{
|
||||
$log->useFiles(storage_path().'/logs/laravel.log');
|
||||
Log::useFiles(storage_path().'/logs/laravel.log');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue