|
@@ -1,25 +1,29 @@
|
|
<?php namespace App\Providers;
|
|
<?php namespace App\Providers;
|
|
|
|
|
|
-use App, Log, Exception;
|
|
|
|
|
|
+use Exception;
|
|
|
|
+use Illuminate\Contracts\Logging\Log;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
+use Illuminate\Contracts\Exception\Handler;
|
|
|
|
|
|
class ErrorServiceProvider extends ServiceProvider {
|
|
class ErrorServiceProvider extends ServiceProvider {
|
|
|
|
|
|
/**
|
|
/**
|
|
* Register any error handlers.
|
|
* Register any error handlers.
|
|
*
|
|
*
|
|
|
|
+ * @param Handler $handler
|
|
|
|
+ * @param Log $log
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
- public function boot()
|
|
|
|
|
|
+ public function boot(Handler $handler, Log $log)
|
|
{
|
|
{
|
|
// Here you may handle any errors that occur in your application, including
|
|
// Here you may handle any errors that occur in your application, including
|
|
// logging them or displaying custom views for specific errors. You may
|
|
// logging them or displaying custom views for specific errors. You may
|
|
// even register several error handlers to handle different types of
|
|
// even register several error handlers to handle different types of
|
|
// exceptions. If nothing is returned, the default error view is
|
|
// exceptions. If nothing is returned, the default error view is
|
|
// shown, which includes a detailed stack trace during debug.
|
|
// shown, which includes a detailed stack trace during debug.
|
|
- App::error(function(Exception $e)
|
|
|
|
|
|
+ $handler->error(function(Exception $e) use ($log)
|
|
{
|
|
{
|
|
- Log::error($e);
|
|
|
|
|
|
+ $log->error($e);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|