<?php namespace App\Models\Cost; use App\Models\Service; use App\Models\Service\Generic as GenericService; class Generic extends Type { protected $table = 'cost_generic'; /* RELATIONS */ public function service() { return $this->hasOneThrough(Service::class,GenericService::class,'id','id','service_generic_id','service_id'); } }