dasK_
Storing and Retrieving Price
I have just changed all of my tables and functions to use cents instead of dollar values, for the most part now it's working as expected, in Filament however,
I'm able to divideBy: 100 in the TextColumn
But I'm not able to do the same in the form when it displays the price? I have a function in my product model that converts the dollar value to cents so I can enter in the $4.50 or whatever in the form and it's handled, I've tried to play around with hydration but couldn't work it out.
3 replies
Replacing Login Route with Jetstream
Has anyone had any luck with overriding the /admin/login route with just the /login route from Jetstream?
There's no class I could find that I could change the ->login() to in adminPanelProvider, I tried setting the login class in config/filament.php to
'auth' => [
'pages' => [
'login' => [\Laravel\Fortify\Http\Controllers\AuthenticatedSessionController::class, 'create'],
],
],
but no luck..5 replies
Filament Page In the Wrong Panel?
I have two panels, Admin and userPanel, all of my pages seem to be working just fine and displaying the panel for the folder/namespace they're in (routes look good too)
I have one page in my userPanel that displays the admin panel? I've checked the folder path of the Component and Blade
Blade:
views/filament/user-panel/pages/top-up.blade.php
Component:
app/filament/UserPanel/Pages/TopUp.php
in my provider files
admin
userPanel
Can't seem to figure out what's happening here especially when all of the other userPanel pages are fine
Generated Route
5 replies
Custom Dashboard Not Working
I followed the documentation https://filamentphp.com/docs/3.x/panels/dashboard#customizing-the-dashboard-page on how to create a new dashboard.php file and remove the dashboard class from my PanelProvider, but when I browse to that panel, all I get are 302 redirects constantly until chrome calls it quits with TOO_MANY_REDIRECTS
Not sure where to start here..
7 replies
3.2 Exporting CSV
Just upgraded to 3.2 so I can use the export action but hitting a wall when trying to add the ExportAction to getHeaderActions, it seems to work just fine in the table, but it just doesn't work in the header?
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
ImportAction::make()
->importer(ProductImporter::class),
ExportAction::make()
->exporter(ProductExporter::class)
];
}
Removing ImportAction and leaving just Export still does the same thing.
Header actions must be an instance of Filament\Actions\Action, or Filament\Actions\ActionGroup.
6 replies
Multiple IF statements in custom page blade
I'm having issues with multiple IF statements in a custom page blade file, the first IF works fine and doesn't display if the variable is null, but the second $details doesn't? not sure why..
Undefined variable $details (from the @if($details)) line
https://gist.github.com/tommmoe/fcaa163097fc32faf9f085087bc58e34
2 replies
Adding an Action to a Form Section?
Have been trying to add an action to form sections but have been unsuccessful, any solutions?
protected function getFormSchema(): array
{
return ([
Section::make('Modify Balance')
->schema([
TextInput::make('bal_subscriberId')->label('Subscriber ID'),
TextInput::make('bal_amount')->label('Amount'),
Checkbox::make('bal_setBalance')->label('Set Balance'),
TextArea::make('bal_description')->label('Description'),
]),
Action::make('updateBalance')
->label('Update Balance')
->action('updateBalance'),
Section::make('Modify Package Limits')
->schema([
TextInput::make('limit_packageId')->label('Package ID'),
TextInput::make('limit_dataBytes')->label('Data Bytes (in bytes)'),
TextInput::make('limit_moCalls')->label('MO Calls (in seconds)'),
TextInput::make('limit_mtCalls')->label('MT Calls (in seconds)'),
TextInput::make('limit_moSms')->label('MO SMS'),
TextInput::make('limit_mtSms')->label('MT SMS'),
TextArea::make('limit_comment')->label('Comment'),
]),
Action::make('modifyPackageLimits')
->label('Modify Package Limits')
->action('modifyPackageLimits')
7 replies
Converting form column to JSON?
Having some issues with filling a column out called productDetails, it's set up to accept json and I've been doing it fine with straight laravel by means of json_encode to write and json_decode to read
but in Filament, the only thing I'm able to do is write a string to the productDetails column when I edit a product, creating a product it gives me an Array to string conversion exception, I've tried to use the save function to do this (chatGPT may have this wrong because I'm not getting any logs)
Hopefully the code will make more sense, I've also provided an example of what it's meant to look like in the DB.
https://gist.github.com/tommmoe/5a33c7057d5081f985cb74fb08934d9d#file-gistfile1-txt
11 replies