How to Check if a Record Exists in Laravel
in this lesson, we will see how to check if a record exists in laravel, sometimes you need to check for a record if it exists before performing some actions.
How to Check if a Record Exists in Laravel
To do that laravel provides a method 'exists()' that you can use to check if a record already exists in the database.
Post::where('title', $request->title)->exists();