MedicOneSystems/livewire-datatables

Class "Mediconesystems\LivewireDatatables\NumberColumn" not found

marcellopato opened this issue · 1 comments

AWESOME JOB!
But need some help. Livewire 3 now have changed somethings and the structure of directories is some of them.
I have created a component using:

sail artisan make:livewire-datatable super.user

which wroks fine as you can see:
CLASS: app/Livewire/Datatables/Super/User.php

Nice. Now I have this route:

Route::get('/', function () {
    return view('layouts.super.index');
});

And this view:

<x-app-layout>
    <livewire:datatables.super.user />
</x-app-layout>

The datatable component:

<?php

namespace App\Livewire\Datatables\Super;

use Arm092\LivewireDatatables\Livewire\LivewireDatatable;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
use Mediconesystems\LivewireDatatables\Column;
use Mediconesystems\LivewireDatatables\DateColumn;
use Mediconesystems\LivewireDatatables\TimeColumn;
use Mediconesystems\LivewireDatatables\NumberColumn;
use Mediconesystems\LivewireDatatables\BooleanColumn;

class User extends LivewireDatatable
{
    public function builder(): Builder
    {
        return \App\Models\User::query();
    }

    public function getColumns(): Model|array
    {
        return [
            NumberColumn::name('id')
                ->label('ID')
                ->linkTo('job', 6),

            BooleanColumn::name('email_verified_at')
                ->label('Email Verified')
                ->format()
                ->filterable(),

            Column::name('name')
                ->defaultSort('asc')
                ->group('group1')
                ->searchable()
                ->hideable()
                ->filterable(),

            Column::name('email')
                ->label('E-mail')
                ->group('group1')
                ->searchable()
                ->hideable(),
//                ->filterable($this->email),
        ];
    }
}

But in the browser, got this error:

Error
PHP 8.3.2-1+ubuntu22.04.1+deb.sury.org+1
10.43.0
Class "Mediconesystems\LivewireDatatables\NumberColumn" not found

Could you help me, please?

Originally posted by @marcellopato in #567 (comment)

hey bro, if you have problems with my fork, then open issues on my repo
https://github.com/arm092/livewire-datatables/issues

For your case I can say that you need to change namespaces of column classes, if you use my forked version.

 Mediconesystems\LivewireDatatables\Column; ->  Arm092\LivewireDatatables\Column;
... other column classes to

and etc..