Categories
Fixing Stuff Laravel Php Storm Samuel

Fixing Laravel Valet Error

Sooooo we needed to jump our local environment from PHP 7.4 to PHP 8.1 in order to work on a different project.

We started by running the command:

Valet use php@8.1

That provided the following error:

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.27. in /Users/sam/.composer/vendor/composer/platform_check.php on line 25

To fix this issue we ran:

brew link php

This command resulted in:

brew link php
Unlinking /usr/local/Cellar/php@7.4/7.4.27.reinstall... 25 symlinks removed.
Linking /usr/local/Cellar/php/8.1.2.reinstall... 24 symlinks created.

From there we could run “valet use php 8.2” and our new project was happy. This post was also super helpful, it provides solutions for a few other versions oh PHP so if anyone else out there is stuck you can try the link below:

https://dev.to/arielmejiadev/switch-to-older-php-versions-with-laravel-valet-33ph

Categories
Php Storm Samuel

Helpful PHPStorm Shortcuts

Running List of useful PHPStorm Keyboard Shortcuts

  • Shift + Shift will out up a dialog box that will search the entire project
  • shift + Delete removes an entire line
  • Control + K allows you to commit changes to the repo straight from PHPStorm
  • Shift + Shift then type annotation into the search box, will show full version history of the file you are currently in
  • Alt + Enter will add any missing classes to your current file automatically, very useful when updating a controller file in Laravel
  • Control + Alt + Z will revert a single line to the previous version, very useful when updating versions of Laravel
  • Control + Alt + Shift + J will select all occurrences in a section. Very useful when bulk re-naming or replacing items
  • Control + G will allow you to type an exact line to navigate to. Very useful when navigating to an exact location in a CSS file
  • To mass remove white space Hold down Control + Shift + J until all of the code is on one single line. Then press Control + Alt + L and that will put the indentation back and everything will be grouped nicely without any whitespace