Support the ongoing development of Laravel.io →
Eloquent Laravel Architecture

I need to custom return data like this and view path but I dont know how to extend service provider, i'm using laravel 5.7:

{
   "link": {// my custom code},
   "data":[
        {
            // Result Object
        },
        {
            // Result Object
        }
   ]
}

instead of default:

{
   "total": 50,
   "per_page": 15,
   "current_page": 1,
   "last_page": 4,
   "first_page_url": "http://laravel.app?page=1",
   "last_page_url": "http://laravel.app?page=4",
   "next_page_url": "http://laravel.app?page=2",
   "prev_page_url": null,
   "path": "http://laravel.app",
   "from": 1,
   "to": 15,
   "data":[
        {
            // Result Object
        },
        {
            // Result Object
        }
   ]
}

Thanks!

Last updated 3 years ago.
0

Thank you! for providing a quite triumph concept and knowledge with such an expertise information through which mine problem was sorted out.

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.