You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
524 B
24 lines
524 B
<?php
|
|
|
|
namespace App\Entities\Projects;
|
|
|
|
use ProjectStatus;
|
|
use Laracasts\Presenter\Presenter;
|
|
|
|
class ProjectPresenter extends Presenter
|
|
{
|
|
public function customerNameAndEmail()
|
|
{
|
|
return $this->customer_id ? $this->customer->name.' ('.$this->customer->email.')' : '-';
|
|
}
|
|
|
|
public function projectLink()
|
|
{
|
|
return link_to_route('projects.show', $this->name, [$this->id]);
|
|
}
|
|
|
|
public function status()
|
|
{
|
|
return ProjectStatus::getNameById($this->entity->status_id);
|
|
}
|
|
}
|