moving to provider stored in database

This commit is contained in:
2025-04-07 14:38:28 +01:00
parent 6bd12bd6ca
commit b800a9d83a
11 changed files with 100 additions and 14 deletions

30
app/Models/Provider.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use App\Enums\ProviderType;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Provider extends Model
{
protected $guarded = [];
protected function casts(): array
{
return [
'token' => 'encrypted',
'type' => ProviderType::class,
];
}
public function networks(): HasMany
{
return $this->hasMany(Network::class);
}
public function servers(): HasMany
{
return $this->hasMany(Server::class);
}
}