This commit is contained in:
denisdulici
2017-12-05 15:56:33 +03:00
parent 30552413c1
commit 2b2bc4ff5b
4 changed files with 23 additions and 11 deletions

View File

@ -48,4 +48,15 @@ class Category extends Model
{
return $query->where('type', $type);
}
/**
* Scope transfer category.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeTransfer($query)
{
return $query->where('type', 'other')->pluck('id')->first();
}
}