belongsTo(User::class, 'nIDUser'); } // Include additional fields in the model's JSON form protected $appends = [ 'user_first_name', // Include the attribute for user's first name ]; // Define an accessor to get the first name of the related user public function getUserFirstNameAttribute() { return $this->user ? $this->user->sFirstName : null; } }