Readable Markup
Blade and HTML must be written multi-line and indented. Do not emit minified markup: several elements collapsed onto one line, or a whole view or component written as one long line.
- An element with children opens and closes on its own line, with the children indented one level.
- Sibling elements go on separate lines.
- Blade directives such as
@if,@foreach, and@canopen and close on their own lines, with the body indented. - An attribute list that is long — roughly three or more attributes, or a long Tailwind class list — may wrap one attribute per line.
A childless element with a short attribute list may stay on one line, such as <x-input wire:model="object.name" :label="__('Name')" />. Short inline content stays where it belongs — do not break <strong>, <a>, or {{ }} out of the paragraph or label that contains them just to satisfy this rule.
This rule governs markup being written or generated. Do not reformat existing untouched markup only to satisfy it. Templates under resources/views/vendor/, build output, and minified assets are out of scope.
{{-- Wrong --}}
<div class="flex flex-col gap-4"><x-input wire:model="object.name" :label="__('Name')" /><x-button type="submit">{{ __('Save') }}</x-button></div>
{{-- Correct --}}
<div class="flex flex-col gap-4">
<x-input wire:model="object.name" :label="__('Name')" />
<x-button type="submit">{{ __('Save') }}</x-button>
</div>