This commit is contained in:
2025-11-04 23:35:46 +05:00
parent cc3a9cd854
commit 8c33cc6645
6 changed files with 56 additions and 34 deletions

View File

@@ -3,7 +3,10 @@
namespace App\Modules\LoanPaidOffLetter\Models;
use App\Models\User;
use App\Modules\Branch\Interfaces\BelongsToBranch;
use App\Modules\Branch\Models\Branch;
use App\Modules\LoanOrder\Repositories\LoanOrderRepository;
use App\Modules\OrderStatus\Interfaces\HasStatus;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -30,7 +33,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
* @property \Illuminate\Support\Carbon $created_at
* @property \Illuminate\Support\Carbon $updated_at
*/
class LoanPaidOffLetter extends Model
class LoanPaidOffLetter extends Model implements BelongsToBranch, HasStatus
{
protected $table = 'loan_paid_off_letters';
@@ -58,4 +61,15 @@ class LoanPaidOffLetter extends Model
{
return $this->belongsTo(Branch::class);
}
/**
* "boot" method for model
*/
protected static function boot(): void
{
parent::boot();
static::creating(LoanOrderRepository::creating());
static::created(LoanOrderRepository::created());
}
}