$user = User::find(1); $userArray = $user->toArray();
$users = User::where('status', 'active')->get(); $usersArray = $users->toArray();In this example, we retrieve all active users from the database using the `where` method. The `get` method returns a collection of `User` model instances. The `toArray` method is then called on the collection to get an array representation of all the user data. The `Illuminate\Database\Eloquent` package is a part of the Laravel framework.