/**
* Get Telegram chat ID for User
*/
public function getChatId(): string|null
{
// works
// return $this->chat->chat_id;
// doesn't work
return data_get($this, "chat.chat_id");
}
/**
* Telegram chat for user
*/
public function chat(): HasOne
{
return $this->hasOne(Chat::class, "user_id");
}
Feature Description
It would be convenient to have auto-suggestion in
data_getfor Models.For example (User Model)