Yiru Huang
0
Q:

laravel where and where

$camps = $field->camps()->where('status', 0)->where(function ($q) {
    $q->where('sex', Auth::user()->sex)->orWhere('sex', 0);
})->get();
2
$users = DB::table('users')
                ->whereMonth('created_at', '12')
                ->get();
1
$projects = Project::whereHas('projectOffers', function ($offer) {
            $offer->where('teacher_id', "Ahmed");
            $offer->where('status_id', "Accepted");
        })->where('status_id', "inprogress")->get();
0
Table::where('Column', Value)->where('NewColumn', Value)->get();
0
$users = DB::table('users')
                ->whereDate('created_at', '2016-12-31')
                ->get();
0

New to Communities?

Join the community