예제 #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $concrete = Concrete::whereId($id)->first();
     if (!empty($concrete)) {
         return $this->saveResponse($concrete->delete());
     }
     return $this->saveResponse(false);
 }
 /**
  * Handle the command.
  *
  * @param  UpdateConcreteCommand  $command
  * @return void
  */
 public function handle(UpdateConcreteCommand $command)
 {
     $concrete = Concrete::whereId($command->id)->first();
     if (!empty($concrete)) {
         $concrete->title = $command->title;
         $concrete->description = $command->description;
         $concrete->extra_description = $command->extra_description;
         $concrete->amount = $command->amount;
         $concrete->category_id = $command->category_id;
         if ($concrete->update()) {
             return $concrete;
         }
     }
     return false;
 }