app/Http/Controllers/CustomerStoryController.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)
    {
        $customerStories =CustomerStory::orderBy('created_at', 'desc')->paginate(10);
        if($request->isXmlHttpRequest()) {
            return response(
                view('layouts.admin.customer_story.table', ['cstories' => $customerStories,'count' => count($customerStories)]),
                200,
                ['Content-Type', 'application/json']
            );
        }
        return view('layouts.admin.customer_story.index')->with('cstories', $customerStories)->with('count', count($customerStories));
    }
public function index ( Request $ request ) { $ customerStories = CustomerStory :: orderBy ( 'created_at' , 'desc' ) -> paginate ( 10 ) ; if ( $ request -> isXmlHttpRequest ( ) ) { return response ( view ( 'layouts.admin.customer_story.table' , [ 'cstories' => $ customerStories , 'count' => count ( $ customerStories ) ] ) , 200 , [ 'Content-Type' , 'application/json' ] ) ; } return view ( 'layouts.admin.customer_story.index' ) -> with ( 'cstories' , $ customerStories ) -> with ( 'count' , count ( $ customerStories ) ) ; }
Display a listing of the resource.
Display a listing of the resource .