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:
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user