There is firstOrNew()
what works just the same and in case of not finding anything will return new instance. I don't think there is anything else that you could want instead of a newly instantiated model in this situation, correct?
Cool, that is true. I didn't know about firstOrNew but found it now. Thank you so much.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community