xxxxxxxxxx
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();
xxxxxxxxxx
$items = DB::table('item')->select('item_name')->distinct()->get();
xxxxxxxxxx
$uniqueValues = DB::table('your_table_name')
->select('laravel')
->distinct()
->get();
foreach($uniqueValues as $value) {
echo $value->laravel . "\n";
}
xxxxxxxxxx
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();