Flash input on model validation errors when creating/editing assets.

This commit is contained in:
Daniel Meltzer 2016-06-22 15:20:49 -04:00
parent b9f72a2afa
commit f6d47887c4

View file

@ -254,6 +254,7 @@ class AssetsController extends Controller
\Session::flash('success', trans('admin/hardware/message.create.success'));
return response()->json(['redirect_url' => route('hardware')]);
}
\Input::flash();
\Session::flash('errors', $asset->getErrors());
return response()->json(['errors' => $asset->getErrors()], 500);
}
@ -417,6 +418,7 @@ class AssetsController extends Controller
\Session::flash('success', trans('admin/hardware/message.update.success'));
return response()->json(['redirect_url' => route("view/hardware", $assetId)]);
}
\Input::flash();
\Session::flash('errors', $asset->getErrors());
return response()->json(['errors' => $asset->getErrors()], 500);