If we survive form request validation but fail model validation, ensure that the errors are actually flashed to the session. Another thing that will be better fixed in the future when handling json nicer.

This commit is contained in:
Daniel Meltzer 2016-06-22 10:02:29 -04:00
parent dd1241f964
commit 560115e758

View file

@ -254,8 +254,8 @@ class AssetsController extends Controller
\Session::flash('success', trans('admin/hardware/message.create.success')); \Session::flash('success', trans('admin/hardware/message.create.success'));
return response()->json(['redirect_url' => route('hardware')]); return response()->json(['redirect_url' => route('hardware')]);
} }
\Session::flash('errors', $asset->getErrors());
return response()->json(['errors' => $asset->getErrors()]); return response()->json(['errors' => $asset->getErrors()], 500);
} }
/** /**