app/Http/Controllers/FaseController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        try {
            $fases= DB::table('planeacion_fases')
            ->select('planeacion_fases.*', 'planeacion_tipos.nombre as nombre_tipo')
            ->join('planeacion_tipos', 'planeacion_fases.planeacion_tipos_id', '=', 'planeacion_tipos.id')
            ->get();
            return response()->json($fases);
        }catch(Exception $e){
            return response([
                'status' => Response::HTTP_BAD_REQUEST,
                'response_time' => microtime(true) - LARAVEL_START,
                'error' => 'fallo_en_la_creacion',
                'consola' =>$e->getMessage(),
                ],Response::HTTP_BAD_REQUEST);
        }
    }
public function index ( ) { try { $ fases = DB :: table ( 'planeacion_fases' ) -> select ( 'planeacion_fases.*' , 'planeacion_tipos.nombre as nombre_tipo' ) -> join ( 'planeacion_tipos' , 'planeacion_fases.planeacion_tipos_id' , '=' , 'planeacion_tipos.id' ) -> get ( ) ; return response ( ) -> json ( $ fases ) ; } catch ( Exception $ e ) { return response ( [ 'status' => Response :: HTTP_BAD_REQUEST , 'response_time' => microtime ( true ) - LARAVEL_START , 'error' => 'fallo_en_la_creacion' , 'consola' => $ e -> getMessage ( ) , ] , Response :: HTTP_BAD_REQUEST ) ; } }
Display a listing of the resource.
Display a listing of the resource .