added watermark settings tab on the branding page and added more package details to the billing page, added a new guest notifications page
This commit is contained in:
@@ -5,9 +5,8 @@ namespace App\Filament\SuperAdmin\Pages;
|
||||
use App\Models\WatermarkSetting;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Filament\Pages\Page;
|
||||
|
||||
class WatermarkSettingsPage extends Page
|
||||
{
|
||||
@@ -20,11 +19,19 @@ class WatermarkSettingsPage extends Page
|
||||
protected static ?int $navigationSort = 20;
|
||||
|
||||
public ?string $asset = null;
|
||||
|
||||
public string $position = 'bottom-right';
|
||||
|
||||
public float $opacity = 0.25;
|
||||
|
||||
public float $scale = 0.2;
|
||||
|
||||
public int $padding = 16;
|
||||
|
||||
public int $offset_x = 0;
|
||||
|
||||
public int $offset_y = 0;
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$settings = WatermarkSetting::query()->first();
|
||||
@@ -35,6 +42,8 @@ class WatermarkSettingsPage extends Page
|
||||
$this->opacity = (float) $settings->opacity;
|
||||
$this->scale = (float) $settings->scale;
|
||||
$this->padding = (int) $settings->padding;
|
||||
$this->offset_x = (int) ($settings->offset_x ?? 0);
|
||||
$this->offset_y = (int) ($settings->offset_y ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +89,20 @@ class WatermarkSettingsPage extends Page
|
||||
->minValue(0)
|
||||
->default(16)
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('offset_x')
|
||||
->label('Offset X (px)')
|
||||
->numeric()
|
||||
->minValue(-500)
|
||||
->maxValue(500)
|
||||
->default(0)
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('offset_y')
|
||||
->label('Offset Y (px)')
|
||||
->numeric()
|
||||
->minValue(-500)
|
||||
->maxValue(500)
|
||||
->default(0)
|
||||
->required(),
|
||||
])->columns(2);
|
||||
}
|
||||
|
||||
@@ -93,6 +116,8 @@ class WatermarkSettingsPage extends Page
|
||||
$settings->opacity = $this->opacity;
|
||||
$settings->scale = $this->scale;
|
||||
$settings->padding = $this->padding;
|
||||
$settings->offset_x = $this->offset_x;
|
||||
$settings->offset_y = $this->offset_y;
|
||||
$settings->save();
|
||||
|
||||
Notification::make()
|
||||
|
||||
Reference in New Issue
Block a user