Views

Use camelCase

View files and directories MUST use camelCase.

Tree
resources/
    views/
        pages/
            localGroups/
                show.blade.php
                createDiscussion.blade.php

Explicitly pass variables to partials and components

PHP
{{-- GOOD --}}
{{ $user->name }}
@include('welcome', ['user' => $user])

{{-- BAD --}}
{{ $user->name }}
@include('welcome')

Help your IDE

You SHOULD create and maintain PHPDoc blocks at the top of every view file. You MUST create and maintain PHPDoc blocks for components.

Add PHP injection using . The @php and @endphp Blade directives pair looks better, but the tools we use (Psalm, Rector, PHPCS, PHP-CS-Fixer) can’t parse Blade syntax.