20 lines
328 B
PHP
20 lines
328 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Models;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model as EloquentModel;
|
||
|
|
||
|
class Model extends EloquentModel
|
||
|
{
|
||
|
public function scopeRecent($query)
|
||
|
{
|
||
|
return $query->orderBy('id', 'desc');
|
||
|
}
|
||
|
|
||
|
public function scopeOrdered($query)
|
||
|
{
|
||
|
return $query->orderBy('order', 'desc');
|
||
|
}
|
||
|
|
||
|
}
|