File manager - Edit - /var/www/payraty/hris/app/Models/JobGrade.php
Back
<?php namespace App\Models; use App\Scopes\OrganisationScope; use Auth; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; class JobGrade extends Model { // protected $guarded = []; protected static function booted() { static::addGlobalScope(new OrganisationScope()); // Automatically set the organisation_id before creating the model static::creating(function ($model) { if (Auth::check()) { $model->organisation_id = Auth::user()->organisation_id; } }); } /** * Get the designations that owns the JobGrade * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function designations(): HasMany { return $this->hasMany(Designation::class); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings