BuddhaNature
How can I add a client side error message to FileUpload?
This doesn't address my problem. I can perform all of the server side validations fine and issue custom messages accordingly.
In my code example, if a user adds an image larger that 2MB, the validation kicks in on the client side and the file is not uploaded.
In the article above, which is good, but not applicable, any file above 2MB would be uploaded and then validated on the server side.
What I'm looking to accomplish is to present a message to the user when they attempt to upload a file larger than 2MB on the client side. As is, the validation just causes the "X" button to jiggle which is not obvious.
4 replies
Will mounting an action keep parameters from being seen by the world?
I posed this question to Chat GPT out of curiosity, and it responded as follows:
2. Use Laravel's Encryption for Sensitive Data
If you must send some sensitive data from the client to the server, you can encrypt it using Laravel's encryption facilities (
Crypt
facade). Here's how you can do that:
- Before passing the argument, encrypt it on the server:
- In your action handler, decrypt the data:
14 replies
Will mounting an action keep parameters from being seen by the world?
Thank you so much for this conversation. It's really helpful.
As a follow up, would encrypting data be considered a bad practice? For example, if I want to pass Superman's secret identity as a public variable, but encrypt it when I call the action and then subsequently decrypt it when I need it?
14 replies
I want to set the time zone of the app according to users timezone
All of the output above is the exact same time. If you read By Date, it seems like one time is ahead of another by a day, but that's just a quirk of timezones. If you look at the relative parts, you can see that no matter what the time zone translation is, it's all the exact same moment in time.
9 replies
I want to set the time zone of the app according to users timezone
@GHOST-117 A different way to look at it is that the order is being place at the same time as you, but shifted relative to the time zone. Ideally, you want to show time relative to you, not them. You want to show them time relative to them, not you. You can also use human readable relative formats. Here's an example:
Your output will look like this:
9 replies
I want to set the time zone of the app according to users timezone
The app's timezone can be changed dynamically in a provider or middleware, but it's not a good idea to do that. The app should represent the timezone of the data, not any single user. When presenting data, you can then present the user's relative time zone based on a helper like
->timezone
. Another way to think of this is that the data in the database should be normalized, not relative to any single user.9 replies
How can the resource query be modified on an Infolist page?
Let's assume I have this hypothetical table DB table with these fields:
id
name, string
title, string
data, json
notes, json
details, json
The resource:
The Table on the List Page has the following on the Table component:
This limits the scope and doesn't load any of the json data. This work now.
On the view page, I'd like to modify the resource query to this:
This query includes
data
, but not notes
and details
.
And then on an additional custom page, I'd like to modify the resource query to this:
This query includes notes
and details
, but not data
.
If a DB table with a lot of fields, especially larger fields like TEXT of JSON, I'm trying to limit the scope on a page by page basis.6 replies