1
我將另一個Laravel 4升級到5個實例。現在Exceptions中有一個文件「ExceptionServiceProvider」。以下代碼:Laravel 5 app :: error
<?
namespace KeepIt\Exceptions;
use Illuminate\Support\ServiceProvider;
class ExceptionServiceProvider extends ServiceProvider
{
public function register()
{
\App::error(function(AjaxException $exception)
{
$response = array(
'state' => false,
'message' => $exception->getErrorMessage(),
'errors' => $exception->getErrors(),
'type' => $exception->getType()
);
return \Response::json($response);
});
}
}
我知道App :: error在L5中不再工作,但是我不明白它是否重寫了這段代碼。這不是404這是500錯誤投擲。
不明白這一點......在laravel 5應用::誤差不到風度的工作了,所以我有,如果應用程序拋出500和響應使用JSON喜歡它顯示了代碼重寫它。 – blubbering