Laravel Eloquent

Laravel Eloquent ORM is the Active Record implementation

Each database table has a corresponding model and you can use these models to query, insert, update and delete.

You can first create a model with artisian command and then create the corresponding table in database( We call this migrate)

How to create model

How to create table in database

Basic operations

count() to get number of rows returned

In the above example, first you get the collection and then run the count(). This method has the performance issue but you can use the following way to do the same