xxxxxxxxxx
if(!Numbers::where('country',$country)->exists()){
Numbers::Create([
'country' => $country
]);
}
xxxxxxxxxx
$repairJobs = RepairJob::with('repairJobPhoto', 'city', 'vehicle')
->where('active', '=', 'Y')
->whereNotExists(function($query)
{
$query->select(DB::raw(1))
->from('DismissedRequest')
->whereRaw('RepairJob.id = DismissedRequest.id');
})->get();
xxxxxxxxxx
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
class UserController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$isExist = User::select("*")
->where("email", "yemmerich@example.net")
->doesntExist();
if ($isExist) {
dd('Record is not available.');
}else{
dd('Record is available.');
}
}
}