Salty
Salty
Explore posts from servers
FFilament
Created by Salty on 7/21/2023 in #❓┊help
[v2] Using reactive/dependent fields sends all fields to be saved
Having the following configuration
Forms\Components\Section::make('Config')
->schema([
Forms\Components\Fieldset::make('config')
->relationship('config')
->schema([
Forms\Components\Select::make('driver')
->options(DriverOptions::options()->toArray())
->columnSpanFull()
->reactive(),

Forms\Components\Repeater::make('credentials')
->schema([
Forms\Components\TextInput::make('name'),
Forms\Components\TextInput::make('value'),
])
->hidden(function (\Closure $get) {
return $get('driver') !== 'option1';
}),

Forms\Components\Repeater::make('credentials')
->schema([
Forms\Components\TextInput::make('extra_login'),
])
->hidden(function (\Closure $get) {
return $get('driver') !== 'option2';
}),
])
])
Forms\Components\Section::make('Config')
->schema([
Forms\Components\Fieldset::make('config')
->relationship('config')
->schema([
Forms\Components\Select::make('driver')
->options(DriverOptions::options()->toArray())
->columnSpanFull()
->reactive(),

Forms\Components\Repeater::make('credentials')
->schema([
Forms\Components\TextInput::make('name'),
Forms\Components\TextInput::make('value'),
])
->hidden(function (\Closure $get) {
return $get('driver') !== 'option1';
}),

Forms\Components\Repeater::make('credentials')
->schema([
Forms\Components\TextInput::make('extra_login'),
])
->hidden(function (\Closure $get) {
return $get('driver') !== 'option2';
}),
])
])
when I save the model, having selected option1 for instance and filling up the values, I get the extra_login field in my JSON attribute in my model Expected: - name: Name 1 - value: Value 1 Actual - name: Name 1 - value: Value 1 - extra_login: null
3 replies
RRailway
Created by Salty on 6/25/2023 in #✋|help
Unable to verify with Github
10 replies
FFilament
Created by Salty on 6/15/2023 in #❓┊help
Some Tailwindcss classes not being compiled correctly when using a custom theme
15 replies
FFilament
Created by Salty on 6/15/2023 in #❓┊help
Attempting to reuse some of Filament internal views
I'm trying to build a custom View page for a resource, and I'm trying to use the built-in vendor/filament/filament/resources/views/resources/pages/view-record.blade.php something like this
<x-filament::page
:widget-data="['record' => $record]"
:class="\Illuminate\Support\Arr::toCssClasses([
'filament-resources-view-record-page',
'filament-resources-' . str_replace('/', '-', $this->getResource()::getSlug()),
'filament-resources-record-' . $record->getKey(),
])"
>
Hello there
</x-filament::page>
<x-filament::page
:widget-data="['record' => $record]"
:class="\Illuminate\Support\Arr::toCssClasses([
'filament-resources-view-record-page',
'filament-resources-' . str_replace('/', '-', $this->getResource()::getSlug()),
'filament-resources-record-' . $record->getKey(),
])"
>
Hello there
</x-filament::page>
class ViewBatch extends ViewRecord
{
protected static string $view = 'custom-view';
}
class ViewBatch extends ViewRecord
{
protected static string $view = 'custom-view';
}
However I only get the "hello there" text to show, I'm expecting like the widgets to show and the page title as "View <Record>" like it is on a default view page
4 replies