app/Http/Controllers/TareaController.php
/**
* Remove the specified resource from storage.
*
* @param  int  $id
* @return \Illuminate\Http\Response
*/
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id)
{
    try {
        $tarea = Tarea::find($id);
        $tarea->delete();
        return response([
            'status' => Response::HTTP_OK,
            'response_time' => microtime(true) - LARAVEL_START,
            'msg' => 'Tarea eliminada con exito.',
            'tarea' =>$tarea,
        ],Response::HTTP_OK);
    } catch (Exception $e) {
        return response([
            'status' => Response::HTTP_BAD_REQUEST,
            'response_time' => microtime(true) - LARAVEL_START,
            'msg' => 'Error al eliminar la tarea.',
            'error' => config('constants.ERR_04'),
            'consola' =>$e->getMessage(),
            'tarea' =>$tarea,
            'request' =>$request,
        ],Response::HTTP_BAD_REQUEST);
    }
}
public function destroy ( $ id ) { try { $ tarea = Tarea :: find ( $ id ) ; $ tarea -> delete ( ) ; return response ( [ 'status' => Response :: HTTP_OK , 'response_time' => microtime ( true ) - LARAVEL_START , 'msg' => 'Tarea eliminada con exito.' , 'tarea' => $ tarea , ] , Response :: HTTP_OK ) ; } catch ( Exception $ e ) { return response ( [ 'status' => Response :: HTTP_BAD_REQUEST , 'response_time' => microtime ( true ) - LARAVEL_START , 'msg' => 'Error al eliminar la tarea.' , 'error' => config ( 'constants.ERR_04' ) , 'consola' => $ e -> getMessage ( ) , 'tarea' => $ tarea , 'request' => $ request , ] , Response :: HTTP_BAD_REQUEST ) ; } }
Remove the specified resource from storage.
Remove the specified resource from storage .