Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/dceprojects.corals.io/Corals/modules/Timesheet/Models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/dceprojects.corals.io/Corals/modules/Timesheet/Models/Employee.php
<?php

namespace Corals\Modules\Timesheet\Models;

use Corals\Foundation\Transformers\PresentableTrait;
use Corals\Modules\Utility\Models\ListOfValue\ListOfValue;
use Corals\User\Models\User;
use Spatie\Activitylog\Traits\LogsActivity;

class Employee extends User
{
    use PresentableTrait, LogsActivity;

    protected $table = 'users';

    /**
     *  Model configuration.
     * @var string
     */
    public $config = 'timesheet.models.employee';
    protected $formModalConfig = ['size' => ''];

    protected static $logAttributes = [];

    protected $casts = [
        'properties' => 'json',
    ];

    protected $guarded = ['id'];

    public function department()
    {
        return $this->belongsTo(ListOfValue::class, 'department_code', 'code');
    }

    public function jobs()
    {
        return Job::query()->whereHas('departments', function ($dep) {
            return $dep->where('code', $this->department_code);
        });

    }


}

Spamworldpro Mini