1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00
invoiceninja/app/Ninja/Datatables/ProposalCategoryDatatable.php
2018-01-31 16:33:33 +02:00

41 lines
874 B
PHP

<?php
namespace App\Ninja\Datatables;
use Auth;
use URL;
use Utils;
class ProposalCategoryDatatable extends EntityDatatable
{
public $entityType = ENTITY_PROPOSAL_CATEGORY;
public $sortCol = 1;
public function columns()
{
return [
[
'name',
function ($model) {
return $model->name;
},
],
];
}
public function actions()
{
return [
[
trans('texts.edit_category'),
function ($model) {
return URL::to("proposals/categories/{$model->public_id}/edit");
},
function ($model) {
return Auth::user()->can('editByOwner', [ENTITY_PROPOSAL_CATEGORY, $model->user_id]);
},
],
];
}
}