feat: add Settings models for Location, ProjectSetting, UrgencyLevel

This commit is contained in:
Ghassan Yusuf 2026-05-24 09:48:31 +03:00
parent c70dde9b1b
commit f8dc7f6d1c
3 changed files with 63 additions and 0 deletions

View 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);
}
}

View 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);
}
}

View 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');
}
}