“Laravel di mana di” Kode Jawaban

Laravel bergabung

Inner Join 	: ->join('contacts', 'users.id', '=', 'contacts.user_id')
Left Join 	: ->leftJoin('posts', 'users.id', '=', 'posts.user_id')
Right Join 	: ->rightJoin('posts', 'users.id', '=', 'posts.user_id')
Cross Join 	: ->crossJoin('colors')

Advance Queries : 
----------------- 
 		->join('contacts', function ($join) {
            $join->on('users.id', '=', 'contacts.user_id')
                 ->where('contacts.user_id', '>', 5);
        })
  
Lokesh003Coding

Pembaruan Laravel dari kueri

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

Laravel atau di mana

$camps = $field->camps()->where('status', 0)->where(function ($q) {
    $q->where('sex', Auth::user()->sex)->orWhere('sex', 0);
})->get();
Make Your Own Project

Laravel tidak dalam kueri

DB::table(..)->select(..)->whereNotIn('book_price', [100,200])->get();
Lokesh003

Laravel di mana

use Illuminate\Database\Eloquent\Builder;

// Retrieve posts with at least one comment containing words like foo%...
$posts = App\Post::whereHas('comments', function (Builder $query) {
    $query->where('content', 'like', 'foo%');
})->get();

// Retrieve posts with at least ten comments containing words like foo%...
$posts = App\Post::whereHas('comments', function (Builder $query) {
    $query->where('content', 'like', 'foo%');
}, '>=', 10)->get();
Alberto Peripolli

Laravel di mana di

$users = DB::table('users')->whereIn('id', array(1, 2, 3))->get()
Victorious Vulture

Jawaban yang mirip dengan “Laravel di mana di”

Pertanyaan yang mirip dengan “Laravel di mana di”

Lebih banyak jawaban terkait untuk “Laravel di mana di” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya