Answers for "laravel select()"

PHP
7

laravel not in query

DB::table(..)->select(..)->whereNotIn('book_price', [100,200])->get();
Posted by: Guest on September-26-2020
2

eloquent with select

Post::query()
    ->with(array('user' => function($query) {
        $query->select('id','username');
    }))
    ->get();
Posted by: Guest on August-07-2021
2

laravel query builder select

use Illuminate\Support\Facades\DB;

$users = DB::table('users')
            ->select('name', 'email as user_email')
            ->get();
Posted by: Guest on August-14-2021
1

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

DB::select('SELECT * FROM users WHERE name = "'.Input::get('name').'"');
Posted by: Guest on October-22-2020
-1

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

DB::select('select * from users ');
Posted by: Guest on October-22-2020

Browse Popular Code Answers by Language