use Illuminate\Database\Eloquent\Model; class User extends Model { // Retrieving all records from users table $users = User::all(); }
use Illuminate\Database\Eloquent\Model; class User extends Model { // Retrieving all records from users table with pagination $users = User::paginate(10); }In these examples, we are using the Model all method to retrieve all records from a database table named users. In the second example, we are also adding pagination functionality to the query to limit the number of records displayed on each page. The package library for this method and Laravel Eloquent ORM is Illuminate\Database\Eloquent.