Deleting a user from the frontend


So I’m trying to figure out how to let users delete their own profile on the front-end. I’d love to use an anchor link which when it’s clicked, it will delete the user and send you to the homepage. I was thinking about using a route, but not sure if that’s appropriate. Can I somehow detect if the link has been clicked in the controller?


Well, your link could call a new page. This page could have a controller that then executes your script. But the more modern way to do the same is via a route, then you don’t have to create a page.

Awesome, so I’d just fire the user delete function when accessing /delete-user/ or something like that, right?

Right (and some more characters)