You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
935 B
32 lines
935 B
<?php
|
|
|
|
namespace App\Domains\Channel\Models;
|
|
|
|
use App\Domains\Channel\Enums\Client\AuthType;
|
|
use App\Domains\Channel\Policies\ClientPolicy;
|
|
use App\Domains\System\Traits\Model\HasPublicUlid;
|
|
use Database\Factories\Channel\ClientFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Attributes\UsePolicy;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
#[Fillable(['name', 'domain', 'webhook', 'auth_type', 'credentials', 'secret'])]
|
|
#[UsePolicy(ClientPolicy::class)]
|
|
class Client extends Model
|
|
{
|
|
use HasFactory;
|
|
use HasPublicUlid;
|
|
|
|
protected $casts = [
|
|
'secret' => 'encrypted',
|
|
'auth_type' => AuthType::class,
|
|
'credentials' => 'encrypted:array',
|
|
];
|
|
|
|
protected static function newFactory(): Factory
|
|
{
|
|
return ClientFactory::new();
|
|
}
|
|
}
|
|
|