How do you add a global scope to help sorting records by default in Laravel?

protected static function boot()

    static::addGlobalScope('order', function (Builder $builder) {

Share this article

Share on facebook
Share on twitter
Share on linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top