Answers for "eloquent select all"

PHP
2

get all data eloquent laravel

Blog::all();

//example usage.
$posts = Blog::all();
Posted by: Guest on October-28-2020
1

update query laravel

$update = \DB::table('student') ->where('id', $data['id']) ->limit(1) ->update( [ 'name' => $data['name'], 'address' => $data['address'], 'email' => $data['email'], 'contactno' => $data['contactno'] ]);
Posted by: Guest on January-09-2021
0

laravel eloquent get all where in

// Get All Where in condition 
$array = [1,2,3,4,5];
ModelClassName::whereIn('columnName',$array)->get();
Posted by: Guest on August-02-2021

Browse Popular Code Answers by Language