2016-12-23 17:52:00 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Presenters;
|
|
|
|
|
|
|
|
use App\Helpers\Helper;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class LocationPresenter
|
|
|
|
* @package App\Presenters
|
|
|
|
*/
|
|
|
|
class LocationPresenter extends Presenter
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Link to this locations name
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function nameUrl()
|
|
|
|
{
|
|
|
|
return (string)link_to_route('locations.show', $this->name, $this->id);
|
|
|
|
}
|
2016-12-26 15:19:04 -08:00
|
|
|
|
2016-12-27 16:24:41 -08:00
|
|
|
/**
|
|
|
|
* Getter for Polymorphism.
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function name()
|
|
|
|
{
|
|
|
|
return $this->model->name;
|
|
|
|
}
|
|
|
|
|
2016-12-26 15:19:04 -08:00
|
|
|
/**
|
|
|
|
* Url to view this item.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function viewUrl()
|
|
|
|
{
|
|
|
|
return route('locations.show', $this->id);
|
|
|
|
}
|
2016-12-29 18:12:27 -08:00
|
|
|
|
|
|
|
public function glyph()
|
|
|
|
{
|
2017-11-30 16:40:58 -08:00
|
|
|
return '<i class="fa fa-map-marker"></i>';
|
2016-12-29 18:12:27 -08:00
|
|
|
}
|
2017-08-25 03:26:10 -07:00
|
|
|
|
|
|
|
public function fullName() {
|
|
|
|
return $this->name;
|
|
|
|
}
|
2016-12-23 17:52:00 -08:00
|
|
|
}
|