Esempio n. 1
0
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $tasks = task::find($id);
     if (!$tasks) {
         return Response::json(['error' => ['message' => 'Task does not exist', 'code' => 195]], 404);
     }
     return Response::json(['data' => $this->transform($tasks->toArray())], 200);
     //
 }
Esempio n. 2
0
 public function post_delete($id)
 {
     try {
         $delete = task::find($id);
         $delete->delete();
         return Redirect::action('page1controller@get_index');
     } catch (Exception $e) {
         return $e;
     }
 }
 public function edit($id)
 {
     $data = task::find($id);
     return view('todo-edit')->with('data', $data);
 }