2015-11-06 11:59:53 +01:00
|
|
|
<?php namespace App\Ninja\Presenters;
|
|
|
|
|
2015-12-14 22:05:17 +01:00
|
|
|
use Utils;
|
2015-11-06 11:59:53 +01:00
|
|
|
use Laracasts\Presenter\Presenter;
|
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* Class AccountPresenter
|
|
|
|
*/
|
|
|
|
class AccountPresenter extends Presenter
|
|
|
|
{
|
2015-11-06 11:59:53 +01:00
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2015-11-06 11:59:53 +01:00
|
|
|
public function name()
|
|
|
|
{
|
|
|
|
return $this->entity->name ?: trans('texts.untitled_account');
|
|
|
|
}
|
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2015-12-14 22:05:17 +01:00
|
|
|
public function website()
|
|
|
|
{
|
|
|
|
return Utils::addHttp($this->entity->website);
|
|
|
|
}
|
2016-01-21 20:15:30 +01:00
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2016-01-21 20:15:30 +01:00
|
|
|
public function currencyCode()
|
|
|
|
{
|
|
|
|
$currencyId = $this->entity->getCurrencyId();
|
|
|
|
$currency = Utils::getFromCache($currencyId, 'currencies');
|
|
|
|
return $currency->code;
|
|
|
|
}
|
2015-11-06 11:59:53 +01:00
|
|
|
}
|