Skip to content
Advertisement

Does laravel save() method throws exception?

I have a little question here. This is my code:

JavaScript

so do I need this piece of code ? :

JavaScript

or does it throws exception itself if save() function doesn’t succeed?

Advertisement

Answer

save returns a boolean, you need to check if the save was successfull or not, but unless there is a mysql error you won’t get any exceptions.

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