Skip to content

Fixes some issues and confusion of datatable generator command #165

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

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

rahulhaque
Copy link
Contributor

This pull request fixes plethora of issues for the datatables:make command -

  1. Fixes datatables:make command fail to generate error free classes for the following scenarios where it can't identify the model name and namespace correctly -
    • php artisan datatables:make Api/DriverDataTable
    • php artisan datatables:make Api/Driverdatatable
    • php artisan datatables:make Api/Driver
    • php artisan datatables:make Api/DriverDataTable --model=Driver
    • php artisan datatables:make Api/DriverDataTable --model=Driver --model-namespace=App\\Custom
    • php artisan datatables:make Api/DriverDataTable --builder
  2. Fixes appending DataTable with mix-case or lowercase generating different class name.
  3. In datatables:make command, the getModel() method was too confusing. Tried to simplify the logic and removed code duplication. Such as, there's no need to check for -
    • Existence of Models directory and
    • Root namespace when model namespace is provided by the user (either in config or in arguments).
  4. Fixes where datatables:make --builder command will always fail to create HTML builder class.

@rahulhaque
Copy link
Contributor Author

Good day @yajra. I feel like there are lot of changes within a single pull request. First I thought let's fix this portion only, then it led to another, then another, and I end up making all the changes in one commit. Also there are some changes I think related to styles that your GitHub actions identified during my first pull request. If you could manage some time to look, do suggest me any changes needed.

@yajra
Copy link
Owner

yajra commented Nov 15, 2022

Good day @rahulhaque, no problem with the changes. Will review this as soon as I can. Thanks!

@yajra yajra self-requested a review November 15, 2022 02:47
@yajra yajra removed the for review label Nov 15, 2022
@yajra yajra merged commit 53fc2be into yajra:master Nov 15, 2022
@yajra
Copy link
Owner

yajra commented Nov 15, 2022

Released on v9.1.3, thanks a lot! 🚀

@rahulhaque rahulhaque deleted the generator-command-fix branch November 15, 2022 12:18
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

Successfully merging this pull request may close these issues.

2 participants