Livewire UI installed

This commit is contained in:
Benjamin Takats
2022-11-30 00:04:07 +01:00
parent 073473a9c8
commit ab19835b3d
516 changed files with 3973 additions and 8 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Http\Livewire\Tables;
use App\Models\Lecturer;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
use Rappasoft\LaravelLivewireTables\Views\Columns\BooleanColumn;
use Rappasoft\LaravelLivewireTables\Views\Columns\ImageColumn;
class LecturerTable extends DataTableComponent
{
protected $model = Lecturer::class;
public function configure(): void
{
$this->setPrimaryKey('id');
}
public function columns(): array
{
return [
ImageColumn::make('')
->location(
fn($row) => 'https://avatars.dicebear.com/api/male/'.fake()->name().'.svg?background=%23000'
)
->attributes(fn($row) => [
'class' => 'rounded-full h-16 w-16',
'alt' => $row->name.' Avatar',
]),
Column::make("Name", "name")
->sortable(),
BooleanColumn::make("Aktiv", "active")
->sortable(),
Column::make('Kurse')
->label(
fn($row, Column $column) => random_int(0, 100)
),
Column::make('')
->label(
fn($row, Column $column) => view('columns.lectures.action')->withRow($row)
),
];
}
}