use InteractsWithForms;
use WithFileUploads;
protected static ?string $navigationIcon = 'heroicon-o-paint-brush';
protected static ?string $navigationGroup = 'Settings';
protected static string $view = 'filament.tenant.pages.branding';
public ?array $data = [];
public function mount(): void
{
$this->form->fill([
'name' => tenant('name'),
'primary_color' => tenant('primary_color'),
'logo' => tenant('logo'),
'favicon' => tenant('favicon'),
]);
}
public function form(Form $form): Form
{
return $form->schema(BrandingForm::schema())->statePath('data');
}
public function submit()
{
$this->validate();
dd($this->data);
$logoUrl = $this->processImage($this->data['logo'], 'logos');
$faviconUrl = $this->processImage($this->data['favicon'], 'favicons');
tenant()->update([
'name' => $this->data['name'],
'primary_color' => $this->data['primary_color'],
'logo' => $logoUrl,
'favicon' => $faviconUrl,
]);
Notification::make()
->title('Branding updated')
->success()
->send();
$this->dispatch('reload');
}