Files
nomina_ventas/app/Models/TelegramAccount.php

48 lines
1002 B
PHP
Executable File

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
#[Fillable(['user_id', 'chat_id', 'verification_code', 'is_verified'])]
class TelegramAccount extends Model
{
use HasFactory;
protected $table = 'telegram_accounts';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'user_id',
'chat_id',
'verification_code',
'is_verified',
];
/**
* The attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'is_verified' => 'boolean',
];
}
/**
* Relación con usuario
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}