It shoul be a property.
$post->exists;
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi guys I have the code below
$post = Post::make();
dd($post->exists()); // true
Is this the correct behaviour for exists method?
I thought exists is to check whether the record exists in database?
Thanks in advance.
You can use exists() on queries, $post = Post::make(); is not a query, with this code you are only creating and returning an un-saved model instance.
Please or to participate in this conversation.