feat: new chain

This commit is contained in:
hashbro
2026-08-11 02:26:43 +08:00
parent ec2d9f2308
commit 9bf769b2bd
56 changed files with 3806 additions and 325 deletions
+8 -2
View File
@@ -8,11 +8,11 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
protected $fillable = [
'username', 'password', 'status', 'comment', 'chat_id', 'bot_id',
'username', 'password', 'status', 'comment', 'chat_id', 'bot_token',
];
protected $hidden = [
'password', 'remember_token',
'password', 'remember_token', 'bot_token',
];
protected function casts(): array
@@ -32,4 +32,10 @@ class User extends Authenticatable
{
return $this->hasMany(Channel::class, 'user_id');
}
public function hasTelegramBot(): bool
{
return trim((string) ($this->bot_token ?? '')) !== ''
&& trim((string) ($this->chat_id ?? '')) !== '';
}
}