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

added option to use kebab case #2002

Merged
merged 1 commit into from
Dec 23, 2024
Merged

added option to use kebab case #2002

merged 1 commit into from
Dec 23, 2024

Conversation

dcblogdev
Copy link
Collaborator

This PR adds support to use kebab case for routes.

To enable this edit your config file and change the path location to your local stub files (publish them if you don't have them)

'stubs' => [
        'enabled' => false,
        'path' => base_path('stubs/nwidart-stubs'),

Also add KEBAB in the replacements array:

'replacements' => [
            'routes/web' => ['LOWER_NAME', 'KEBAB_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'CONTROLLER_NAMESPACE'],
            'routes/api' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'CONTROLLER_NAMESPACE'],

Then to use in your routes stub edit /stubs/nwidart-stubs/web.stub

Route::group([], function () {
   Route::resource('$KEBAB_NAME$', $STUDLY_NAME$Controller::class)->names('$KEBAB_NAME$');
});

Next time a module is created it will use the KEBAB case.

@dcblogdev dcblogdev merged commit 932b861 into master Dec 23, 2024
7 of 8 checks passed
@dcblogdev dcblogdev deleted the add-kebab-case-option branch December 23, 2024 20:41
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.

1 participant