BKF Dev
Hide Input Form inside Repeater based on condition
Hello,
I want to hide a select input if the line record exist, (Order has many items), I'm trying this code :
Repeater::make('lines')
->relationship()
->schema([
...
Forms\Components\Select::make('product_id')
->relationship('product', 'name')
->visible(fn(?Model $record) => !$record)
...
But I get this error :
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
Is there a way to manage this ? thanks5 replies
Custom FileUpload action
Hello everyone,
I have a RelationManager form which has a FileUpload input, I want to get file information same as in liverwire, so how can I do that ?
public function form(Form $form): Form
{
return $form
->schema([
FileUpload::make('file')
->label(__('File'))
->columnSpanFull()
->required(),
TextInput::make('title')
->label(__('Title'))
->columnSpanFull(),
Textarea::make('description')
->label(__('Descritption'))
->columnSpanFull(),
]);
}
.....
Tables\Actions\CreateAction::make()
->slideOver()
->action(function ($data) {
// how to access to file name, ext, ....
dd($data['file']);
}),
4 replies
Table recordClasses dark mode
Hello,
This piece of code works fine in default mode, but in dark no change (text-color, bg) !
->recordClasses(fn (Model $record) => match ($record->status) {
QuotationStatusEnum::DRAFT => '!opacity-30',
QuotationStatusEnum::CONFIRMED => '!border-l-4 !border-l-green-600 bg-green-50 dark:text-gray-900 dark:bg-green-30',
QuotationStatusEnum::CANCELLED => '!border-l-4 !border-orange-600 bg-orange-50 dark:text-gray-900 dark:border-orange-300',
default => null,
})
36 replies
heroicons issue
I got this issue after adding a viewRecord to an existing resource !
Svg by name "s-archive-box-x-mark " from set "heroicons" not found.
https://flareapp.io/share/x7XaNYO5
8 replies
RelationManager translation for BelongsToMany relationship
Let's say I have belongsToMany relationship with pivot fields having translatable option, Is there a way to manage the translation the same as Create / Edit resource ? (I'm using filament spaties translation
Thanks
8 replies