⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
hospital.dev-unit.com
/
app
/
Models
/
View File Name :
CaseHandler.php
<?php namespace App\Models; use App\Traits\PopulateTenantID; use Eloquent as Model; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Support\Carbon; use Stancl\Tenancy\Database\Concerns\BelongsToTenant; /** * Class CaseHandler * * @version February 28, 2020, 3:14 am UTC * * @property int $id * @property int $user_id * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property-read Address $address * @property-read User $user * * @method static Builder|CaseHandler newModelQuery() * @method static Builder|CaseHandler newQuery() * @method static Builder|CaseHandler query() * @method static Builder|CaseHandler whereCreatedAt($value) * @method static Builder|CaseHandler whereId($value) * @method static Builder|CaseHandler whereUpdatedAt($value) * @method static Builder|CaseHandler whereUserId($value) * * @mixin Model * * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\EmployeePayroll[] $payrolls * @property-read int|null $payrolls_count * @property int $is_default * * @method static Builder|CaseHandler whereIsDefault($value) */ class CaseHandler extends Model { use BelongsToTenant, PopulateTenantID; /** * Validation rules * * @var array */ public static $rules = [ 'first_name' => 'required', 'last_name' => 'required', 'email' => 'required|email|is_unique:users,email', 'password' => 'nullable|same:password_confirmation|min:6', 'designation' => 'required', 'qualification' => 'required', 'image' => 'mimes:jpeg,png,jpg,gif,webp', ]; public $table = 'case_handlers'; public $fillable = [ 'user_id', ]; const STATUS_ALL = 2; const ACTIVE = 1; const INACTIVE = 0; const STATUS_ARR = [ self::STATUS_ALL => 'All', self::ACTIVE => 'Active', self::INACTIVE => 'Deactive', ]; /** * Get the attributes that should be cast. * * @return array<string, string> */ protected function casts(): array { return [ 'id' => 'integer', 'user_id' => 'integer', ]; } public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } public function address(): MorphOne { return $this->morphOne(Address::class, 'owner'); } public function payrolls(): MorphMany { return $this->morphMany(EmployeePayroll::class, 'owner'); } }