Uploading content
This commit is contained in:
29
app/Tables/TableWithRelationships.php
Normal file
29
app/Tables/TableWithRelationships.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tables;
|
||||
|
||||
use App\Models\Product;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Mmt\GenericTable\Components\Column;
|
||||
use Mmt\GenericTable\Components\ColumnCollection;
|
||||
use Mmt\GenericTable\Interfaces\IGenericTable;
|
||||
|
||||
class TableWithRelationships implements IGenericTable
|
||||
{
|
||||
public Model|string $model;
|
||||
|
||||
public ColumnCollection $columns;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new Product();
|
||||
|
||||
$this->columns = new ColumnCollection()->add(
|
||||
new Column('Name'),
|
||||
new Column('Department', 'subDepartment.department.name'),
|
||||
new Column('SubDepartment', 'subDepartment.name'),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user