12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
41
app/Models/AdminPreset.php
Normal file
41
app/Models/AdminPreset.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\AdminPresetFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AdminPreset extends Model
|
||||
{
|
||||
/** @use HasFactory<AdminPresetFactory> */
|
||||
use HasFactory;
|
||||
|
||||
public const PRESS_RELEASE_DELETED_PUBLISHED_TEXT = 'press_releases.deleted_published_text';
|
||||
|
||||
protected $fillable = [
|
||||
'key',
|
||||
'area',
|
||||
'type',
|
||||
'label',
|
||||
'value',
|
||||
'payload',
|
||||
'is_active',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'payload' => 'array',
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public static function activeValue(string $key, ?string $fallback = null): ?string
|
||||
{
|
||||
return static::query()
|
||||
->where('key', $key)
|
||||
->where('is_active', true)
|
||||
->value('value') ?? $fallback;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue