CINXE.COM

Laravel Pint | PhpStorm Documentation

<!DOCTYPE html SYSTEM "about:legacy-compat"> <html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><link rel="canonical" href="https://www.jetbrains.com/help/phpstorm/using-laravel-pint.html" data-react-helmet="true"/><meta charset="UTF-8"></meta><meta name="built-on" content="2025-01-30T15:27:58.145734231"><meta name="build-number" content="622"><title>Laravel Pint | PhpStorm Documentation</title><script type="application/json" id="virtual-toc-data">[{"id":"installing-configuring-php-cs-fixer","level":0,"title":"Install and configure Laravel Pint","anchor":"#installing-configuring-php-cs-fixer"},{"id":"enabling-tool-inspection","level":0,"title":"Enable Laravel Pint as a PhpStorm inspection","anchor":"#enabling-tool-inspection"},{"id":"running-tool-in-batch-mode","level":0,"title":"Run Laravel Pint in batch mode","anchor":"#running-tool-in-batch-mode"},{"id":"fixing-issues","level":0,"title":"Fix issues detected by Laravel Pint","anchor":"#fixing-issues"},{"id":"sharing-custom-coding-style","level":0,"title":"Share a custom coding style with the team","anchor":"#sharing-custom-coding-style"},{"id":"excluding-files-from-inspection","level":0,"title":"Exclude files from Laravel Pint inspection","anchor":"#excluding-files-from-inspection"}]</script><script type="application/json" id="topic-shortcuts">{"CodeCompletion":{"Windows":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"PC"},"Eclipse":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"PC"},"Emacs":{"keystrokes":[{"keys":["mod-Alt","char-/"]}],"platform":"PC"},"NetBeans":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"PC"},"Sublime Text":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"PC"},"Visual Studio":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"PC"},"macOS":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"MAC"},"Eclipse (macOS)":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"MAC"},"IntelliJ IDEA Classic (macOS)":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"MAC"},"Sublime Text (macOS)":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"MAC"},"Visual Studio (macOS)":{"keystrokes":[{"keys":["mod-Control","key-Space"]}],"platform":"MAC"}},"ReformatCode":{"Windows":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-L"]}],"platform":"PC"},"Eclipse":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-L"]}],"platform":"PC"},"Emacs":{"platform":"PC"},"NetBeans":{"keystrokes":[{"keys":["mod-Alt","mod-Shift","char-F"]}],"platform":"PC"},"Sublime Text":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-L"]}],"platform":"PC"},"Visual Studio":{"keystrokes":[{"keys":["mod-Control","mod-Alt","key-Enter"]}],"platform":"PC"},"macOS":{"keystrokes":[{"keys":["mod-Command","mod-Alt","char-L"]}],"platform":"MAC"},"Eclipse (macOS)":{"keystrokes":[{"keys":["mod-Command","mod-Shift","char-F"]}],"platform":"MAC"},"IntelliJ IDEA Classic (macOS)":{"keystrokes":[{"keys":["mod-Command","mod-Alt","char-L"]}],"platform":"MAC"},"Sublime Text (macOS)":{"keystrokes":[{"keys":["mod-Command","mod-Alt","char-L"]}],"platform":"MAC"},"Visual Studio (macOS)":{"keystrokes":[{"keys":["mod-Command","mod-Alt","key-Enter"]}],"platform":"MAC"}},"ShowIntentionActions":{"Windows":{"keystrokes":[{"keys":["mod-Alt","key-Enter"]}],"platform":"PC"},"Eclipse":{"keystrokes":[{"keys":["mod-Control","char-1"]}],"platform":"PC"},"Emacs":{"keystrokes":[{"keys":["mod-Alt","key-Enter"]}],"platform":"PC"},"NetBeans":{"keystrokes":[{"keys":["mod-Alt","key-Enter"]}],"platform":"PC"},"Sublime Text":{"keystrokes":[{"keys":["mod-Alt","key-Enter"]}],"platform":"PC"},"Visual Studio":{"keystrokes":[{"keys":["mod-Alt","key-Enter"]}],"platform":"PC"},"macOS":{"keystrokes":[{"keys":["mod-Alt","key-Enter"]}],"platform":"MAC"},"Eclipse (macOS)":{"keystrokes":[{"keys":["mod-Command","char-1"]}],"platform":"MAC"},"IntelliJ IDEA Classic (macOS)":{"keystrokes":[{"keys":["mod-Alt","key-Enter"]}],"platform":"MAC"},"Sublime Text (macOS)":{"keystrokes":[{"keys":["mod-Alt","key-Enter"]}],"platform":"MAC"},"Visual Studio (macOS)":{"keystrokes":[{"keys":["mod-Alt","key-Enter"]}],"platform":"MAC"}},"ShowSettings":{"Windows":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Eclipse":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Emacs":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"NetBeans":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Sublime Text":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Visual Studio":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"macOS":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"Eclipse (macOS)":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"IntelliJ IDEA Classic (macOS)":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"Sublime Text (macOS)":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"Visual Studio (macOS)":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"}}}</script><link href="https://resources.jetbrains.com/storage/help-app/v6/app.css" rel="stylesheet"><meta name="description" content=" To use Laravel Pint from PhpStorm instead of the command line, you need to register it in PhpStorm and configure it as a PhpStorm code inspection. "><link rel="manifest" href="https://www.jetbrains.com/site.webmanifest"><meta name="msapplication-TileColor" content="#000000"><link rel="apple-touch-icon" sizes="180x180" href="https://jetbrains.com/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="https://jetbrains.com/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="https://jetbrains.com/favicon-16x16.png"><meta name="msapplication-TileImage" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-144x144.png"><meta name="msapplication-square70x70logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-70x70.png"><meta name="msapplication-square150x150logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-150x150.png"><meta name="msapplication-wide310x150logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-310x150.png"><meta name="msapplication-square310x310logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-310x310.png"><meta name="image" content="https://resources.jetbrains.com/storage/products/phpstorm/img/meta/preview.png"><!-- Open Graph --><meta property="og:title" content="Laravel Pint | PhpStorm"><meta property="og:description" content=""><meta property="og:image" content="https://resources.jetbrains.com/storage/products/phpstorm/img/meta/preview.png"><meta property="og:site_name" content="PhpStorm Help"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:url" content="https://www.jetbrains.com/help/phpstorm/using-laravel-pint.html"><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@phpstorm"><meta name="twitter:title" content="Laravel Pint | PhpStorm"><meta name="twitter:description" content=""><meta name="twitter:creator" content="@phpstorm"><meta name="twitter:image:src" content="https://resources.jetbrains.com/storage/products/phpstorm/img/meta/preview.png"><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json">{ "@context": "http://schema.org", "@type": "WebPage", "@id": "https://www.jetbrains.com/help/phpstorm/using-laravel-pint.html#webpage", "url": "https://www.jetbrains.com/help/phpstorm/using-laravel-pint.html", "name": "Laravel Pint | PhpStorm", "description": "", "image": "https://resources.jetbrains.com/storage/products/phpstorm/img/meta/preview.png", "inLanguage":"en-US" }</script><!-- End Schema.org --><!-- Schema.org WebSite --><script type="application/ld+json">{ "@type": "WebSite", "@id": "https://www.jetbrains.com/help/phpstorm/#website", "url": "https://www.jetbrains.com/help/phpstorm/", "name": "PhpStorm Help" }</script><!-- End Schema.org --><script> (function (w, d, s, l, i) { w[l] = w[l] || []; w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;l=' + l : ''; j.async = true; j.src = '//www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); })(window, document, 'script', 'dataLayer', 'GTM-5P98'); </script> <script src="https://resources.jetbrains.com/storage/help-app/v6/analytics.js"></script> </head><body data-id="Using_Laravel_Pint" data-main-title="Laravel Pint" data-article-props="{&quot;seeAlso&quot;:[{&quot;title&quot;:&quot;Procedures&quot;,&quot;links&quot;:[{&quot;url&quot;:&quot;code-inspection.html&quot;,&quot;text&quot;:&quot;Code inspections&quot;,&quot;tooltip&quot;:&quot;\n Inspections detect and correct abnormal code: possible bugs, bad coding style, typos, and other problems.\n &quot;,&quot;description&quot;:&quot;\n Inspections detect and correct abnormal code: possible bugs, bad coding style, typos, and other problems.\n &quot;},{&quot;url&quot;:&quot;using-the-composer-dependency-manager.html&quot;,&quot;text&quot;:&quot;Composer dependency manager&quot;}]},{&quot;title&quot;:&quot;Reference&quot;,&quot;links&quot;:[{&quot;url&quot;:&quot;php-quality-tools.html#php_quality_tools_laravel_pint&quot;,&quot;text&quot;:&quot;Laravel Pint reference page&quot;},{&quot;url&quot;:&quot;inspections-settings.html&quot;,&quot;text&quot;:&quot;Inspections&quot;}]}],&quot;seeAlsoStyle&quot;:&quot;links&quot;}" data-template="article" data-breadcrumbs="PHP frameworks and external tools///PHP_Code_Quality_Tools.topic|PHP code quality tools"><div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>PhpStorm 2024.3 Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="Using_Laravel_Pint" id="Using_Laravel_Pint.topic">Laravel Pint</h1><p id="-6d5kro_8">In addition to built-in coding assistance, PhpStorm integrates with <a href="https://laravel.com/docs/pint" id="-6d5kro_19" data-external="true" rel="noopener noreferrer">Laravel Pint</a>鈥攁 code quality tool built on top of <a href="using-php-cs-fixer.html" id="-6d5kro_20">PHP CS Fixer</a> for detecting coding style issues in <a href="laravel.html" id="-6d5kro_21">Laravel projects</a>.</p><p id="-6d5kro_9">To use Laravel Pint from PhpStorm instead of the command line, you need to register it in PhpStorm and configure it as a PhpStorm <a href="code-inspection.html" id="-6d5kro_22" data-tooltip=" Inspections detect and correct abnormal code: possible bugs, bad coding style, typos, and other problems. ">code inspection</a>. Once installed and enabled in PhpStorm, the tool is available in any opened PHP file, and no additional steps are required to launch it. The on-the-fly code check is activated upon every update in the file thus making it easy to get rid of discovered problems.</p><p id="-6d5kro_10">The issues reported by Laravel Pint on the fly are highlighted in the editor in the same way as the errors and warnings reported by <a href="running-inspections.html#analysis-current-file" id="-6d5kro_26">PhpStorm's internal code inspections</a>. When the tool is run in batch mode, the errors and warnings are displayed in the <a href="problems-tool-window.html" id="-6d5kro_24">Problems tool window</a>. Each message has the <code class="code" id="-6d5kro_25">Laravel Pint</code> prefix to distinguish it from PhpStorm internal inspections.</p><p id="-6d5kro_11">You can use the predefined groups of <a href="https://laravel.com/docs/pint#rules" id="-6d5kro_27" data-external="true" rel="noopener noreferrer">Laravel Pint rules</a>, or enable and disable specific rules in the <code class="code" id="-6d5kro_28">pint.json</code> file.</p><section class="chapter"><h2 id="installing-configuring-php-cs-fixer" data-toc="installing-configuring-php-cs-fixer">Install and configure Laravel Pint</h2><section class="procedure-steps"><h3 id="install-tool-with-composer" data-toc="install-tool-with-composer">Install Laravel Pint with Composer</h3><aside class="prompt" data-type="tip" data-title="" id="-6d5kro_31"><p>Before you start, make sure Composer is installed on your machine and initialized in the current project as described in <a href="using-the-composer-dependency-manager.html" id="-6d5kro_133">Composer dependency manager</a>. </p></aside><p id="-6d5kro_32">Laravel Pint is <a href="https://laravel.com/docs/pint#installation" id="-6d5kro_36" data-external="true" rel="noopener noreferrer">included in recent releases</a> of the Laravel framework, so the <span class="emphasis" id="-6d5kro_37">composer.json</span> file in your project would typically have the <code class="code" id="-6d5kro_38">laravel/pint</code> dependency record added to it. If it doesn't, add the record manually:</p><ol class="list _decimal"><li class="list__item" id="-6d5kro_121"><p id="-6d5kro_138">Inside <span class="filepath" id="-6d5kro_139">composer.json</span>, add the <code class="code" id="-6d5kro_140">laravel/pint</code> dependency record to the <code class="code" id="-6d5kro_141">require</code> or <code class="code" id="-6d5kro_142">require-dev</code> key. To get code completion for the package name and version, press <kbd id="-6d5kro_143" data-key="CodeCompletion">Ctrl+Space</kbd>.</p></li><li class="list__item" id="-6d5kro_122"><p id="-6d5kro_146">Do one of the following:</p><ul class="list _bullet" id="-6d5kro_149"><li class="list__item" id="-6d5kro_150"><p id="-6d5kro_152">Click the <span class="control" id="-6d5kro_153">Install</span> shortcut link on top of the editor panel.</p></li><li class="list__item" id="-6d5kro_151"><p id="-6d5kro_154">If the <span class="control" id="-6d5kro_155">Non-installed Composer packages</span> inspection is enabled, PhpStorm will highlight the declared dependencies that are not currently installed. Press <kbd id="-6d5kro_156" data-key="ShowIntentionActions">Alt+Enter</kbd> and select whether you want to install a specific dependency or all dependencies at once.</p></li></ul></li></ol><p id="-6d5kro_129">Clicking <img src="https://resources.jetbrains.com/help/img/idea/2024.3/app-client.expui.general.settings.svg" class="inline-icon-" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/app-client.expui.general.settings_dark.svg" id="-6d5kro_157" title="the Settings button" alt="the Settings button" width="16" height="16"> next to the package record in the <span class="filepath" id="-6d5kro_158">composer.json</span> editor gutter will take you to the corresponding <span class="control" id="-6d5kro_159">Settings</span> page where you can <span id="-6d5kro_160">configure Laravel Pint manually</span>.</p><figure id="-6d5kro_130"><img alt="Gutter icon for laravel_pint settings in composer.json" src="https://resources.jetbrains.com/help/img/idea/2024.3/ps_laravel_pint_composer_json_gutter_icon.png" class="article__bordered-element" title="Gutter icon for laravel_pint settings in composer.json" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/ps_laravel_pint_composer_json_gutter_icon_dark.png" width="400" height="55"></figure></section><section class="procedure-steps"><h3 id="configure-tool-options" data-toc="configure-tool-options">Configure Laravel Pint in PhpStorm</h3><p id="-6d5kro_166">When you <a href="#install-tool-with-composer" id="-6d5kro_172">install Laravel Pint with Composer</a>, PhpStorm automatically detects Laravel Pint's executable file in the <code class="code" id="-6d5kro_173">vendor/bin</code> folder and sets the PHP interpreter configured in the system path to run it.</p><p id="-6d5kro_168">In <span class="control" id="-6d5kro_174">Settings</span> (<kbd id="-6d5kro_175" data-key="ShowSettings">Ctrl+Alt+S</kbd>) | <span class="menupath" id="-6d5kro_176">PHP | Quality Tools | Laravel Pint</span>, you can change the default PHP interpreter, set the path to a custom path to the Laravel Pint executable file, or add some options to be passed to Laravel Pint when running it in PhpStorm.</p><figure id="-6d5kro_169"><img alt="Laravel Pint settings" src="https://resources.jetbrains.com/help/img/idea/2024.3/laravel_pint_settings.png" class="article__bordered-element" title="Laravel Pint settings" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/laravel_pint_settings_dark.png" width="665" height="208"></figure><ul class="list _bullet"><li class="list__item" id="-6d5kro_170"><p id="-6d5kro_184"><span class="control" id="-6d5kro_187">Configuration</span>: in this field, you can change the default PHP interpreter and set the path to the Laravel Pint executable file.</p><ol class="list _alpha-lower" id="-6d5kro_186" type="a"><li class="list__item" id="-6d5kro_189"><p id="-6d5kro_191">To change the interpreter, select the required item from the list of local and remote PHP interpreters configured in your project.</p><aside class="prompt" data-type="note" data-title="" id="-6d5kro_193"><p>Learn more about configuring PHP interpreters in <a href="configuring-remote-interpreters.html" id="-6d5kro_197">Configure remote PHP interpreters</a> or in <a href="configuring-local-interpreter.html" id="-6d5kro_198">Configure local PHP interpreters</a>. </p></aside></li><li class="list__item" id="-6d5kro_190"><p id="-6d5kro_200">To set the path to the Laravel Pint executable file, click <img src="https://resources.jetbrains.com/help/img/idea/2024.3/app.general.ellipsis.svg" class="inline-icon-" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/app.general.ellipsis_dark.svg" id="-6d5kro_202" title="the Browse button" alt="the Browse button" width="16" height="16"> next to the <span class="control" id="-6d5kro_203">Configuration</span> list to open the <span class="control" id="-6d5kro_204">Laravel Pint</span> dialog and edit the fields there as described on the <a href="php-quality-tools.html#laravel_pint-dialog" id="-6d5kro_205">Laravel Pint Dialog</a> reference page.</p></li></ol></li><li class="list__item" id="-6d5kro_171"><p><span class="control" id="-6d5kro_206">Show ignored files</span>: use this setting to <a href="#excluding-files-from-inspection" id="-6d5kro_207">exclude files from Laravel Pint validation inspection</a>. For more information, refer to the <a href="php-quality-tools.html#laravel_pint-show-ignored-files" id="-6d5kro_208">Quality Tools</a> reference page.</p></li><li class="list__item" id="-6d5kro_45"><p id="-6d5kro_48"><span class="control" id="-6d5kro_50">Options</span>: in this area, add the options to <a href="#configure-tool-inspection-manually" id="-6d5kro_51">run Laravel Pint as a PhpStorm inspection</a> with.</p><ul class="list _bullet" id="-6d5kro_49"><li class="list__item" id="-6d5kro_53"><p> <span class="control" id="-6d5kro_56">Reformat only uncommitted files</span>: select the checkbox to only modify the files that have uncommitted changes.</p></li><li class="list__item" id="-6d5kro_54"><p> <span class="control" id="-6d5kro_57">Path to pint.json</span>: specify the path to the <code class="code" id="-6d5kro_58">pint.json</code> configuration file. <code class="code" id="-6d5kro_59">pint.json</code> files are optional: they are used to enable/disable specific rules from the predefined Laravel Pint presets, or to reuse custom rulesets from PHP CS Fixer.</p></li><li class="list__item" id="-6d5kro_55"><p> <span class="control" id="-6d5kro_60">Ruleset</span>: select one of Laravel Pint's <a href="https://laravel.com/docs/pint#presets" id="-6d5kro_61" data-external="true" rel="noopener noreferrer">predefined groups of rules</a> to be used for fixing code style issues in your code.</p></li></ul></li></ul></section></section><section class="chapter"><h2 id="enabling-tool-inspection" data-toc="enabling-tool-inspection">Enable Laravel Pint as a PhpStorm inspection</h2><section class="procedure-steps"><h3 id="configure-tool-inspection-manually" data-toc="configure-tool-inspection-manually">Enable Laravel Pint validation in Inspections settings</h3><ol class="list _decimal"><li class="list__item" id="-6d5kro_63"><p id="-6d5kro_67"> In the <span class="control" id="-6d5kro_211">Settings</span> dialog (<kbd id="-6d5kro_212" data-key="ShowSettings">Ctrl+Alt+S</kbd>) , click <span class="control" id="-6d5kro_69">Inspections</span> under <span class="control" id="-6d5kro_70">Editor</span>.</p></li><li class="list__item" id="-6d5kro_64"><p id="-6d5kro_73">On the <a href="inspections-settings.html" id="-6d5kro_75">Inspections</a> page that opens, expand the <span class="menupath" id="-6d5kro_76">PHP | Quality Tools</span> node and select the checkbox next to <span class="control" id="-6d5kro_77">Laravel Pint validation</span>.</p><figure id="-6d5kro_74"><img alt="Select Laravel Pint validation checkbox" src="https://resources.jetbrains.com/help/img/idea/2024.3/laravel_pint_validation.png" class="article__bordered-element" title="Select Laravel Pint validation checkbox" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/laravel_pint_validation_dark.png" width="706" height="455"></figure></li><li class="list__item" id="-6d5kro_65"><p id="-6d5kro_79">On the right-hand pane of the page, configure how PhpStorm handles the Laravel Pint inspection output:</p><ol class="list _decimal" id="-6d5kro_80" type="1"><li class="list__item" id="-6d5kro_215"><p><span class="control" id="-6d5kro_218">Scope</span>: choose the <a href="configuring-scopes-and-file-colors.html" id="-6d5kro_219">scope</a> to limit the inspection application to.</p></li><li class="list__item" id="-6d5kro_216"><p><span class="control" id="-6d5kro_220">Severity</span>: choose the <a href="configuring-inspection-severities.html" id="-6d5kro_221">severity degree</a> for the inspection. The selected value determines how seriously the detected discrepancies will be treated by PhpStorm and presented in the <a href="running-inspections.html" id="-6d5kro_222">inspection results</a>.</p></li><li class="list__item" id="-6d5kro_217"><p><span class="control" id="-6d5kro_223">Highlighting in editor</span>: choose how the issues detected by the inspection are highlighted in the editor.</p></li></ol></li></ol><aside class="prompt" data-type="note" data-title="" id="-6d5kro_66"><p> You can also enable and disable the Laravel Pint validation inspection in the <span class="control" id="-6d5kro_227">Settings</span> dialog (<kbd id="-6d5kro_228" data-key="ShowSettings">Ctrl+Alt+S</kbd>) | <span class="control" id="-6d5kro_229">PHP</span> | <span class="control" id="-6d5kro_230">Quality Tools</span> by using the <span class="control" id="-6d5kro_231">ON/OFF</span> toggle in the <span class="control" id="-6d5kro_232">Laravel Pint</span> section, but note that this action is applied only to the <span class="control" id="-6d5kro_233">Project Default</span> inspection profile. </p></aside></section></section><section class="chapter"><h2 id="running-tool-in-batch-mode" data-toc="running-tool-in-batch-mode">Run Laravel Pint in batch mode</h2><section class="procedure-steps" id="-6d5kro_110"><ol class="list _decimal"><li class="list__item" id="-6d5kro_234"><p>In the main menu, go to <span class="menupath" id="-6d5kro_237">Code | Inspect code</span>.</p></li><li class="list__item" id="-6d5kro_235"><p id="-6d5kro_239">In the <span class="control" id="-6d5kro_241">Specify Inspection Scope</span> dialog that opens, select the inspection profile from the list, or click <span class="control" id="-6d5kro_242">Configure</span> to open the <a href="inspections-settings.html" id="-6d5kro_243">Inspections</a> dialog and configure a new profile.</p><p id="-6d5kro_240">You can also click <span class="control" id="-6d5kro_245">Configure</span> to check which fixes will be applied within the scope of the selected inspection profile, and make sure that the <span class="emphasis" id="-6d5kro_246">Laravel Pint validation</span> inspection is enabled.</p></li><li class="list__item" id="-6d5kro_236"><p>View the inspection results in the <a href="problems-tool-window.html" id="-6d5kro_248">Problems tool window</a>. Errors and warnings reported by Laravel Pint are prefixed with <code class="code" id="-6d5kro_250">Laravel Pint:</code> to distinguish them from PhpStorm internal inspections. </p><figure id="-6d5kro_251"><img alt="Laravel Pint inspection list" src="https://resources.jetbrains.com/help/img/idea/2024.3/laravel_pint_inspections_list.png" class="article__bordered-element" title="Laravel Pint inspection list" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/laravel_pint_inspections_list_dark.png" width="706" height="286"></figure></li></ol></section></section><section class="chapter"><h2 id="fixing-issues" data-toc="fixing-issues">Fix issues detected by Laravel Pint</h2><section class="procedure-steps"><h3 id="fix-issues-by-quickfix" data-toc="fix-issues-by-quickfix">Fix issues by using a quick-fix</h3><p id="-6d5kro_255">Upon detecting an issue, PhpStorm highlights it in accordance with the Laravel Pint <a href="#enabling-tool-inspection" id="-6d5kro_259">inspection settings</a>.</p><ol class="list _decimal"><li class="list__item" id="-6d5kro_256"><p>Place the caret at the detected issue and click <img src="https://resources.jetbrains.com/help/img/idea/2024.3/app.expui.codeInsight.intentionBulb.png" class="inline-icon-" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/app.expui.codeInsight.intentionBulb_dark.png" id="-6d5kro_260" title="the Intention action button" alt="the Intention action button" width="16" height="16">, or press <kbd id="-6d5kro_261" data-key="ShowIntentionActions">Alt+Enter</kbd>.</p></li><li class="list__item" id="-6d5kro_257"><p id="-6d5kro_262">Select <span class="control" id="-6d5kro_263">Laravel Pint: fix the whole file</span> from the popup menu. Note that this will fix all issues detected in the current file.</p></li></ol><p id="-6d5kro_258">You can also detect issues <a href="#running-tool-in-batch-mode" id="-6d5kro_264">in the batch mode</a>, or fix them automatically with <a href="#fix-issues-with-code-reformat" id="-6d5kro_265">code reformatting</a>.</p></section><section class="procedure-steps"><h3 id="fix-issues-with-code-reformat" data-toc="fix-issues-with-code-reformat">Fix issues with code reformatting</h3><p id="-6d5kro_270">You can fix issues detected by Laravel Pint by running the <a href="reformat-and-rearrange-code.html" id="-6d5kro_275" data-tooltip="PhpStorm lets you reformat your code according to the requirements you've specified in your current code style scheme or the .editorconfig file. If anything is not defined in .editorconfig, it is taken from the project settings. ">reformat code</a> action.</p><ol class="list _decimal"><li class="list__item" id="-6d5kro_271"><p id="-6d5kro_276">Set <span class="control" id="-6d5kro_280">Laravel Pint</span> as an external formatter in the <a href="php-quality-tools.html#external_formatters" id="-6d5kro_281">Quality Tools settings</a>.</p><p id="-6d5kro_277">To do so, in the <span class="control" id="-6d5kro_288">Settings</span> dialog (<kbd id="-6d5kro_289" data-key="ShowSettings">Ctrl+Alt+S</kbd>) go to <span class="menupath" id="-6d5kro_283">PHP | Quality Tools</span> and select <span class="control" id="-6d5kro_284">Laravel Pint</span> in the <span class="control" id="-6d5kro_285">External Formatters</span> section.</p><figure id="-6d5kro_278"><img alt="Select external formatter" src="https://resources.jetbrains.com/help/img/idea/2024.3/ps_select_external_formatter_laravel_pint.png" class="article__bordered-element" title="Select external formatter" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/ps_select_external_formatter_laravel_pint_dark.png" width="554" height="252"></figure><aside class="prompt" data-type="warning" data-title="" id="-6d5kro_279"><p>External formatters are no longer run during the <a href="resolving-problems.html#clean-up-code" id="-6d5kro_291">Code Cleanup</a> action.</p></aside></li><li class="list__item" id="-6d5kro_272"><p id="-6d5kro_292">Apply <span class="emphasis" id="-6d5kro_294">Reformat Code</span> to the required file or project scope:</p><ul class="list _bullet" id="-6d5kro_293"><li class="list__item" id="-6d5kro_295"><p>For a code fragment or a file opened in the editor, select <span class="menupath" id="-6d5kro_297">Code | Reformat Code</span> from the main menu or press <kbd id="-6d5kro_298" data-key="ReformatCode">Ctrl+Alt+L</kbd>.</p></li><li class="list__item" id="-6d5kro_296"><p>For a selected file, directory, or group of files in the <span class="control" id="-6d5kro_300">Project</span> tool window, select <span class="menupath" id="-6d5kro_301">Reformat Code</span> from the context menu or press <kbd id="-6d5kro_302" data-key="ReformatCode">Ctrl+Alt+L</kbd>.</p></li></ul></li></ol><aside class="prompt" data-type="tip" data-title="" id="enable-built-in-formatter"><p>When you reformat code with the external formatter enabled, PhpStorm's built鈥慽n formatter is disabled by default. To run the reformat code action with both the selected external formatter and the IDE's built-in formatter, go to <span class="menupath" id="-6d5kro_304">Settings</span> (<kbd id="-6d5kro_305" data-key="ShowSettings">Ctrl+Alt+S</kbd>) <span class="menupath" id="-6d5kro_306">|Advanced Settings</span> and select the <span class="menupath" id="-6d5kro_307"> Run built-in formatter before external formatter</span> checkbox in the <span class="menupath" id="-6d5kro_308">PHP</span> area.</p></aside><aside class="prompt" data-type="tip" data-title="" id="-6d5kro_274"><p>Laravel Pint is also run as an external formatter with <a href="reformat-and-rearrange-code.html#reformat-on-save" id="-6d5kro_310" data-tooltip="PhpStorm lets you reformat your code according to the requirements you've specified in your current code style scheme or the .editorconfig file. If anything is not defined in .editorconfig, it is taken from the project settings. ">reformat code on save</a> and <a href="commit-changes-dialog.html#before_commit" id="-6d5kro_311">reformat code before commit</a> actions.</p></aside></section></section><section class="chapter"><h2 id="sharing-custom-coding-style" data-toc="sharing-custom-coding-style">Share a custom coding style with the team</h2><section class="procedure-steps" id="-6d5kro_113"><ol class="list _decimal"><li class="list__item" id="-6d5kro_312"><p>Put the root directory of your coding standard under the <a href="creating-and-managing-projects.html#project_root" id="-6d5kro_317">project root</a>.</p></li><li class="list__item" id="-6d5kro_313"><p><a href="#enabling-tool-inspection" id="-6d5kro_318">Configure Laravel Pint as a PhpStorm inspection</a>.</p></li><li class="list__item" id="-6d5kro_314"><p>Appoint your coding standard.</p></li><li class="list__item" id="-6d5kro_315"><p>Make sure that a <span class="emphasis" id="-6d5kro_319">project profile</span> is selected at the top of the <a href="inspections-settings.html" id="-6d5kro_320">Inspections</a> page. Such profiles are saved in a particular project's <span class="filepath" id="-6d5kro_321">.idea</span> directory (for example, <span class="filepath" id="-6d5kro_322">$PROJECT_DIR$/.idea/inspectionProfiles</span>). For more information, refer to <a href="customizing-profiles.html" id="-6d5kro_323">Configure profiles</a>.</p></li><li class="list__item" id="-6d5kro_316"><p>On the <a href="settings-version-control.html" id="-6d5kro_324">Version Control</a> page of the <span class="control" id="-6d5kro_325">Settings</span> dialog, make sure that the <span class="filepath" id="-6d5kro_326">.idea</span> directory is put <a href="enabling-version-control.html#associate_directory_with_VCS" id="-6d5kro_327">under version control</a>.</p></li></ol></section></section><section class="chapter"><h2 id="excluding-files-from-inspection" data-toc="excluding-files-from-inspection">Exclude files from Laravel Pint inspection</h2><p id="-6d5kro_118">When waiting for Laravel Pint response exceeds the limit specified in the <span class="control" id="-6d5kro_328">Tool process timeout</span> field in the <span class="control" id="-6d5kro_329">Laravel Pint</span> dialog, PhpStorm suggests adding the file to the <span class="emphasis" id="-6d5kro_330">ignore list</span>.</p><section class="procedure-steps" id="-6d5kro_119"><ol class="list _decimal"><li class="list__item" id="-6d5kro_331"><p id="-6d5kro_333"> In the <span class="control" id="-6d5kro_338">Settings</span> dialog (<kbd id="-6d5kro_339" data-key="ShowSettings">Ctrl+Alt+S</kbd>) , navigate to <span class="menupath" id="-6d5kro_335">PHP | Quality Tools | Laravel Pint</span>.</p></li><li class="list__item" id="-6d5kro_332"><p id="-6d5kro_340">Click the <span class="control" id="-6d5kro_342">Show ignored files</span> link.</p><ul class="list _bullet" id="-6d5kro_341"><li class="list__item" id="-6d5kro_343"><p>To add a file, click <img src="https://resources.jetbrains.com/help/img/idea/2024.3/app.expui.general.add.svg" class="inline-icon-" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/app.expui.general.add_dark.svg" id="-6d5kro_346" title="the Add button" alt="the Add button" width="16" height="16"> and locate the desired file in the dialog that opens.</p></li><li class="list__item" id="-6d5kro_344"><p>To delete a file from the list and have Laravel Pint process it again, select the file and click <img src="https://resources.jetbrains.com/help/img/idea/2024.3/app.expui.general.remove.svg" class="inline-icon-" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/app.expui.general.remove_dark.svg" id="-6d5kro_347" title="the Remove button" alt="the Remove button" width="16" height="16">.</p></li><li class="list__item" id="-6d5kro_345"><p>To remove all the files from the list, click <img src="https://resources.jetbrains.com/help/img/idea/2024.3/app.expui.general.closeSmall.svg" class="inline-icon-" data-dark-src="https://resources.jetbrains.com/help/img/idea/2024.3/app.expui.general.closeSmall_dark.svg" id="-6d5kro_348" title="the Close button" alt="the Close button" width="16" height="16">.</p></li></ul></li></ol></section></section><div class="last-modified">Last modified: 22 January 2025</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"><a href="using-php-cs-fixer.html" class="navigation-links__prev">PHP CS Fixer</a><a href="using-php-mess-detector.html" class="navigation-links__next">PHP Mess Detector</a></div></article><div id="disqus_thread"></div></div></section></main></div><script src="https://resources.jetbrains.com/storage/help-app/v6/app.js"></script></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10