Abdur Razzaque
Abdur Razzaque
FFilament
Created by Abdur Razzaque on 5/21/2024 in #❓┊help
Password Hash should be Hidden on form
When I create a password, it's saving with hash. But It's not a good to showing the hash. Please help me to fix this.
TextInput::make('password')
->password()
->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
->dehydrated(fn (?string $state): bool => filled($state))
->revealable()
->required(fn (Page $livewire) => ($livewire instanceof CreateRecord)),
TextInput::make('password')
->password()
->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
->dehydrated(fn (?string $state): bool => filled($state))
->revealable()
->required(fn (Page $livewire) => ($livewire instanceof CreateRecord)),
12 replies
FFilament
Created by Abdur Razzaque on 1/25/2024 in #❓┊help
What is the best way for Single Record View and Edit Page?
I want an option called "Settings". Where admin can View and Update some data like 'logo, 'favicon' footer-text' etc. I'm not sure about filament Page is okay or not for this situation.
2 replies
FFilament
Created by Abdur Razzaque on 11/8/2023 in #❓┊help
Automatically generating forms and tables | doctrine/dbal
Sometimes this command generate the form and table data. But most of the time it's not work. I installed the
docrine/dbal
docrine/dbal
package and give protected_fillable data to model, but it's still not working. What should I do to find the problem? Why this command not generating the data automatically?
php artisan make:filament-resource Customer --generate
php artisan make:filament-resource Customer --generate
22 replies
FFilament
Created by Abdur Razzaque on 10/16/2023 in #❓┊help
Conditional Form Input and Table Column
I want to create two types of data: 'image' or 'text.' That's why I've structured my code this way. Is there a more optimal approach? Additionally, I'd prefer to hide the 'Status' field on the Create form and reveal it in the Edit form. Please provide me with ideas on how to display input values in a table, where the value type can be either text or an image.
Section::make()->schema([
TextInput::make('name'),
Select::make('value_type')
->editOptionAction(null)
->options([
'text' => 'Text',
'image' => 'Image'
])->live(),

TextInput::make('value')
->visible(fn (Get $get): string => $get('value_type') === 'text'),
FileUpload::make('value')
->visible(fn (Get $get): string => $get('value_type') == 'image'),
Select::make('Status')
])
Section::make()->schema([
TextInput::make('name'),
Select::make('value_type')
->editOptionAction(null)
->options([
'text' => 'Text',
'image' => 'Image'
])->live(),

TextInput::make('value')
->visible(fn (Get $get): string => $get('value_type') === 'text'),
FileUpload::make('value')
->visible(fn (Get $get): string => $get('value_type') == 'image'),
Select::make('Status')
])
40 replies
FFilament
Created by Abdur Razzaque on 10/1/2023 in #❓┊help
I need to display input types conditionally in both the form and table columns.
If I select 'TextInput' from the 'value_type' dropdown, it will display the TextInput. However, if I choose 'Image,' the FileUpload will appear. By default, both the TextInput and FileUpload are hidden.
public static function form(Form $form): Form
{
return $form
->schema([
Section::make()->schema([
TextInput::make('name'),
Select::make('value_type')
->options([
'TextInput' => 'Text Input',
'FileUpload' => 'Image'
]),

TextInput::make('value'), // If value_type === input
FileUpload::make('value') // If value_type === image
])
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
Section::make()->schema([
TextInput::make('name'),
Select::make('value_type')
->options([
'TextInput' => 'Text Input',
'FileUpload' => 'Image'
]),

TextInput::make('value'), // If value_type === input
FileUpload::make('value') // If value_type === image
])
]);
}
It might not be more challenging if TextColumn and ImageColumn are conditionally displayed based on the value type.
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('name'),
TextColumn::make('value'), // If value_type === input
ImageColumn::make('value'), // If value_type === image
IconColumn::make('status')
)]
}
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('name'),
TextColumn::make('value'), // If value_type === input
ImageColumn::make('value'), // If value_type === image
IconColumn::make('status')
)]
}
5 replies
FFilament
Created by Abdur Razzaque on 8/14/2023 in #❓┊help
Where am I doing wrong in Relation Manager
I need all Transaction that stored by "customer_id" in CustomerResource.
// Transaction Model:
'customer_id',
'description',
'transaction_type',
'amount',
'balance',

// Customer Model
'name'
'mobile'
// Transaction Model:
'customer_id',
'description',
'transaction_type',
'amount',
'balance',

// Customer Model
'name'
'mobile'
Created a TransactionRelationManager with this command that's not work for me.
php artisan make:filament-relation-manager CustomerResource transactions customer_id
php artisan make:filament-relation-manager CustomerResource transactions customer_id
4 replies
FFilament
Created by Abdur Razzaque on 8/6/2023 in #❓┊help
Need Logical Help to Store the New Balance from Debit or Credit
9 replies