34 lines
677 B
PHP
34 lines
677 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Bank extends Model
|
|
{
|
|
use HasFactory, SoftDeletes;
|
|
|
|
protected $table = 'banks';
|
|
|
|
protected $fillable = [
|
|
'bank_code',
|
|
'bank_name',
|
|
'account_no',
|
|
'account_name',
|
|
'is_active',
|
|
'sort_order',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_active' => 'boolean',
|
|
'sort_order' => 'integer',
|
|
];
|
|
|
|
public function scopeActive($query)
|
|
{
|
|
return $query->where('is_active', true)->orderBy('sort_order')->orderBy('id');
|
|
}
|
|
}
|