Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Breki's avatar
Level 4

PHPStorm removing (some) linebreaks in Blade files

I've been going through the various "Code Style" rules in PHPStorm to try to find what's causing this but haven't been able to figure it out. For some reason, the "Automatic Reformat" option in PHPStorm is causing Blade files that look like this:

@extends('errors.minimal')

@section('title', __('Forbidden'))
@section('code', '403')
@section('message', __('Forbidden'))

To instead look like this:

@extends('errors.minimal')

@section('title', __('Forbidden'))@section('code', '403')@section('message', __('Forbidden'))

Everything looks fine if I add extra spacing between the @section rows, but having them one after the other like this causes the formatting to get all messed up. Any suggestions?

0 likes
5 replies
Breki's avatar
Level 4

Bumping this in a vain attempt to get some clarity with my problems.

click's avatar

"it works on my device" is not what you want to hear probably.

How do you run "Automatic Reformat"? Is that the same as "Code > Reformat Code"?

Do you have the Laravel & Blade plugin enabled in PHPStorm?

Breki's avatar
Level 4

Yes, I run it from the hotkey (Cmd + Opt + L, on macOS).

As for the plugins I have enabled, the Laravel-related ones are:

  • Laravel
  • Laravel Idea
  • Laravel Live Templates
  • Laravel Make
  • Laravel Query
  • Blade

All are updated to their latest versions and I've gone through the settings of each to see if there might be anything that could be interfering with reformatting code, but can't find anything.

click's avatar

I only have Laravel and Blade (bundled) enabled and it works all fine here. If possible, try resetting your Code style in the config Editor > Code Style > php and the one of blade, there must be one of the settings that is causing this.

Breki's avatar
Level 4

Interesting.. Resetting the Blade code style settings did nothing, but resetting my PHP code style settings did. It feels strange for Blade files to use the PHP code style, it feels like Blade files should default to the HTML code style settings for whatever isn't implicitly defined by the Blade code style, no?

1 like

Please or to participate in this conversation.