![見出し画像](https://assets.st-note.com/production/uploads/images/75765431/rectangle_large_type_2_d4bf4e1c55d29a4ff91075316ffaf753.png?width=800)
PHPStorm For Laravel 設定してみた
ユニラボでは最近有償エディタのライセンスを会社負担で購入できる制度ができまして早速申請して初期設定をしてみました。
元々VScodeで開発していたのですが、こういう機会がないと新しいエディタに触れる機会がないのとさらに開発効率が上がることを期待して乗り換えてみました!
PHPStorm設定
1. 日本語化
https://plugins.jetbrains.com/plugin/13964-japanese-language-pack------
2. Rainbow Brackets
https://plugins.jetbrains.com/plugin/10080-rainbow-brackets
3. Laravel
https://plugins.jetbrains.com/plugin/7532-laravel
4. Blade
https://plugins.jetbrains.com/plugin/7569-blade/
5. deep-assoc-completion
https://plugins.jetbrains.com/plugin/9927-deep-assoc-completion
6. yaml-ansible-support
https://plugins.jetbrains.com/plugin/7792-yaml-ansible-support
7. Vue.js
https://plugins.jetbrains.com/plugin/9442-vue-js
8 laravel-ide-helper
https://qiita.com/mejileben/items/a01f03d203ead8cb7081
root@4beebc84e1f9:/var/www# php artisan clear-compiled
Compiled services and packages files removed!
root@4beebc84e1f9:/var/www# php artisan ide-helper:generate
A new helper file was written to _ide_helper.php
root@4beebc84e1f9:/var/www# php artisan ide-helper:meta
A new meta file was written to .phpstorm.meta.php
root@4beebc84e1f9:/var/www# php artisan ide-helper:model
Do you want to overwrite the existing model files? Choose no to write to _ide_helper_models.php instead (yes/no) [no]:
> no
9. PHP8.0に変更
![スクリーンショット 2021-06-15 9.48.23](https://assets.st-note.com/production/uploads/images/54634831/picture_pc_1c24691d1d45cf98e3c1c007268e1de9.png?width=800)
10. コード整形
shit + option + command + l 同時押し
> https://www.jetbrains.com/help/phpstorm/2021.1/reformat-file-dialog.html
11. php_codesniffer
11-1 . mac に composer install
11-2. mac に php_codesniffer install
user@UL-PC-IA ~ % brew install composer
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
elfutils slides
==> Updated Formulae
Updated 194 formulae.
==> Downloading https://getcomposer.org/download/2.1.3/composer.phar
######################################################################## 100.0%
🍺 /usr/local/Cellar/composer/2.1.3: 3 files, 2.2MB, built in 4 seconds
user@UL-PC-IA ~ % composer global require "squizlabs/php_codesniffer=*"
zsh: command not found: composer
user@UL-PC-IA ~ % brew install composer
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
elfutils slides
==> Updated Formulae
Updated 194 formulae.
==> Downloading https://getcomposer.org/download/2.1.3/composer.phar
######################################################################## 100.0%
🍺 /usr/local/Cellar/composer/2.1.3: 3 files, 2.2MB, built in 4 seconds
user@UL-PC-IA ~ % composer global require "squizlabs/php_codesniffer=*"
Changed current directory to /Users/user/.composer
./composer.json has been created
Running composer update squizlabs/php_codesniffer
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking squizlabs/php_codesniffer (3.6.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Downloading squizlabs/php_codesniffer (3.6.0)
- Installing squizlabs/php_codesniffer (3.6.0): Extracting archive
Generating autoload files
11-3. PHP_CodeSniffer 設定
![スクリーンショット 2021-06-15 9.52.13](https://assets.st-note.com/production/uploads/images/54634999/picture_pc_7f3964bc46182057864883b9691cd1a6.png?width=800)
12. ファイル末尾に改行を挿入する
![スクリーンショット 2021-06-15 9.52.51](https://assets.st-note.com/production/uploads/images/54635019/picture_pc_5e40c31c0713397663ddcb3dba8a6f52.png?width=800)
13. 空白行を表示する
![スクリーンショット 2021-06-15 9.53.15](https://assets.st-note.com/production/uploads/images/54635037/picture_pc_76377429b92d4df8e1240d47246194f5.png?width=800)
【宣伝】ユニラボ に興味がある方へ
エンジニア採用情報 までお待ちしています!
![スクリーンショット 2021-06-15 9.59.32](https://assets.st-note.com/production/uploads/images/54635348/picture_pc_caf10167c716402ed5354f9ecfbe0d1b.png?width=800)
この記事が気に入ったらサポートをしてみませんか?