PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, May 16, 2022

[FIXED] How to change PHP code style in PhpStorm IDE?

 May 16, 2022     laravel, php, phpstorm     No comments   

Issue

I'm using Laravel framework. I want to change the default code style format from this:

 return [
            'name' => 'required|min:4|string',
            'email' => 'required|email|unique:users,email',
            'password' => 'required|min:4|confirmed',
            'password-confirmation' => 'required|min:4'
        ];

to this:

return [
            'name'                  => 'required|min:4|string',
            'email'                 => 'required|email|unique:users,email',
            'password'              => 'required|min:4|confirmed',
            'password-confirmation' => 'required|min:4'
        ];

I did a lot of searches in PhpStorm settings but I couldn't find the solution.


Solution

  1. File | Settings (PhpStorm | Preferences on macOS)
  2. Editor | Code Style | PHP
  3. Wrapping and Braces tab
  4. Array initializer | Align key-value pairs option

enter image description here



Answered By - LazyOne
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,207,268

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing