File manager - Edit - /var/www/payraty/hris/app/Models/BonusSetup.php
Back
<?php namespace App\Models; use App\Scopes\OrganisationScope; use Auth; use Illuminate\Database\Eloquent\Model; class BonusSetup extends Model { protected $guarded = []; public function organisation() { return $this->belongsTo(Organisation::class); } public function payouts() { return $this->hasMany(BonusPayout::class); } protected $casts = [ 'formula' => 'array', 'effective_start' => 'date', 'effective_end' => 'date', ]; 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