use App\User; $user = User::firstOrCreate( ['email' => 'johndoe@example.com'], ['name' => 'John Doe'] );
use App\User; $user = User::firstOrCreate( ['name' => 'Jane Doe'], ['email' => 'janedoe@example.com'] );This method is part of the Laravel framework's Eloquent ORM package, which provides a simple and elegant way to work with databases.