35 lines
777 B
PHP
Executable File
35 lines
777 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\Blameable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class CorporateServiceSpeciality extends Model
|
|
{
|
|
use HasFactory, SoftDeletes, Blameable;
|
|
|
|
protected $fillable = [
|
|
'corporate_service_id',
|
|
'speciality_id',
|
|
'status'
|
|
];
|
|
|
|
public function corporateService()
|
|
{
|
|
return $this->belongsTo(CorporateService::class, 'corporate_service_id');
|
|
}
|
|
|
|
public function corporate()
|
|
{
|
|
return $this->hasOneThrough(Corporate::class, CorporateService::class);
|
|
}
|
|
|
|
public function speciality()
|
|
{
|
|
return $this->belongsTo(Speciality::class, 'speciality_id');
|
|
}
|
|
}
|