Add new version in repository
This commit is contained in:
29
app/Datatables/Shop/TariffsDataTable.php
Normal file
29
app/Datatables/Shop/TariffsDataTable.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Tariff;
|
||||
|
||||
class TariffsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tariffs';
|
||||
|
||||
public function query(Tariff $model)
|
||||
{
|
||||
$model = $model->with(['sale_channel'])->select(['shop_tariffs.*']);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('sale_channel.name')->title('Canal de vente'),
|
||||
Column::make('code')->title('Code'),
|
||||
Column::make('ref')->title('Référence'),
|
||||
Column::make('name')->title('Nom'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user