added number scope to the transaction model

This commit is contained in:
Cihan Şentürk 2023-07-20 15:40:36 +03:00 committed by GitHub
parent 6a07f8ad9e
commit 10a39de970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,6 +165,11 @@ class Transaction extends Model
return $this->belongsTo('App\Models\Auth\User', 'contact_id', 'id');
}
public function scopeNumber(Builder $query, string $number): Builder
{
return $query->where('number', '=', $number);
}
public function scopeType(Builder $query, $types): Builder
{
if (empty($types)) {