⚝
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 :
DoctorDepartment.php
<?php namespace App\Models; use App\Traits\PopulateTenantID; use Eloquent as Model; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Carbon; use Stancl\Tenancy\Database\Concerns\BelongsToTenant; /** * Class DoctorDepartment * * @version February 21, 2020, 5:23 am UTC * * @property string title * @property string description * @property int $id * @property Carbon|null $created_at * @property Carbon|null $updated_at * * @method static Builder|DoctorDepartment newModelQuery() * @method static Builder|DoctorDepartment newQuery() * @method static Builder|DoctorDepartment query() * @method static Builder|DoctorDepartment whereCreatedAt($value) * @method static Builder|DoctorDepartment whereDescription($value) * @method static Builder|DoctorDepartment whereId($value) * @method static Builder|DoctorDepartment whereTitle($value) * @method static Builder|DoctorDepartment whereUpdatedAt($value) * * @mixin Model * * @property-read Collection|Doctor[] $doctors * @property-read int|null $doctors_count * @property int $is_default * * @method static Builder|DoctorDepartment whereIsDefault($value) */ class DoctorDepartment extends Model { use BelongsToTenant, PopulateTenantID; public $table = 'doctor_departments'; public $fillable = [ 'title', 'tenant_id', 'description', ]; /** * Validation rules * * @var array */ public static $rules = [ 'title' => 'required|is_unique:doctor_departments,title', ]; /** * Get the attributes that should be cast. * * @return array<string, string> */ protected function casts(): array { return [ 'id' => 'integer', 'title' => 'string', 'description' => 'string', ]; } public function doctors(): HasMany { return $this->hasMany(Doctor::class, 'doctor_department_id'); } }