How can I get an empty builder for a model?

Suppose I have a function that returns a builder. If this constructor cannot be returned, I want to return an empty builder - the value is a builder that does not point to any data. One of them, if you do get (), you will get an empty collection. Any idea?

+4
source share
1 answer

Here's how you do it:

$builder = Post::query();
+8
source

All Articles