2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Ninja\Presenters;
|
2016-12-14 15:19:16 +01:00
|
|
|
|
|
|
|
class CompanyPresenter extends EntityPresenter
|
|
|
|
{
|
|
|
|
public function promoMessage()
|
|
|
|
{
|
2017-01-30 17:05:31 +01:00
|
|
|
if (! $this->entity->hasActivePromo()) {
|
2016-12-14 15:19:16 +01:00
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
return trans('texts.promo_message', [
|
|
|
|
'expires' => $this->entity->promo_expires->format('M dS, Y'),
|
2017-01-30 20:40:43 +01:00
|
|
|
'amount' => (int) ($this->discount * 100) . '%',
|
2016-12-14 15:19:16 +01:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function discountMessage()
|
|
|
|
{
|
2017-01-30 17:05:31 +01:00
|
|
|
if (! $this->entity->hasActiveDiscount()) {
|
2016-12-14 15:19:16 +01:00
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
return trans('texts.discount_message', [
|
|
|
|
'expires' => $this->entity->discount_expires->format('M dS, Y'),
|
2017-01-30 20:40:43 +01:00
|
|
|
'amount' => (int) ($this->discount * 100) . '%',
|
2016-12-14 15:19:16 +01:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|