app/Http/Controllers/FilmController.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)
    {
        $films = Film::with(['genres.gener'])->withCount('comments')->orderBy('id', 'Desc')->paginate($request->limit);
        return success_response(JsonResponse::HTTP_CREATED, 'Sucess', $films);
    }
public function index ( Request $ request ) { $ films = Film :: with ( [ 'genres.gener' ] ) -> withCount ( 'comments' ) -> orderBy ( 'id' , 'Desc' ) -> paginate ( $ request -> limit ) ; return success_response ( JsonResponse :: HTTP_CREATED , 'Sucess' , $ films ) ; }
Display a listing of the resource.
Display a listing of the resource .