コード例 #1
0
 public function destroy($id)
 {
     $taskCategory = TaskCategory::findOrFail($id);
     if ($taskCategory->delete()) {
         return response(204);
     } else {
         return response(500);
     }
 }
コード例 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $task = Task::findOrFail($id);
     $task->delete();
     return view('pages.dashboard')->with('users', User::all())->with('task_categories', TaskCategory::all())->with('tasks', Task::all());
 }
コード例 #3
0
 public function index()
 {
     $tasks = Task::where('is_completed', false)->where('task_category_id', 0)->get();
     $taskCategories = TaskCategory::all();
     return view('tasks.index', ['pageTitle' => 'Tasks'])->with(['tasks' => $tasks, 'taskCategories' => $taskCategories]);
 }
コード例 #4
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $task = TaskCategory::findOrFail($id);
     $task->delete();
     return redirect()->back();
 }