$publishedArticles = Article::paginate(10, ['*'], 'published');
$unpublishedArticles = Article::paginate(10, ['*'], 'unpublished');
The third argument is used as follows:
laravel/public/articles?published=3
laravel/public/articles?unpublished=1
More Related Contents:
- How can I paginate a merged collection in Laravel 5?
- Laravel 4.1: How to paginate eloquent eager relationship?
- How to Convert string response to array laravel
- How to fix Error: laravel.log could not be opened?
- Bulk Insertion in Laravel using eloquent ORM
- “The page has expired due to inactivity” – Laravel 5.5
- Difference between method calls $model->relation(); and $model->relation;
- Laravel blank white screen
- Find total number of results in mySQL query with offset+limit
- Laravel, sync() – how to sync an array and also pass additional pivot fields?
- Php artisan make:auth command is not defined
- Change PHP version used by Composer on Windows
- laravel 5.5 The page has expired due to inactivity. Please refresh and try again
- Expected response code 220 but got code “”, with message “” in Laravel
- Laravel 5.2 – Use a String as a Custom Primary Key for Eloquent Table becomes 0
- Laravel Advanced Wheres how to pass variable into function?
- Laravel 4 removing public from URL
- ReflectionException: Class ClassName does not exist – Laravel
- Laravel 5.2 CORS, GET not working with preflight OPTIONS
- belongsToMany relationship in Laravel across multiple databases
- Laravel app stopped working after upgrading to php 8
- How to store and retrieve image contents from the database using Laravel
- Laravel Eloquent sort by relation table column
- My Laravel 5.2.10 Sessions wont persist
- Laravel / Intervention Image Class – class not found
- What’s the best way to localise a date on Laravel?
- Unresolvable dependency resolving [Parameter #0 [ $name ]]
- Optional parameter in the middle of a route
- Laravel /broadcasting/auth Always Fails With 403 Error
- Symfony\Component\HttpKernel\Exception\NotFoundHttpException Laravel