33 lines
718 B
PHP
33 lines
718 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class vCenter extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'module_vcenter';
|
|
|
|
protected $fillable = [
|
|
'host',
|
|
'user',
|
|
'password',
|
|
'token',
|
|
'status'
|
|
];
|
|
public function datacenters()
|
|
{
|
|
return $this->hasMany(\App\Models\ModuleDatacenter::class, 'vcenter_id');
|
|
}
|
|
public function getStatus()
|
|
{
|
|
return match ($this->attributes['status']) {
|
|
1 => '<span class="badge bg-success">Active</span>',
|
|
default => '<span class="badge bg-secondary">No Active</span>'
|
|
};
|
|
}
|
|
}
|