Home > Mobile >  "select * from `users` where `id` = ? and `shopify_namespace` is null and `users`.`deleted_at`
"select * from `users` where `id` = ? and `shopify_namespace` is null and `users`.`deleted_at`

Time:08-25

$result = $this->model::where('id','1');

dd($result->toSql());

i want to get all user where id is equal to 1 but it show empty and when i print query then it show question mark on place of 1. kindly help me to resolve this issue.

CodePudding user response:

If you want to find all users where id = 1, then go for

   $result = User::where('id','1')->get();
   dd($result);

CodePudding user response:

Chane the following line

$result = $this->model::where('id','1');

to this line

$result = $this->model::where('id','1')->get();
  • Related