Search code examples
phpstorm

How to tune valid indents with class and “make” method of FilamentPHP code?


Working with Laravel 10 / FilamentPHP 3 app in PhpStorm 2023.2.2. When I run "Reformat Code" command I want to have both class and make method at the same line, but with valid indents on next lines, not like I have now:

return $form
    ->schema([
        Forms\Components\Card::make()
                             ->schema([
                                 TextInput::make('id')->lazy()->disabled()->dehydrated(false)

But like this:

return $form
    ->schema([
        Forms\Components\Card::make()
            ->schema([
                 TextInput::make('id')->lazy()->disabled()->dehydrated(false)

Something like I see in docs : https://filamentphp.com/docs/3.x/panels/resources/creating-records#customizing-the-save-notification

Are there some options for this?


Solution

  • On your PhpStorm: Ctrl+Alt+S -> Editor -> Code Style -> PHP Choose Schema. Choose what you need to change (I assume it's Tabs and Indents and Wrapping and Braces)