Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
webbingbrasil/clients-module / Transformers / ClientTransformer.php
Size: Mime:
<?php
/**
 * Created by PhpStorm.
 * User: danilo
 * Date: 18/12/15
 * Time: 16:47
 */

namespace Modules\Clients\Transformers;

use League\Fractal\TransformerAbstract;
use Modules\Core\Utils\NameFormat;
use Modules\Clients\Entities\Client;

/**
 * Class ClientTransformer
 * @package Modules\Clients\Transformers
 */
class ClientTransformer extends TransformerAbstract
{

    /**
     * @param Client $model
     * @return array
     */
    public function transform(Client $model)
    {
        /*$showBtn = [
            'href' => route('slides.index', [$model->id]),
            'class' => 'btn btn-primary btn-xs'
        ];*/


        /** @noinspection PhpUndefinedMethodInspection */
        return [
            'id' => (int)$model->id,
            'name' => NameFormat::formatFullName($model->name),
            'url' => strtolower($model->url),
            'created_at' => $model->created_at->timestamp <= 0 ? '--' : $model->created_at->format('d/m/Y')
            /*'action' => Html::linkWithIcon('Ver', 'eye', $showBtn).' '.
                        Html::linkWithIcon('Editar', 'pencil', $editBtn).' '.
                        Html::linkWithIcon('Excluir', 'trash', $deletBtn)*/
        ];
    }
}