XF 2.2 Declaring relationships and how to use them

RisteDimitrievski

Active member
The laravel has magic methods inside models you can declare the relationship in this way:
public function user(){ return $this->belongsTo('\App\User\,'user_id,'id'); } When u have to access the relation ship: $this->model = \App\Model::find(1); dd($this->model->user);
But i'm not sure about XenForo too..
 
Back
Top Bottom