30 lines
876 B
PHP
30 lines
876 B
PHP
<?php
|
|
|
|
namespace App\Tables;
|
|
|
|
use App\Tables\Traits\WithColumnFormatter;
|
|
use Mmt\GenericTable\Attributes\MappedRoute;
|
|
use Mmt\GenericTable\Components\Column;
|
|
use Mmt\GenericTable\Components\ColumnCollection;
|
|
use Mmt\GenericTable\Interfaces\IDragDropReordering;
|
|
use Mmt\GenericTable\Interfaces\IGenericTable;
|
|
|
|
class TableWithBindedRoutes implements IGenericTable, IDragDropReordering
|
|
{
|
|
use WithColumnFormatter;
|
|
|
|
public string $orderingColumn;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->columns = ColumnCollection::make(
|
|
new Column('Id'),
|
|
new Column('Name'),
|
|
new Column('Description')
|
|
->bindToRoute(MappedRoute::make('with_relationships', ['id' => ':id'])),
|
|
new Column('Price'),
|
|
new Column('Stock'),
|
|
new Column('SubDepartment', 'subDepartment.name'),
|
|
);
|
|
}
|
|
} |