Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

April Fools' Shift - #25

Closed
kingRayhan wants to merge 1 commit into
productionfrom
shift-87883
Closed

kingRayhan wants to merge 1 commit into
productionfrom
shift-87883

Conversation

@kingRayhan

Copy link
Copy Markdown
Member

This pull request contains comments from a sarcastic Shift bot regarding outdated practices still detected even after upgrading over 85,000 Laravel applications.

While these comments are left in jest, they are still real suggestions you might consider. Feel free to remove the .shift file and commit any refactors to the shift-87883 branch.

Happy April Fools' Day from Shift!

@kingRayhan

Copy link
Copy Markdown
Member Author

Tisk tisk. Upgrade to the latest version of Laravel.

With the exception of Laravel 9, all previous versions of Laravel have reached end of life. This means they no longer receive new features, bug fixes, or security updates. Even Laravel 9 no longer receives new features, and will only receive bug fixes until August.

@kingRayhan

Copy link
Copy Markdown
Member Author

Run PHP 8.1 or higher.

Previous versions of PHP are not actively supported. This means they no longer receive new features, bug fixes, or security updates. Even PHP 8.0 will only receive security updates until November.

@kingRayhan

Copy link
Copy Markdown
Member Author

Are you a typist or a programmer?

Shift did not detect a code style. Maybe you have one globally or within CI. With all the available options (PHP CodeSniffer, PHP CS Fixer, or Pint) surely you can take a few minutes to set one up so you can focus on coding and not indentation.

@kingRayhan

Copy link
Copy Markdown
Member Author

YourRoutes@oldSchoolSyntax

Laravel supports using class-based routes since Laravel 6. These became the documented convention in Laravel 8. Using class-based routes allow for runtime checking by PHP, as well as static analysis within your IDE.

@kingRayhan

kingRayhan commented Apr 9, 2023 •

Copy link
Copy Markdown
Member Author

Adam Wathan would be disappointed.

You have controllers with actions outside of the 7 resource actions (index, create, store, show, edit, update, destroy). You should watch Cruddy by Design and refactor your application to use resourceful or invokable controllers.

  • app/Http/Controllers/AccessTokenController.php
  • app/Http/Controllers/Admin/AdminCrudController.php
  • app/Http/Controllers/Admin/ArticleCrudController.php
  • app/Http/Controllers/Admin/Charts/LatestArticlesChartController.php
  • app/Http/Controllers/Admin/Charts/LatestUserChartController.php
  • app/Http/Controllers/Admin/DashboardRootController.php
  • app/Http/Controllers/Admin/TagCrudController.php
  • app/Http/Controllers/Admin/UserCrudController.php
  • app/Http/Controllers/Admin/UserSocialCrudController.php
  • app/Http/Controllers/ArticleController.php
  • app/Http/Controllers/AuthController.php
  • app/Http/Controllers/BookmarkController.php
  • app/Http/Controllers/FileController.php
  • app/Http/Controllers/OAuthController.php
  • app/Http/Controllers/ProfileController.php
  • app/Http/Controllers/RSSFeedController.php

@kingRayhan

Copy link
Copy Markdown
Member Author

Use what the framework provides.

There is no need to access the request with a facade in your HTTP classes. Within these components you should use the request object which is automatically injected to any controller action or middleware.

  • app/Http/Controllers/Admin/ArticleCrudController.php
  • app/Http/Controllers/Admin/TagCrudController.php
  • app/Http/Controllers/Admin/UserCrudController.php
  • app/Http/Controllers/Admin/UserSocialCrudController.php

@kingRayhan

Copy link
Copy Markdown
Member Author

Do you like slow apps or something?

You are using the env() helper in your application. You should use the config() helper instead and cache your config. That way Laravel doesn't have to read all your config files on every request.

  • app/Http/Controllers/OAuthController.php
  • app/Http/Resources/Article/ArticleDetails.php
  • app/Http/Resources/Article/ArticleList.php
  • app/Models/Article.php
  • app/Providers/AppServiceProvider.php
  • app/TechDiary/Markdown/TDMarkdown.php
  • resources/views/welcome.blade.php

@kingRayhan kingRayhan closed this May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants