<?php

namespace App\Scopes;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;

class OrderByIdDescScope implements Scope
{
    /**
     * Notes   : ID倒序的作用域
     *
     * @Date   : 2021/11/10 10:16 上午
     * @Author : <Jason.C>
     * @param  Builder  $builder
     * @param  Model  $model
     */
    public function apply(Builder $builder, Model $model): void
    {
        $builder->orderByDesc('id');
    }
}
