I have database tables like this:
shoot: id, name, programme programme: id, name
The eloquent relationship in the shoot is defined like thi
To achieve what you after you will need to do the following:
$shoot = Shoot:where('id','=',1)->with('programme')->first(); $variable = $shoot->programme; // returns 1 $obj = $page->getRelationValue('programme') // returns App\Programme object.