You just need to specify the foreign key, by default the foreign key would be location_id but you want to override that default with your own for example
public function origin_location()
{
return $this->belongsTo('Location', 'origin_location_Id');
}
Good luck.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community