class User extends BaseModel
{
protected $label = 'User'; // or array('User', 'Fan')
protected $fillable = ['name', 'email'];
public function topics() {
return $this->hasMany('App/Topic', 'CREATED');
}
}
Then I create them like this:
$topic = new Topic([
'title' => $payLoad['title']
]);
$user->topics()->save($topic);
Which works as Intended, but when I try to retrieve the Topics for the current user like $topics = user()->topics I get an empty array. Did I do Something wrong?
I have a User class like the following:
Then I create them like this:
Which works as Intended, but when I try to retrieve the Topics for the current user like
$topics = user()->topics
I get an empty array. Did I do Something wrong?