feat: add Settings models for Location, ProjectSetting, UrgencyLevel
This commit is contained in:
parent
c70dde9b1b
commit
f8dc7f6d1c
19
app/Models/Settings/Location.php
Normal file
19
app/Models/Settings/Location.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Settings;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Location extends Model
|
||||
{
|
||||
protected $table = 'settings_locations';
|
||||
|
||||
protected $fillable = ['name', 'is_active'];
|
||||
|
||||
protected $casts = ['is_active' => 'boolean'];
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('is_active', true);
|
||||
}
|
||||
}
|
||||
19
app/Models/Settings/ProjectSetting.php
Normal file
19
app/Models/Settings/ProjectSetting.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Settings;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProjectSetting extends Model
|
||||
{
|
||||
protected $table = 'settings_projects';
|
||||
|
||||
protected $fillable = ['name', 'is_active'];
|
||||
|
||||
protected $casts = ['is_active' => 'boolean'];
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('is_active', true);
|
||||
}
|
||||
}
|
||||
25
app/Models/Settings/UrgencyLevel.php
Normal file
25
app/Models/Settings/UrgencyLevel.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Settings;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UrgencyLevel extends Model
|
||||
{
|
||||
protected $table = 'settings_urgency_levels';
|
||||
|
||||
protected $fillable = [
|
||||
'label', 'emoji', 'color_bg', 'color_text',
|
||||
'subtitle', 'sort_order', 'show_date_picker', 'is_active',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'show_date_picker' => 'boolean',
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('is_active', true)->orderBy('sort_order');
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user