Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to get meta information from pagination in laravel controller

public function toArray($request)
    {
        return [
            'data' => StoreResource::collection($this->collection),
            'pagination' => [
                "current_page" => $this->currentPage(),
                "first_page_url" =>  $this->getOptions()['path'].'?'.$this->getOptions()['pageName'].'=1',
                "prev_page_url" =>  $this->previousPageUrl(),
                "next_page_url" =>  $this->nextPageUrl(),
                "last_page_url" =>  $this->getOptions()['path'].'?'.$this->getOptions()['pageName'].'='.$this->lastPage(),
                "last_page" =>  $this->lastPage(),
                "per_page" =>  $this->perPage(),
                "total" =>  $this->total(),
                "path" =>  $this->getOptions()['path'],
            ],
        ];
    }
Comment

PREVIOUS NEXT
Code Example
Php :: Carbon Add Years To Date In Laravel 
Php :: phpunit test private function 
Php :: curl error (code 3) url malformed laravel 
Php :: how to execute php function on button click 
Php :: how to make model and controller in laravel 
Php :: wordpress send reset password link inside wp_new_user_notification_email 
Php :: add another column in a table in laravel 
Php :: file_get_content 
Php :: mysqli exception handling 
Php :: wp_debug 
Php :: how to check the day of any date in php 
Php :: Unknown column type "double" requested. Any Doctrine type that you use has to be registered with DoctrineDBALTypesType::addType 
Php :: cut the first character in php 
Php :: laravel search multiple tables 
Php :: message get with return action laravel 
Php :: create a laravel project 
Php :: elementor woo product hide add to cart 
Php :: codeigniter session destroy automatically after redirect 
Php :: php class file upload 
Php :: aws sdk php 
Php :: livewire from one component to another 
Php :: dependable validation in laravel 
Php :: Woocommerce get image galleries by product id 
Php :: drupal 9 custom blocks dependency injection 
Php :: session start php 
Php :: laravel collection collapse 
Php :: get number of days between two dates php 
Php :: nested for loop in php 
Php :: how to create foreign key in laravel 
Php :: array_chunk in php 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =