laravel-learn-bbs/app/Models/Model.php

20 lines
328 B
PHP
Raw Permalink Normal View History

2018-01-01 04:00:45 +00:00
<?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');
}
}