Power-Components/livewire-powergrid

Can't Have Underscores/Dashes in Model Name

Closed this issue · 4 comments

GBry commented

Have you searched through other issues to see if your problem is already reported or has been fixed?

Yes, I did not find it.

Did you read the documentation?

Yes, I did not find it.

Have you tried to publish the views?

Yes - I didn't work.

Is there an error in the console?

No

PHP Version

8.3.3

PowerGrid

v5.10.6

Laravel

10.48.22

Livewire

3.5.8

Alpine JS

Livewire-Embedded

Theme

Tailwind 3.x

Describe the bug.

Basically

 Cannot find class [App\Models\appModelsworkorderlogmodelphp]. Try again or press Ctrl+C to abort.```

### To Reproduce...

Just use a model name and class name with underscores, then create a new PGTable using that as a datasource.

### Extra information

```markdown
Used to work before. I have lots of tables referencing to it. I can copy, but then I will lose the ability to have the script generate the columns for me.

Hi. Since this is not usually a standard, I will close this. You can create the table with a camel case name and then rename it.

Thanks

GBry commented

Instead of doing that why couldn't you just allow us to define exact model file names using double quotes or something similar? Defining exact file names won't cut it and the :create script just makes decisions on its own... It used to work. PGv3 are able to use models with underscores.

@GBry . Feel free to open a pull request for this 😃

GBry commented

If I'm advanced enough, sure. Maybe in the future. I'm currently an "end-developer".

Just scratching my head why it was allowed in PGv3 but not anymore