return [
TextInput::make('name')
->label('Name')
->required(),
ColorSwatchInput::make('primary_color')
->label('Primary Color')
->required(),
TenantFileUpload::make('logo')
->label('Logo')
->image()
->maxSize(2048) // 2MB
->maxFiles(1)
->live(),
Checkbox::make('logo_same_as_favicon')
->live()
->disabled(fn (Get $get) => empty($get('logo')))
->afterStateUpdated(function (bool $state, Set $set) {
if ($state) {
$set('favicon', []);
}
}),
TenantFileUpload::make('favicon')
->label('Favicon')
->helperText('A small icon that appears in the browser tab')
->image()
->maxSize(2048) // 2MB
->maxFiles(1)
->disabled(fn (Get $get) => $get('logo_same_as_favicon')),
];
}
return [
TextInput::make('name')
->label('Name')
->required(),
ColorSwatchInput::make('primary_color')
->label('Primary Color')
->required(),
TenantFileUpload::make('logo')
->label('Logo')
->image()
->maxSize(2048) // 2MB
->maxFiles(1)
->live(),
Checkbox::make('logo_same_as_favicon')
->live()
->disabled(fn (Get $get) => empty($get('logo')))
->afterStateUpdated(function (bool $state, Set $set) {
if ($state) {
$set('favicon', []);
}
}),
TenantFileUpload::make('favicon')
->label('Favicon')
->helperText('A small icon that appears in the browser tab')
->image()
->maxSize(2048) // 2MB
->maxFiles(1)
->disabled(fn (Get $get) => $get('logo_same_as_favicon')),
];
}