Repository URL to install this package:
|
Version:
0.2.1 ▾
|
<?php
/**
* Created by PhpStorm.
* User: danilo
* Date: 18/12/15
* Time: 16:47
*/
namespace Modules\Courses\Transformers;
use League\Fractal\TransformerAbstract;
use Modules\Courses\Entities\Course;
use \Html;
class CoursesDatatableTransformer extends TransformerAbstract {
public function transform(Course $model)
{
$showBtn = [
'href' => route('slides.index', [$model->id]),
'class' => 'btn btn-primary btn-xs'
];
$editBtn = [
'href' => route('courses.edit', [$model->id]),
'class' => 'btn btn-primary btn-xs'
];
$deletBtn = [
'href' => route('courses.destroy', [$model->id]),
'class' => 'btn btn-danger btn-xs confirm-delete'
];
return [
'id' => (int) $model->id,
'title' => $model->title,
'order' => $model->order,
'is_active' => (boolean) $model->is_active ? Html::icon('check') : Html::icon('remove'),
'action' => Html::linkWithIcon('Ver', 'eye', $showBtn).' '.
Html::linkWithIcon('Editar', 'pencil', $editBtn).' '.
Html::linkWithIcon('Excluir', 'trash', $deletBtn)
];
}
}