prnl.
prnl.
FFilament
Created by angelo on 7/18/2024 in #❓┊help
login error
True, your method is for all scenarios, nice work 👍 😀
15 replies
FFilament
Created by angelo on 7/18/2024 in #❓┊help
login error
Looking at the Filament\Pages\Auth\EditProfile there are some examples of setting the password, check the dehydrateStateUsing option. protected function getPasswordFormComponent(): Component { return TextInput::make('password') ->label(('filament-panels::pages/auth/edit-profile.form.password.label')) ->password() ->revealable(filament()->arePasswordsRevealable()) ->rule(Password::default()) ->autocomplete('new-password') ->dehydrated(fn ($state): bool => filled($state)) ->dehydrateStateUsing(fn ($state): string => Hash::make($state)) ->live(debounce: 500) ->same('passwordConfirmation'); } protected function getPasswordConfirmationFormComponent(): Component { return TextInput::make('passwordConfirmation') ->label(('filament-panels::pages/auth/edit-profile.form.password_confirmation.label')) ->password() ->revealable(filament()->arePasswordsRevealable()) ->required() ->visible(fn (Get $get): bool => filled($get('password'))) ->dehydrated(false); }
15 replies
FFilament
Created by angelo on 7/18/2024 in #❓┊help
login error
Small, but important change 🙂 if (!Hash::needsRehash($value)) { Needs to be if (Hash::needsRehash($value)) {
15 replies
FFilament
Created by angelo on 7/18/2024 in #❓┊help
login error
I have the same issue both on my development environment and my production environment. Thanks for this solution.
15 replies
FFilament
Created by angelo on 7/18/2024 in #❓┊help
login error
15 replies
FFilament
Created by angelo on 7/18/2024 in #❓┊help
login error
APP_KEY is set in my .env
15 replies
FFilament
Created by angelo on 7/18/2024 in #❓┊help
login error
I got the same error, when I look into my database the password is stored as plaintext instead of encrypted. I also have Nova running on the same project (transitioning to Filament), creating users from Nova work fine. My Filament User resource is a "simple" resource.
15 replies
FFilament
Created by kool on 3/4/2024 in #❓┊help
Export a resource model with a HasMany relation
Additionally you'll also have to overwrite/extend the PrepareCsvExport class and change the following code
$baseQuery
->select([$qualifiedKeyName])
->orderedChunkById(
$chunkKeySize,
fn (Collection $records) => $dispatchRecords(
Arr::pluck($records->all(), $keyName),
),
column: $keyName,
descending: ($baseQueryOrders[0]['direction'] ?? 'asc') === 'desc',
);
$baseQuery
->select([$qualifiedKeyName])
->orderedChunkById(
$chunkKeySize,
fn (Collection $records) => $dispatchRecords(
Arr::pluck($records->all(), $keyName),
),
column: $keyName,
descending: ($baseQueryOrders[0]['direction'] ?? 'asc') === 'desc',
);
into
$baseQuery
->select([$qualifiedKeyName])
->orderedChunkById(
$chunkKeySize,
fn (Collection $records) => $dispatchRecords(
Arr::pluck($records->all(), $keyName),
),
column: $qualifiedKeyName,
alias: $keyName,
descending: ($baseQueryOrders[0]['direction'] ?? 'asc') === 'desc',
);
$baseQuery
->select([$qualifiedKeyName])
->orderedChunkById(
$chunkKeySize,
fn (Collection $records) => $dispatchRecords(
Arr::pluck($records->all(), $keyName),
),
column: $qualifiedKeyName,
alias: $keyName,
descending: ($baseQueryOrders[0]['direction'] ?? 'asc') === 'desc',
);
Than add the ->job() to your export, see https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export#customizing-the-export-job
7 replies
FFilament
Created by kool on 3/4/2024 in #❓┊help
Export a resource model with a HasMany relation
Found the solution, for anyone else looking to export a HasMany, below you'll find an example of the modifyQuery method. 1) Changed the $model to the LineItem model. 2) Write your query in the modifyQuery method.
public static function modifyQuery(Builder $query): Builder
{
return \App\Models\LineItem::query()
->join('orders', 'line_items.order_id', '=', 'orders.id')
->select([
'line_items.id as id',
'orders.reference as order_reference',
'orders.status as order_status',
'line_items.sku as line_item_sku',
'line_items.quantity as line_item_quantity',
'line_items.unit_price_incl_tax as line_item_unit_price_incl_tax',
'line_items.unit_price_excl_tax as line_item_unit_price_excl_tax',
])
->mergeWheres($query->getQuery()->wheres, $query->getQuery()->bindings['where']);
}
public static function modifyQuery(Builder $query): Builder
{
return \App\Models\LineItem::query()
->join('orders', 'line_items.order_id', '=', 'orders.id')
->select([
'line_items.id as id',
'orders.reference as order_reference',
'orders.status as order_status',
'line_items.sku as line_item_sku',
'line_items.quantity as line_item_quantity',
'line_items.unit_price_incl_tax as line_item_unit_price_incl_tax',
'line_items.unit_price_excl_tax as line_item_unit_price_excl_tax',
])
->mergeWheres($query->getQuery()->wheres, $query->getQuery()->bindings['where']);
}
7 replies
FFilament
Created by kool on 3/4/2024 in #❓┊help
Export a resource model with a HasMany relation
Would you be able to share your "Filament Way"? I changed the model to OrderItem but unfortunately without a good result.
7 replies
FFilament
Created by kool on 3/4/2024 in #❓┊help
Export a resource model with a HasMany relation
I'm looking for the same export functionality, would be nice to be able to export the OrderItems along with the Orders. Either in one sheet or in one CSV or 1 xlsx with 2 sheets, one sheet for the Orders and one sheet for the OrderItems. I've tried various possible solutions with "modifyQuery", the best result I got is one record for an Order and the OrderLine.columns were comma separated into a single column. @kool maybe change the word HadsMany to HasMany in the subject, so people can better find this question.
7 replies
FFilament
Created by Vp on 4/8/2024 in #❓┊help
select 'default' not working in filter action/forms
I just ran into the same problem, Filament keeps track of the latest selected value inside a session/cookie called Dashboard_filters, after a refresh it will use that value to set the default. Try removing your cookies and see what default value is used, most likely it will use April 🤞
13 replies