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