refactor datatables admin
This commit is contained in:
32
app/Datatables/Admin/Shop/CustomerAddressesDataTable.php
Normal file
32
app/Datatables/Admin/Shop/CustomerAddressesDataTable.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Admin\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\CustomerAddress;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomerAddressesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'customer_addresses';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->url = route('Admin.Shop.CustomerAddresses.index');
|
||||
}
|
||||
|
||||
public function query(CustomerAddress $model)
|
||||
{
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('address')->title('Adresse'),
|
||||
Column::make('zipcode')->title('Code postal'),
|
||||
Column::make('city')->title('Ville'),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user