working on omis setup
This commit is contained in:
33
app/Models/Setting.php
Normal file
33
app/Models/Setting.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user