Home > OS >  How to get all columns from table by name
How to get all columns from table by name

Time:08-04

I am new to laraveI have problem, please help. I have database with id, name, model, price and description how can I get in laravel all the others from the same row if I know only one of them, for example name. Thank you

CodePudding user response:

Eloquent method:

Table::where('name', $name)->get();

Query builder method:

DB::table('table')->where('name', $name)->get();
  • Related