0
This is my route:
Route::get('empresas/deletar/{notice}', 'EmpresaController@deletar');
This is the action of the button:
This is my role in Controller:
What happens if I pass this URL directly in the browser
localhost:8000/empresas/deletar/1
it erases directly has how to send the id of a particular record other than the way I’m using the button and that hides in the user’s view so he doesn’t know which ID is what he’s passing to the back-end because I am working with a system where several clients can register several companies and this way another client can exclude another company understands that it is not related to itself properly.
Never place code images it seems to help but does not (https://pt.meta.stackoverflow.com/questions/5149/devemos-corta-a-mania-das-questions-com-imagem-do-c%C3%B3digo-ao-Inv%C3%A9s-do-c%C3%B3digo/5159#5159). From this, you will always have to send the id (or other unique identifier) in some way. The problem is not in the request itself, nor how it is done (it could be a POST instead of GET, but that would not avoid this scenario). The best thing you can do is check if the company was registered by the user who is trying to delete it, if yes, you can delete, if not, do not delete.
– Miguel
You can do this with ajax via POST so that the link is "hidden" to the user, but to ensure that the user does not delete other companies, you must check if the company belongs to him even before giving the delete...
– Darlei Fernando Zillmer