Skip to content
Advertisement

How to know if my variable is empty (or null) after query – laravel

I am trying to do a permanent delete of previously deleted rows with softdeletes, but when there are no rows to delete my function stops working, I need an “if” for so that this does not happen

my function

JavaScript

for example I’m trying to verify that the variable “$mailMessage” is not empty to continue with my function

thanks for read me 🙂

Advertisement

Answer

you can use simple delete:

JavaScript

added by author: replacing delete for forceDelete is working for me

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement