['searchable' => true], 'email' => ['searchable' => true], 'age', 'comments' => [ 'key' => '/^comments|writtenComments$/', 'relationship' => true, ], 'favouriteComments' => ['relationship' => true], 'favourites' => ['relationship' => true], 'created_at' => 'date', ]; public function comments() { return $this->hasMany(Comment::class); } public function favouriteComments() { return $this->belongsToMany(Comment::class); } public function favourites() { return $this->hasMany(CommentUser::class); } }