Skip to content

Hihaho Rector RulesStop reviewing the same convention twice

Rector rules that rewrite Laravel convention breaches instead of reporting them: naming, routing, migration safety, Eloquent relations and named arguments.

What a run looks like ​

text
1 file with changes
===================

1) app/Http/Resources/Article.php:4

    ---------- begin diff ----------
@@ Line 4 @@

 use Illuminate\Http\Resources\Json\JsonResource;

-class Article extends JsonResource
+class ArticleResource extends JsonResource
 {
 }
    ----------- end diff -----------

Applied rules:
 * AddResourceSuffixRector


 [OK] 1 file would have been changed (dry-run) by Rector

Install it as a dev dependency, enable a set, and dry-run before you apply.

bash
composer require hihaho/rector-rules --dev
vendor/bin/rector process --dry-run

Where to next ​