What are the benefits and drawbacks of using Eloquent in Laravel compared to writing custom classes for specific functions?

When deciding between using Eloquent in Laravel or writing custom classes for specific functions, the benefits of using Eloquent include faster development time, built-in query builder methods, and relationships management. However, drawbacks may include performance issues with complex queries or the need for additional customization beyond what Eloquent offers.

// Example of using Eloquent in Laravel
$users = User::where('active', 1)->get();
foreach ($users as $user) {
    echo $user->name;
}