Power-Components / livewire-powergrid

⚡ PowerGrid generates modern, powerful and easy-to-customize data tables using Laravel Livewire.
https://livewire-powergrid.com
MIT License
1.42k stars 209 forks source link

[FIX] Allow different text cases on component create #1454

Closed dansysanalyst closed 4 months ago

dansysanalyst commented 4 months ago

⚡ PowerGrid - Pull Request

Welcome and thank you for your interest in contributing to our project!. You must use this template to submit a Pull Request or it will not be accepted.


Motivation

Description

This Pull Request changes the powergrid:create command, keeping the text case informed by the user unaltered, while still trying to normalize and prevent mistakes. Before, we tried to fix/standardize the component paths, thus preventing user errors.

With this PR, we also disable the possibility to create components with dashes or underscores in the name. While PSR-4 cna can resolve underscores in namespaces, this is not very "Laravel like" and users are welcome to rename their folders and namespaces as they want, after the component is created.

   Enter a name for your new PowerGrid Component:

    Dispatch\ServiceCalls\ServiceCallIndexTable

    Dispatch.ServiceCalls.ServiceCallIndexTable
 ⚡ ServiceCallIndexTable was successfully created at [app/Livewire/Dispatch/ServiceCalls/ServiceCallIndexTable.php].

 💡 include the ServiceCallIndexTable component using the tag: <livewire:dispatch.servicecalls.service-call-index-table/>

 👍 Please consider ⭐ starring ⭐ our repository. Visit: https://github.com/Power-Components/livewire-powergrid

When using special characters:

   Enter a name for your new PowerGrid Component:

     tables/my-tables/UserTable

     tables/my_tables/UserTable

     tables/my-tables/@!$#UserTable

Will result in:

 ⚡ UserTable was successfully created at [app/Livewire/tables/mytables/UserTable.php].

 💡 include the UserTable component using the tag: <livewire:tables.mytables.user-table/>

 👍 Please consider ⭐ starring ⭐ our repository. Visit: https://github.com/Power-Components/livewire-powergrid

Related Issue(s): https://github.com/Power-Components/livewire-powergrid/issues/1450.

Documentation

This PR requires Documentation update?

dansysanalyst commented 4 months ago

PostgreSQL test failing for an unrelated reason (see PR https://github.com/Power-Components/livewire-powergrid/pull/1455).

luanfreitasdev commented 4 months ago

Thank you @dansysanalyst !