Skip to content

Blade Partials

Use camelCase

View files and directories MUST use camelCase.

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

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.

blade
<?php
/**
 * @var \App\Models\User $user
 * @var \Illuminate\Support\Collection<int, \App\Models\Post> $posts
 * View context:
 * @var \Illuminate\Support\ViewErrorBag $errors Default bag with errors.
 */
?>
<x-layouts.main-html>
...

Note, other view context variables like $app, $__env are not mentioned here their usages considered as a code smell.