feat(trash): implementasi fitur Tong Sampah (Recycle Bin) soft deletes dan retensi otomatis 30/60/90 hari di Super Admin

This commit is contained in:
Ray1111-aa
2026-10-28 09:47:16 +07:00
parent cb9891b1e3
commit 926683fd34
42 changed files with 1603 additions and 26 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SystemSetting extends Model
{
protected $fillable = [
'key',
'value',
];
/**
* Get a setting value by key with optional default fallback.
*/
public static function get(string $key, $default = null)
{
$setting = static::where('key', $key)->first();
return $setting ? $setting->value : $default;
}
/**
* Set or update a setting by key.
*/
public static function set(string $key, $value): self
{
return static::updateOrCreate(
['key' => $key],
['value' => (string) $value]
);
}
}