public function deleteAction($id) { if (!($widget = Widget::find($id))) { App::abort(404, 'Widget not found.'); } $widget->delete(); return ['message' => 'success']; }