Update source into github
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 OsGroup extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'os_group';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'thumbnail',
|
||||
'module_host_id',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function host()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\ModuleHost::class,'module_host_id','id');
|
||||
}
|
||||
public function os()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Os::class);
|
||||
}
|
||||
public function getStatus()
|
||||
{
|
||||
return match ($this->attributes['status']){
|
||||
1 => '<span class="badge bg-success">Active</span>',
|
||||
default => '<span class="badge bg-danger">De-Active</span>'
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user