This commit is contained in:
parent
094808a98f
commit
29d937b95b
@ -27,6 +27,7 @@ class ShipsController extends Controller
|
|||||||
$ship->save();
|
$ship->save();
|
||||||
}catch(\Exception $e){
|
}catch(\Exception $e){
|
||||||
session()->flash('error', 'Failed to create record.');
|
session()->flash('error', 'Failed to create record.');
|
||||||
|
Log::error($e);
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -38,6 +39,7 @@ class ShipsController extends Controller
|
|||||||
try {
|
try {
|
||||||
DB::table('ships')->where('id', $request->get('deleteShip'))->delete();
|
DB::table('ships')->where('id', $request->get('deleteShip'))->delete();
|
||||||
}catch(\Exception $e){
|
}catch(\Exception $e){
|
||||||
|
Log::error($e);
|
||||||
session()->flash('error', 'Failed to delete record.');
|
session()->flash('error', 'Failed to delete record.');
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
@ -54,6 +56,7 @@ class ShipsController extends Controller
|
|||||||
'shipOwner' => request('shipOwner')
|
'shipOwner' => request('shipOwner')
|
||||||
));
|
));
|
||||||
}catch(\Exception $e){
|
}catch(\Exception $e){
|
||||||
|
Log::error($e);
|
||||||
session()->flash('error', 'Failed to update record. Is it possible that the ship ID is not unique?');
|
session()->flash('error', 'Failed to update record. Is it possible that the ship ID is not unique?');
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user