This article shows an example of framework decoupling. You'll find a more elaborate discussion in my latest book, https://leanpub.com/recipes-for-decoupling.

However, these frameworks may sometimes require you to expose your internal entities or model objects.

Maybe you don't work with Symfony, so here's the outline of the general solution: Instead of passing your actual User entity or model to the framework, pass an object that matches the API that the framework expects (e.g.

Define your own implementation for the interface of the service that normally returns the security user to the framework (e.g.
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