Uploading content
This commit is contained in:
27
app/Tables/TableWithBindedRoutes.php
Normal file
27
app/Tables/TableWithBindedRoutes.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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\IGenericTable;
|
||||
|
||||
class TableWithBindedRoutes implements IGenericTable
|
||||
{
|
||||
use WithColumnFormatter;
|
||||
|
||||
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'),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user