New-OMIS/app/Models/Setting.php

34 lines
579 B
PHP
Raw Permalink Normal View History

2024-04-05 05:22:15 +00:00
<?php
2024-04-07 12:14:05 +00:00
namespace App\Models;
2024-04-05 05:22:15 +00:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Setting extends Model
{
use HasFactory;
protected $table = 'tbl_settings';
protected $fillable = [
'slug','title', 'value', 'is_active'
];
protected $casts = [
'is_active' => 'boolean'
];
public function scopeFetch($query, $slug)
{
return $query->whereSlug($slug);
}
public function scopeActive($query, $type = true)
{
return $query->whereIsActive($type);
}
}