/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $specialty = Specialty::find($id); if (!is_null($specialty)) { if ($specialty->delete()) { return Redirect::route('admin.specialties.index')->withErrors(array('mainSuccess' => 'Специалността е успешно изтрита.')); } else { return Redirect::route('admin.specialties.index')->withErrors(array('mainError' => 'Грешка с базата данни.')); } } else { return Redirect::route('admin.specialties.index')->withErrors(array('mainError' => 'Специалността не е намерена.')); } }