Nexus-InglineSystems/app/Models/Client.php

54 lines
1.3 KiB
PHP

<?php
namespace App\Models;
// 1. Importe o Trait
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Client extends Model
{
// 2. Use o Trait
use HasFactory, SoftDeletes, HasUuids;
/**
* Os atributos que podem ser preenchidos em massa.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'legal_name',
'cnpj',
'profile_image_path',
'pbx_hosting',
'activation_date',
'carrier',
'access_type',
'server_ip',
'root_password', // Lembre-se de criptografar isso!
'has_call_center',
'has_voice_gateway',
'has_fop2',
'modules',
'whatsapp_number',
'whatsapp_activation_date',
];
/**
* Os atributos que devem ser convertidos para tipos nativos.
*
* @var array<string, string>
*/
protected $casts = [
'modules' => 'array',
'has_call_center' => 'boolean',
'has_voice_gateway' => 'boolean',
'has_fop2' => 'boolean',
'activation_date' => 'date',
'whatsapp_activation_date' => 'date',
];
}