/** * Delete the task. * * @param $id * @return \Illuminate\Http\RedirectResponse */ public function destroy($id) { $task = Task::findOrFail($id); if ($task->delete()) { flash()->success(trans('admin::messages.success'), trans('admin::messages.tasks.deleted')); } return redirect()->back(); }
/** * Display a listing of the tasks. * * @return \Illuminate\View\View */ public function index() { $tasks = Task::latest()->get(); return view('theme::tasks.list', compact('tasks')); }