feat: new chain
This commit is contained in:
+8
-2
@@ -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 ?? '')) !== '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user