StanProg
FileUpload issue with multiple machines
I'm using the FileUpload component, to upload a files in S3.
Sample code:
When I use only one app machine i.e. vm (scaling), the upload works correctly i.e.
1. the file is uploaded correctly "storage\app\livewire-tmp" when I pick it
2. the file is uploaded to "s3" "tmp" folder when I click the Submit button
When I use multiple app machines the file gets uploaded to "storage\app\livewire-tmp", under name like 'JBexfBvW1lJgkJyjxaWYasj09aUWZ3-metaU2FsZXNfUmVwb3J0X0RFQ18yMDIzX0hleUhhcHBpbmVzc19QTC5DU1Y=-.csv' (including the single quotes, which is strange), but when I click the Submit button, it's not uploaded to the S3 folder.
In the multiple app engines case it does not work even if it's executed on the app engine on which it was previously worked perfectly (in single single engine mode)
Do you have any idea, why when adding second app engine for my application, the uploads stops working? Is there something that I have to configure additionally? Any help will be appreciated.
4 replies
Redirect from Livewire component boot()
I have a Livewire component with a form and in the boot() method I conditionally redirect to the dashboard. Unfortunately that redirect() does not work (it's executed, but does not redirect) and the getFormSchema() gets executed, while it shouldn't. Can somebody point what I'm doing wrong?
Here's a sample code:
3 replies
Tagging S3 Uploads
I'm uploading files to S3 via
FileUpload::make()->disk('s3')
, but I can't find a way to tag the uploads. If I manually upload them I use a syntax like that:
Storage::disk('s3')->put($path, $pdf->output(), ['Tagging' => 'type=gdpr']);
Is there a way to use that Tagging
in the context of FileUpload::make()
?3 replies
Wrong money formatting
I'm formatting the money with
->money()
on the TextColumn. EUR (€ 27,90) & PLN (27,90 zł) look OK, while USD ($0.28) & CHF (CHF0.28) are divided by 100. Example call:
The data comes directly from the DB, returned with Eloquent.
Am I missing something?
I noticed that this is only for the currencies that have in config/money.php 'decimal_mark' => '.'
. If I change that separator to ','
at least he amounts are not multiplied by 100, like for CHF it displays CHF27,90
.2 replies
Defining notifications polling interval per component?
I have a Database notification from a Job that appears a minute or more after it's being added.
At the notification icon I see in the soruce code: wire:poll.60s
Is there a way to change that value for specific component?
6 replies
Is there a way to send Database notifications from Job?
I read about Broadcast notifications and that they can be used to send notifications from job, but I was wondering if there is a way to accomplish that without Broadcast notifications? Like with Database notifications that get fetched?
9 replies
Sending Notification from Job requires page reload
I have a Livewire component that has a BulkAction. When it's clicked it dispatches a Job that does some work and then sends a DB Notification to the current user.
All works fine, except that I have to reload the current page to be able to see the notification.
I tried adding
event(new DatabaseNotificationsSent($user));
after notification is ->send();
, but this does not solve the problem. Ex:
Any ideas?2 replies
How to get the error, when FileUpload result is NULL?
I have a custom header action defined in
table()
via Action::make->->form([FileUpload::make()])
. I also have ->action(function (array $data): void {...}
$data
is an array of the custom elements, like $data['priceList']
for the FileUpload. In my case this $data['priceList']
is a string representing the Amazon S3 path to the file, like aaa\myfile.csv
.
The problem is that in some cases this $data['priceList']
is NULL and whenI check the file is not uploaded to S3.
Question: Is there a way to see what error occurred so I can properly notify the user that is trying to upload the file? So far I just get NULL and the file is not uplaoded.2 replies
BulkAction action() is not executing on click
I have defined a BulkAction like that:
The button appears (and it was working before). Now it seems that the action() is not executed.
I ran
artisan optimize:clear
to clear the caches, and npm run build
just in case, but still the action() mehtod is not called - as it does not accept the click on the button. Any ideas how can I debug that?1 replies
BulkAction with polling within action closure
I have a BulkAction that generates a PDF file and force downloads it. The problem is that the generation takes too long (60s+) and the server times out.
My idea is in the BulkAction action() closure to dispatch the job that generates that file and uploads it. It will keep the state of the job in DB so I need to periodically check if it's generated & store and when it is, to force-download it.
I read about polling in Livewire and got that
<div wire:poll="foo">
which I thought to render within this closure, it should call the "foo" action, which action should check the DB if the file is uploaded and will force-download it.
The think in the last paragraph did not worked though as the "foo" action is not being executed. Do you have any ideas why is that, or other ideas of how to solve my problem?4 replies
Downgrading issues from v3 to v2
Since upgrading to v3 turned into 2 weeks nightmare, I decided to downgrade to v2. What I did so far:
Unfortunately this was not enought and I have broken UI of the app:
- logo missing
- main content is over the left menu
- missing user menu items
- edit modals X misplaced and many more UI gliteches
Should I run something else, so this could be cleanly downgraded?
I'm using GIT so this branch is purely v2 - no changes from v3, neither automated, neither custom
P.S. Note that my production app, based on the same branch is OK, so it should be something local.
8 replies
ERR_MODULE_NOT_FOUND on npm run build
I've executed
npm run build
as I have a layout issues (2 weeks can't upgrade our app to v3) and I got the following error
I see that the folder node_modules/vite/dist/node/
does not exist in my system. Is there something that I can do, like to reinstall some module or to do something else to fix that issue?2 replies
Migration of v2 layout options to v3
In v2 we had 'layout' section in config/filament.php, where we could configure some of the layout options. Example: https://gist.github.com/StanProg/1372edb3d4e3ae0f0b8002a7fa5d1d1e
How could we set these options in v3?
So far I found only "max_content_width" as
$panel->maxContentWidth
5 replies
Does php artisan filament:install makes changed to the Database?
I have a production database linked to my v2 app. After calling
php artisan filament:install
as part of the v3 upgrade process will it make changes to the database or just to the file system?5 replies
How to get currently logged user in AppPanelProvider?
In AppPanelProvider::panel() I have
$user = Auth::user();
, but the result is NULL
i.e. it seems that the currently logged user is not available in this method. Is there a way to have access to it in this method?10 replies
Missing resources after upgrade to v3
I've upgraded Filament to v3, including upgrade of Livewire. I've managed to get at least some "view" after a bunch of fixes, but some resources seem to not be present and give 404 like:
css/filament/support/support.css?v=3.0.7.0
css/filament/forms/forms.css?v=3.0.7.0
css/app/custom-stylesheet.css?v=3.0.7.0
js/filament/forms/forms.js?v=3.0.7.0
js/filament/notifications/notifications.js?v=3.0.7.0
js/filament/support/support.js?v=3.0.7.0
js/filament/support/async-alpine.js?v=3.0.7.0
js/filament/tables/tables.js?v=3.0.7.0
js/filament/filament/echo.js?v=3.0.7.0
js/filament/filament/app.js?v=3.0.7.0
Do you have any idea should these be generated by some other "upgrade" script that I have to run?
4 replies