feat: Implement DNS management with dedicated models, repositories, requests, controllers, and services, while refactoring authentication by removing Passport and Sanctum.

This commit is contained in:
pbao9
2026-03-09 16:43:06 +07:00
parent 80a5e0ca3d
commit 4e4807dbea
47 changed files with 1905 additions and 1243 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class DnsServer extends Model
{
use HasFactory;
protected $table = 'dns_manager_servers';
protected $fillable = [
'name',
'ip_address',
'password',
'username',
'api_key',
'status',
];
public function getStatus(): string
{
return match ($this->attributes['status']) {
'activated' => '<span class="badge bg-success text-success-fg">Activated</span>',
'Stopped' => '<span class="badge bg-danger text-danger-fg">Stopped</span>',
default => '<span class="badge bg-secondary">Unknown</span>',
};
}
protected function scopeIsActive($query)
{
return $query->where('status', 'activated');
}
}