protected static function booted()
{
self::addGlobalScope('latest', function ($query){
$query->latest('updated_at');
});
}
public function boot()
{
parent::boot();
Route::bind('project', function($id) {
return AppProject::withoutGlobalScopes()->findOrFail($id);
});
}
Model::withoutGlobalScopes()->get();
protected static function boot()
{
parent::boot();
static::addGlobalScope(new ArchiveScope);
}