belongsTo('App\Section'); } public function region_1() { return $this->belongsTo('App\Section'); } public function region_2() { return $this->belongsTo('App\Section'); } public function event() { return $this->belongsTo('App\Event'); } public function page() { return $this->belongsTo('App\Page'); } public function user() { return $this->belongsTo('App\User'); } public function getCurrentTitle($section_id) { $title = ''; if ($this->section_id == $section_id) $title = $this->title; if ($this->region_1_id == $section_id) $title = $this->title_region_1; if ($this->region_2_id == $section_id) $title = $this->title_region_2; if ($title == '') $title = $this->title; return $title; } }