Repository URL to install this package:
|
Version:
1.0.0 ▾
|
<?php
/**
* Created by PhpStorm.
* User: danilo
* Date: 18/12/15
* Time: 16:47
*/
namespace Modules\Users\Transformers;
use League\Fractal\TransformerAbstract;
use Modules\Core\Utils\NameFormat;
use Modules\Users\Entities\User;
/**
* Class BalconistaDatatableTransformer
* @package Modules\Balconistas\Transformers
*/
class UserTransformer extends TransformerAbstract
{
/**
* @param User $model
* @return array
*/
public function transform(User $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),
'email' => strtolower($model->email),
'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)*/
];
}
}