Source: divinglaravel.com

Job Encryption in Laravel

Category: Laravel

Consider this job: When you dispatch this job, Laravel is going to serialize it so that it can be persisted in the queue store. Let's take a look at how the final form will look like in the store: Looking at the payload, you can see that the value of socialSecurityNumber is visible to the human eye.

But if the job stores critical information in the payload, it's better we encrypt it so that only our queue workers can read it while processing the job. To do that, we'll need to implement the ShouldBeEncrypted interface: This interface was introduced in Laravel v8.19.0 (Released on December 15, 2020) Now the payload will look like this: Any person or program with access to the queue store will not be able to decrypt the job payload.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners