msalehi
msalehi
FFilament
Created by msalehi on 10/21/2024 in #❓┊help
Handle uploaded images columns and rows
The image uploader, by default, displays the uploaded images in a single column. Is there a way to display the uploaded images in a row with multiple columns? For example, I have a container with 4 columns that I want to fill with the uploaded images. Currently, only one of the columns gets filled, and I can't display them in a row.
4 replies
FFilament
Created by msalehi on 12/30/2023 in #❓┊help
Defining max items for blocks in Builder form component
Hi there, i want to define max items for a block of builder is there any way ? something like this:
Builder::make('seo_options')
->blocks([
Builder\Block::make('keywords')->schema([
...
])->maxItems(2)
])
Builder::make('seo_options')
->blocks([
Builder\Block::make('keywords')->schema([
...
])->maxItems(2)
])
3 replies
FFilament
Created by msalehi on 12/3/2023 in #❓┊help
MediaLibrary not working with minIO with docker
Hi there, i've installed minIO in a docker container and i'm using Spatie Media Library plugin for uploading my images to minIO when the filesystem disk set to public or local it has not any problem and everything works fine! but when i choose minio for disk, only the temp-livewire files are uploading successfully to minIO but the original files not uploading and does not save any database record for media table. here is my code :
SpatieMediaLibraryFileUpload::make('images')
->label('تصاویر')
->multiple()
->required()
->collection('images')
->visibility('public')
->reorderable()
->imageEditor()
->columnSpan(2),
SpatieMediaLibraryFileUpload::make('images')
->label('تصاویر')
->multiple()
->required()
->collection('images')
->visibility('public')
->reorderable()
->imageEditor()
->columnSpan(2),
and here is my .env settings:
FILESYSTEM_DISK=minio
FILAMENT_FILESYSTEM_DISK=minio
MEDIA_DISK=minio
MINIO_ROOT_USER=admin
MINIO_ROOT_PASSWORD=admin_password
MINIO_ENDPOINT=http://127.0.0.1:9000
MINIO_REGION=us-west-2
MINIO_BUCKET=test
FILESYSTEM_DISK=minio
FILAMENT_FILESYSTEM_DISK=minio
MEDIA_DISK=minio
MINIO_ROOT_USER=admin
MINIO_ROOT_PASSWORD=admin_password
MINIO_ENDPOINT=http://127.0.0.1:9000
MINIO_REGION=us-west-2
MINIO_BUCKET=test
is there any bug or have I made a mistake somewhere?
16 replies
FFilament
Created by msalehi on 11/21/2023 in #❓┊help
mutate relation data before saving
Hey there, How can i mutate relation data before editing or creating parent record? for example i have this code for form:
TextInput::make('first_name')->label('نام')
->required(),
TextInput::make('last_name')->label('نام خانوادگی')
->required(),
TextInput::make('email')->label('ایمیل')
->email()
->unique(ignoreRecord: true)
->required(),
Repeater::make('contactChannels')
->label('اطلاعات تماس')
->relationship()
->cloneable()
->schema([
Select::make('slug')->label('نوع')
->options(ContactChannelTypeEnum::labels())
->native(false)
->selectablePlaceholder(false)
->live()
->afterStateUpdated(function (Set $set, $state) {

}),
TextInput::make('value')
->extraAttributes([
'class' => '',
'dir' => 'ltr'
])
->extraInputAttributes([
'class' => 'text-left'
])
->prefix(function (Get $get) {
$slug = $get('slug') ?? 'mobile';
return ContactChannelTypeEnum::tryFrom($slug)->prefix();
})
->label('مقدار'),
TextInput::make('first_name')->label('نام')
->required(),
TextInput::make('last_name')->label('نام خانوادگی')
->required(),
TextInput::make('email')->label('ایمیل')
->email()
->unique(ignoreRecord: true)
->required(),
Repeater::make('contactChannels')
->label('اطلاعات تماس')
->relationship()
->cloneable()
->schema([
Select::make('slug')->label('نوع')
->options(ContactChannelTypeEnum::labels())
->native(false)
->selectablePlaceholder(false)
->live()
->afterStateUpdated(function (Set $set, $state) {

}),
TextInput::make('value')
->extraAttributes([
'class' => '',
'dir' => 'ltr'
])
->extraInputAttributes([
'class' => 'text-left'
])
->prefix(function (Get $get) {
$slug = $get('slug') ?? 'mobile';
return ContactChannelTypeEnum::tryFrom($slug)->prefix();
})
->label('مقدار'),
i have access to user data using mutateFormDataBeforeSave() in EditUser.php but it does not contain relation data.
1 replies
FFilament
Created by msalehi on 11/19/2023 in #❓┊help
Postfix for TextEntry
Hey there, is there any method for adding postfix for TextEntry component ?
6 replies
FFilament
Created by msalehi on 11/7/2023 in #❓┊help
Form field for leaflet map picker
Hey there, is there any plugin for v3 to use leaflet map picker for form fields ? i searched a lot but found nothing for v3.
3 replies
FFilament
Created by msalehi on 11/4/2023 in #❓┊help
Column with relationship link to related resource
Hey there, i want to have a TextColumn that related to a resource, for example:
TextColumn::make('user.name')
TextColumn::make('user.name')
how do i relate the column to related resource using a link ? (By clicking on the name, the user can be directed to its page.)
3 replies
FFilament
Created by msalehi on 10/20/2023 in #❓┊help
Blocked loading mixed active content
No description
26 replies