/home/techb158/ileadtechnology.com/SSM/app/Models/configuration/employee
Edit: /home/techb158/ileadtechnology.com/SSM/app/Models/configuration/employee/EmployeeGroup.php (1366B)
'array'];
protected $primaryKey = 'id';
protected $table = 'employee_groups';
protected static $logName = 'employee_group';
protected static $logFillable = true;
protected static $logOnlyDirty = true;
protected static $ignoreChangedAttributes = ['updated_at'];
public function employees()
{
return $this->belongsToMany('App\Models\Employee\Employee', 'employee_group_collection', 'employee_group_id', 'employee_id');
}
public function getOption(string $option)
{
return array_get($this->options, $option);
}
public function scopeFilterById($q, $id)
{
if (! $id) {
return $q;
}
return $q->where('id', '=', $id);
}
public function scopeFilterByName($q, $name, $s = 0)
{
if (! $name) {
return $q;
}
return $s ? $q->where('name', '=', $name) : $q->where('name', 'like', '%'.$name.'%');
}
}