// Sort users by name in ascending order $users = User::orderBy('name', 'asc')->get(); // Sort users by email in descending order $users = User::orderBy('email', 'desc')->get();In these examples, the User model class is used to retrieve records from the database and sort them by a specific column of the table in ascending or descending order. The orderBy method is commonly used in conjunction with other eloquent query methods to further refine the results set. This method is part of the Laravel framework which is a package library for PHP.