File manager - Edit - /var/www/payraty/hris/app/Models/TransferBalance.php
Back
<?php namespace App\Models; use Illuminate\Support\Facades\Auth; use App\Scopes\OrganisationScope; use Illuminate\Database\Eloquent\Model; class TransferBalance extends Model { protected $fillable = [ 'from_account_id', 'to_account_id', 'date', 'amount', 'payment_type_id', 'referal_id', 'description', 'created_by', 'organisation_id', ]; public function account($account) { $account = AccountList::where('id','=',$account)->first(); return $account; } public function payment_type($payment) { $payment = PaymentType::where('id','=',$payment)->first(); return $payment; } public function payment_types() { return $this->hasOne('App\Models\PaymentType', 'id', 'payment_type_id'); } protected static function booted() { static::addGlobalScope(new OrganisationScope); static::creating(function ($model) { if (Auth::check()) { $model->organisation_id = Auth::user()->organisation_id; } }); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings