“Laravel onde” Respostas de código

Atualização do Laravel da consulta

$affected = DB::table('users')
              ->where('id', 1)
              ->update(['votes' => 1]);
Alberto Peripolli

Laravel onde in

$users = DB::table('users')
                    ->whereIn('id', [1, 2, 3])
                    ->get();
Xanthous Xenomorph

ou onde Laravel

MyMode::where(['user_id' => 1])
            ->orWhere(['assigned_to' => 1])
            ->get();
Learn it with muhindo

Laravel se junta

$latestPosts = DB::table('posts')
                   ->select('user_id', DB::raw('MAX(created_at) as last_post_created_at'))
                   ->where('is_published', true)
                   ->groupBy('user_id');

$users = DB::table('users')
        ->joinSub($latestPosts, 'latest_posts', function ($join) {
            $join->on('users.id', '=', 'latest_posts.user_id');
        })->get();
Lokesh003Coding

Laravel com e onde

$projects = Project::whereHas('projectOffers', function ($offer) {
            $offer->where('teacher_id', "Ahmed");
            $offer->where('status_id', "Accepted");
        })->where('status_id', "inprogress")->get();
Make Your Own Project

Laravel onde

$users = DB::table('users')
                ->whereMonth('created_at', '12')
                ->get();
Wandering Wryneck

Respostas semelhantes a “Laravel onde”

Perguntas semelhantes a “Laravel onde”

Mais respostas relacionadas para “Laravel onde” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código