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

Fix blade file name convention #24

Merged
merged 1 commit into from
Sep 23, 2019

Conversation

Daniyal-Javani
Copy link
Contributor

I think it's better to follow the framework naming convention. In this package they are using kebab-case instead of snake_case for blade files.
https://github.com/illuminate/pagination/tree/master/resources/views

Copy link

@meliani meliani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this have to merged.

README.md Outdated
@@ -470,7 +470,7 @@ Variable | camelCase | $articlesWithAuthor | ~~$articles_with_author~~
Collection | descriptive, plural | $activeUsers = User::active()->get() | ~~$active, $data~~
Object | descriptive, singular | $activeUser = User::active()->first() | ~~$users, $obj~~
Config and language files index | snake_case | articles_enabled | ~~ArticlesEnabled; articles-enabled~~
View | snake_case | show_filtered.blade.php | ~~showFiltered.blade.php, show-filtered.blade.php~~
View | kebab_case | show-filtered.blade.php | ~~showFiltered.blade.php, show_filtered.blade.php~~

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be kebab-case instead of kebab_case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

@alexeymezenin
Copy link
Owner

alexeymezenin commented Jun 24, 2019

Hi guys. I've seen these variations in Laravel projects viewName.blade.php, view_name.blade.php, view-name.blade.php. In the largest projects, teams agreed to use view_name.blade.php because in the most of IDEs one can double click a Blade file to select its name (the view_name part) to copy paste it to a controller or some other view. And we do it a lot, so the view_name.blade.php is chosen.

I'll add a vote. Please use the thumbs up reaction to vote.

@alexeymezenin
Copy link
Owner

viewName.blade.php

@alexeymezenin
Copy link
Owner

view-name.blade.php

@alexeymezenin
Copy link
Owner

view_name.blade.php

@alexeymezenin
Copy link
Owner

Changed to kebab-case according to the vote results.

gersonkevin23 added a commit to gersonkevin23/laravel-best-practices that referenced this pull request Mar 3, 2022
sadafrangian3 pushed a commit to sadafrangian3/best-practices-laravel that referenced this pull request Nov 2, 2022
gregoryross1211 added a commit to gregoryross1211/Awesmoe-laravel-best-practices that referenced this pull request Nov 11, 2022
sevenstar1124 added a commit to sevenstar1124/laravel-best-practices that referenced this pull request Feb 8, 2024
happyguy0311 added a commit to happyguy0311/Laravel_Best_Practise that referenced this pull request May 5, 2024
486xtm added a commit to 486xtm/laravel-practice that referenced this pull request May 16, 2024
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.

4 participants