Search
 
SCRIPT & CODE EXAMPLE
 

PHP

use multiple pagination in same page laravel

// in controller 
$newEvents = Events::where('event_date', '>=', Carbon::now()->startOfDay())
    ->orderBy('event_date')
    ->paginate(15,['*'], 'newEvents');

$oldEvents = Events::where('event_date', '<', Carbon::now()->startOfDay())
    ->orderBy('event_date', 'desc')
    ->paginate(15,['*'], 'oldEvents');

//use in view
    
// some code to display $newEvents
{!! $newEvents->render() !!}

// some code to display $oldEvents
{!! $oldEvents->render() !!}
Comment

laravel multiple paginate

# use default 'page' for this
$collection1 = Model::paginate(20);

# use custom 'other_page' for this
$collection2 = Model2::paginate(20);
$collection2->setPageName('other_page');
Comment

where clause with paginate laravel multiple column

"SELECT * FROM students WHERE students.user_id = $id AND (students.name like '%$q%' OR students.last_name Like '%$q%' OR students.email Like '%$q%')"
Comment

PREVIOUS NEXT
Code Example
Php :: comments in php 
Php :: check if string contains substring php 8 
Php :: php postgresql 
Php :: how can set defult value for yield in laravel 
Php :: how to include pdf in php page using embed tag 
Php :: laral db innodb 
Php :: get custom post type taxonomy value 
Php :: laravel pagination vuetify 
Php :: guzzle http client 
Php :: laravel use variable inside callback function 
Php :: concat php 
Php :: laravel model update table 
Php :: shortcode php wordpress 
Php :: laravel groupby and latest 
Php :: php use function from same class 
Php :: how to see php error log 
Php :: laravel exist 
Php :: show image laravel 
Php :: laravel blade foreach index value 
Php :: carbon greater than 
Php :: laravel unique validation on multiple columns 
Php :: Eloquent models events 
Php :: php check if all array values are the same 
Php :: wherehas laravel search 
Php :: laravel custom validation message 
Php :: filesize in php 
Php :: mobile detect in laravel 
Php :: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) laravel 
Php :: how to check if all values in an array are equal php 
Php :: php unique associative array by value 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =