I m having Division by Zero in home.blade.php. Is this due to PHP version or something wrong here as error showing
<div id="student-view-slider" class="student-view-slider-main-block owl-carousel">
<?php $__currentLoopData = $cors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($c->status == 1 && $c->featured == 1): ?>
<div class="item student-view-block student-view-block-1">
<div class="genre-slide-image <?php if($gsetting['course_hover'] == 1): ?> protip <?php endif; ?>"
data-pt-placement="outside" data-pt-interactive="false"
data-pt-title="#prime-next-item-description-block<?php echo e($c->id); ?>">
<div class="view-block">
<div class="view-img">
<?php if($c['preview_image'] !== NULL && $c['preview_image'] !== ''): ?>
<a href="<?php echo e(route('user.course.show',['id' => $c->id, 'slug' => $c->slug ])); ?>"><img
data-src="<?php echo e(asset('images/course/'.$c['preview_image'])); ?>" alt="course"
class="img-fluid owl-lazy"></a>
<?php else: ?>
<a href="<?php echo e(route('user.course.show',['id' => $c->id, 'slug' => $c->slug ])); ?>"><img
data-src="<?php echo e(Avatar::create($c->title)->toBase64()); ?>" alt="course"
class="img-fluid owl-lazy"></a>
<?php endif; ?>
</div>
<div class="badges bg-priamry offer-badge"><span>OFF<span><?php echo round((($c->price - $c->discount_price) * 100)
>Solution :
You will need to make sure that $c->price is not equal to zero before trying to perform the division.
<?php
if ($c->price != 0) {
echo round((($c->price - $c->discount_price) * 100));
}
?>
