Eloquent ORM | Laravel | Basics
Eloquent ORM Eloquent ORM: ORM stands for Ovject Relation Mapping. It converts an object to a database table row. To query the database, Eloquent has a lot of methods For example, we have a school database and inside the school database, we have a table of seventh standard The object contains the following properties. Each of the property is mapped to the column of the database If your model class is User, you should use User::all() to return all the tuples iof the database The where clause: Flight::where('active',1)->orderBy('name')->take(10)->get(); To get the first row of the row result set given by the where clause:- $flight = Flight::where('number','1000')->first(); $flight->number = '1000'; $flight->refresh(); echo $flight->number; foreach($flights as $flight) { echo $flight->name; } Flight::chunk(200, function(Collection $flights) { for...