I always want to play safe when there is a delete or update query in the database through web application.
how do i ensure if there is no where clause in query it should not fire in laravel. is there any configuration in laravel to handle such scenarios.
If I want to update entire table without where clause.. i will prefer to use mysql directly.
This prevent accidental updates and delete on table.
Have you tried DB::raw() ? For example: DB::select(DB::raw("SELECT * FROM table WHERE something = 'Something'"));
I'm sure it works for deletion too.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community