1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00
invoiceninja/app/Console/Commands/stubs/datatable.stub
2019-01-30 22:25:37 +11:00

44 lines
952 B
Plaintext

<?php
namespace $NAMESPACE$;
use Utils;
use URL;
use Auth;
use App\Ninja\Datatables\EntityDatatable;
class $CLASS$Datatable extends EntityDatatable
{
public $entityType = '$LOWER_NAME$';
public $sortCol = 1;
public function columns()
{
return [
$DATATABLE_COLUMNS$
[
'created_at',
function ($model) {
return Utils::fromSqlDateTime($model->created_at);
}
],
];
}
public function actions()
{
return [
[
mtrans('$LOWER_NAME$', 'edit_$LOWER_NAME$'),
function ($model) {
return URL::to("$LOWER_NAME$/{$model->public_id}/edit");
},
function ($model) {
return Auth::user()->can('editByOwner', ['$LOWER_NAME$', $model->user_id]);
}
],
];
}
}