add some more functions
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models\Order\Loan;
|
||||
|
||||
use App\Models\Branch\Branch;
|
||||
use App\Models\System\Location\Province;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -93,4 +94,20 @@ class LoanOrder extends Model
|
||||
{
|
||||
return $this->belongsTo(Province::class, 'province_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* User (who created order)
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* User who revieved order
|
||||
*/
|
||||
public function filledBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'filled_by');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user