laravel query builder join

35

laravel query builder join -

use Illuminate\Support\Facades\DB;

$users = DB::table('users')
            ->join('contacts', 'users.id', '=', 'contacts.user_id')
            ->join('orders', 'users.id', '=', 'orders.user_id')
            ->select('users.*', 'contacts.phone', 'orders.price')
            ->get();

DB::table('users')->get(); -

DB::select('SELECT * FROM users WHERE name = ?', array(Input::get('name')));

Comments

Submit
0 Comments