rappasoft / laravel-livewire-tables

A dynamic table component for Laravel Livewire
https://rappasoft.com/docs/laravel-livewire-tables/v2/introduction
MIT License
1.79k stars 339 forks source link

[Bug]: [2024-10-24 12:55:53] local.ERROR: Class "App\Livewire\LinkColumn" not found {"view":{"view":"/var/www/prakalpmitram.eproplus.in/resources/views/dashboard.blade.php","data":[]},"userId":3,"exception":"[object] (Spatie\\LaravelIgnition\\Exceptions\\ViewException(code: 0): Class \"App\\Livewire\\LinkColumn\" not found at /var/www/prakalpmitram.eproplus.in/app/Livewire/TestTable.php:26) #2008

Closed abhideshpande closed 3 weeks ago

abhideshpande commented 3 weeks ago

What happened?

<?php

namespace App\Livewire;

use Rappasoft\LaravelLivewireTables\DataTableComponent; use Rappasoft\LaravelLivewireTables\Views\Column;

use App\Models\Role;

class TestTable extends DataTableComponent { protected $model = Role::class;

public function configure(): void
{
    $this->setPrimaryKey('id');
}

public function columns(): array
{
    return [
        Column::make("Id", "id")
            ->sortable(),
        Column::make("Name", "name")
            ->sortable(),
        LinkColumn::make('Action')
             ->title(fn($row) => 'Edit')
            ->location(fn($row) => route('dashboard', $row)),
    ];

}

}

How to reproduce the bug

create component

Getting error for LinkColumn using above code

Package Version

No response

PHP Version

8.3.x

Laravel Version

No response

Alpine Version

No response

Theme

Tailwind 3.x

Notes

No response

Error Message

[2024-10-24 12:55:53] local.ERROR: Class "App\Livewire\LinkColumn" not found {"view":{"view":"/var/www/prakalpmitram.eproplus.in/resources/views/dashboard.blade.php","data":[]},"userId":3,"exception":"[object] (Spatie\LaravelIgnition\Exceptions\ViewException(code: 0): Class \"App\Livewire\LinkColumn\" not found at /var/www/prakalpmitram.eproplus.in/app/Livewire/TestTable.php:26)

abhideshpande commented 3 weeks ago

Import was missing