app/Http/Controllers/SurveyController.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)
    {
        $user = $request->user();
        return SurveyResource::collection(Survey::where('user_id', $user->id)->paginate());
    }
public function index ( Request $ request ) { $ user = $ request -> user ( ) ; return SurveyResource :: collection ( Survey :: where ( 'user_id' , $ user -> id ) -> paginate ( ) ) ; }
Display a listing of the resource.
Display a listing of the resource .