Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot declare class Sebastienheyd\Boilerplate\Datatables\Admin\UsersDatatable #63

Closed
cod3rshotout opened this issue Mar 31, 2022 · 1 comment

Comments

@cod3rshotout
Copy link

This issue happen when we use the scaffhold command, so we have a copy of UsersDatatable and RolesDatatable within our Datatables directory.

The BoilerplateServiceProvider actually register these two Datatables using this line:

app('boilerplate.datatables')->registerDatatable(UsersDatatable::class, RolesDatatable::class);

So if I call the datatable component I get the error above. I think is not necessary instantiate the UsersDatatable and RolesDatatable by default, or maybe I'm missing something in this logic.

Again, this happen only for the scaffhold.

@sebastienheyd
Copy link
Owner

When you scaffold, the classes in app/Datatables will overload default classes.

This happens in the DatatableComposer.php file

Have you check if the namespaces are good in the files in app/Datatables ? Can you send the stacktrace ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants