Skip to content

⚙️ Clear (reset) orders by in Laravel for any query ...

License

Notifications You must be signed in to change notification settings

GarethSomers/laravel-clear-orders-by

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel clear "orders" by

clear query builder orders

Usage

->clearOrdersBy()

if you're using too many relations or using built in laravel realtions that using order by and you don't want them use :

$model
->selectRaw('count(*) as MYORDER')
->where('name', 'Bader')
->clearOrdersBy()
->orderBy('MYORDER', 'desc')
auth()->user()->notifications()
->selectRaw('count(*) as MYORDER')
->clearOrdersBy()
->orderBy('MYORDER', 'desc')

Installation

composer require if4lcon/laravel-clear-orders-by

Then add this line Bader\ClearOrdersBy\clearOrdersByServiceProvider::class to service providers in config/app.php.

License

This package is open-sourced software licensed under the MIT license.

About

⚙️ Clear (reset) orders by in Laravel for any query ...

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%