atabegruslan
atabegruslan
Explore posts from servers
FFilament
Created by atabegruslan on 8/29/2024 in #❓┊help
1 Select input depends on another Select input's value. Select's options populated by DB table's col
Currently I got this
return $form
->schema([

Forms\Components\Select::make('model')
Forms\Components\Select::make('model_id')
return $form
->schema([

Forms\Components\Select::make('model')
Forms\Components\Select::make('model_id')
Model is a select menu, it can be Aaa or Bbb. Model_id is also a select menu, How can you achieve the below: If Model is selected to have a value of Aaa, then Model_id's options will be:
1: aaa1
2: aaa2
1: aaa1
2: aaa2
1:aaa1 and 2:aaa2 are read from DB table aaas's id and name columns. If Model is selected to have a value of Bbb, then Model_id's options will be:
1: bbb1
2: bbb2
1: bbb1
2: bbb2
1:bbb1 and 2:bbb2 are read from DB table bbbs's id and name columns.
7 replies
FFilament
Created by atabegruslan on 8/29/2024 in #❓┊help
Display a field as formatted json
Is there a way to display Components\TextEntry::make('properties') as a formated json, with indentations, so that it would look like
<pre>
print_r($model->properties);
</pre>
<pre>
print_r($model->properties);
</pre>
8 replies
FFilament
Created by atabegruslan on 8/27/2024 in #❓┊help
Conditionally add and update relations
Currently I got this situation. A user can have only 1 shipping address and only 1 billing address. In Filament's admin panel's user form, admin can change user's info. However I want to set restrictions, so that admin cant give a user >1 address of type shipping, and cant give a user >1 address of type billing. That also implies that when the user already got 1 billing address, the admin can't change that user's shipping address to type=billing. How can something like that be done?
16 replies
FFilament
Created by atabegruslan on 8/26/2024 in #❓┊help
Format currency
How do you format a field, so that it displays in the format of a currency?
5 replies
FFilament
Created by atabegruslan on 8/23/2024 in #❓┊help
TextInput, set default value (from backend)
Currently I have TextInput::make('user.name'). The name field of the user relation already have an value. However it's not showing in the forms. So how can I make it show?
16 replies
FFilament
Created by atabegruslan on 8/23/2024 in #❓┊help
Conditionally display a section, based on another field's value
How can you conditionally display a section based on another field's value?
7 replies
FFilament
Created by atabegruslan on 8/23/2024 in #❓┊help
Infolist builder. How make labels
How can you make hard-coded text labels for Infolist sections?
2 replies
FFilament
Created by atabegruslan on 8/22/2024 in #❓┊help
Select menu. Enum. How set default-selected
I got a field in DB and model, which is an enum type. Something like this: ['xxx', 'yyy', 'zzz'] In filament, I did:
return $form
->schema([
Forms\Components\Select::make('stage')
->options(['xxx', 'yyy', 'zzz'])
->default('stage')
->disablePlaceholderSelection()
return $form
->schema([
Forms\Components\Select::make('stage')
->options(['xxx', 'yyy', 'zzz'])
->default('stage')
->disablePlaceholderSelection()
In the DB, the field stage is already set to yyy. But the menu still displays xxx
9 replies
FFilament
Created by atabegruslan on 8/16/2024 in #❓┊help
Preventing the admin from deleting himself
No description
11 replies
FFilament
Created by atabegruslan on 8/7/2024 in #❓┊help
Delete relations when delete a model
How do you do this? Currently only the immediate model in question gets deleted, all its relations still hangs in the DB like ghosts
14 replies
FFilament
Created by atabegruslan on 8/6/2024 in #❓┊help
Disable some CRUD actions
If I want to disable edit and delete, so that routes like GET /admin/{model}/1/edit and POST /livewire/update cant even be accessed. How do you do that?
6 replies
FFilament
Created by atabegruslan on 8/5/2024 in #❓┊help
Form builder, any loop view?
In Form Builder, is there anything like Infolist's RepeatableEntry?
12 replies
FFilament
Created by atabegruslan on 8/5/2024 in #❓┊help
How to make a URL column?
Is there anything like Forms\Components*Url*::make? where you can provide a display text and url, and it will render a link
6 replies
FFilament
Created by atabegruslan on 8/5/2024 in #❓┊help
`Forms\Components\FileUpload` image preview
In create view, I want a image preview, so user can preview what they are going to upload. In edit view, I want a preview, so that user can see what they'll replace. How do you do that?
9 replies
FFilament
Created by atabegruslan on 8/5/2024 in #❓┊help
Display some fields only on item-edit or item-create pages
Is there a way to let some fields only appear on edit pages, and some other fields to only appear on create pages? Currently whatever displays on create page also displays on the edit page, because they are both based on public static function form(Form $form): Form { ... of the Resource file.
3 replies
FFilament
Created by atabegruslan on 8/1/2024 in #❓┊help
Custom titles or warning banners in admin dashboard
No description
8 replies
FFilament
Created by atabegruslan on 7/25/2024 in #❓┊help
How make a hint for a Forms\Components\Textarea input
How make a hint for a Form input in Filament? eg: a message describing what's expected to be entered into an input
2 replies
FFilament
Created by atabegruslan on 7/25/2024 in #❓┊help
Filament admin panel, redirect if not admin
How do you redirect non-admin users to home page if they try to login to /admin?
3 replies
FFilament
Created by atabegruslan on 7/24/2024 in #❓┊help
How add multiple images for 1 item
In the item edit page, 1 item can have 1 or many images. The number of images can vary. How can I make a type of input, where after user uploads 1 image, a new image-uploading input appears and ready to handle another image upload. Building something like this would be easy in React, but how can you make something like this in Filament?
3 replies
FFilament
Created by atabegruslan on 7/24/2024 in #❓┊help
create records view. How add another custom button
In my create product view, I want to add a custom button "Generate product variants", when my own custom function to handle that button click. How can I do that?
56 replies