app/Http/Controllers/ObjetivoController.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(Request $request, $fecha)
    {
        $objetivos=auth()->user()->objetivos()->where('fecha', $fecha)->paginate(50);
        if ($request->is('api/*')) {
            return response()->json($objetivos);
        }
    }
public function index ( Request $ request , $ fecha ) { $ objetivos = auth ( ) -> user ( ) -> objetivos ( ) -> where ( 'fecha' , $ fecha ) -> paginate ( 50 ) ; if ( $ request -> is ( 'api/*' ) ) { return response ( ) -> json ( $ objetivos ) ; } }
Display a listing of the resource.
Display a listing of the resource .