mustafaabdujalil's avatar

Apis

using pagination in api request ex : send users ten per page

thanks

0 likes
5 replies
cmdobueno's avatar

Is this a question or a statement?

No one on earth (not even yourself), knows what you want here.

1 like
rawilk's avatar

Something to the effect of: $collection->paginate(10);

1 like
cmdobueno's avatar

So I will do some assuming since you provided NO information here


public function someUnknownMethodNameIsGoingToBeUsedHereBecauseICan(){

       $myVariableToHoldMyPaginationNumber = 10;


    return response()
        ->json(
            [
                'hereIsTheArrayKeyToHoldMyQueryResultsWhereILiterallyJustAddPaginateToMyQuerySoThatICanSendItBack' => MyModelHereHasAReallyReallyLongNameAsWellIAmStartingToNoticeATrend::paginate($myVariableToHoldMyPaginationNumber )
    );

}


jlrdw's avatar

using pagination in api request

Taylor does have that in the documentation.

Please or to participate in this conversation.