Skip to content

PhpStorm

Comprehensive PhpStorm shortcuts and workflows for PHP development with Laravel, Symfony, WordPress, and database management.

General Shortcuts

Windows/LinuxmacOSDescription
Ctrl+Shift+ACmd+Shift+AFind Action
Ctrl+Shift+NCmd+Shift+OGo to File
Ctrl+NCmd+OGo to Class
Ctrl+Shift+Alt+NCmd+Option+OGo to Symbol
Ctrl+ECmd+ERecent Files
Ctrl+Shift+ECmd+Shift+ERecent Locations
Ctrl+GCmd+LGo to Line
Ctrl+F12Cmd+F12File Structure
Alt+F1Option+F1Select In
Windows/LinuxmacOSDescription
Ctrl+BCmd+BGo to Declaration
Ctrl+Alt+BCmd+Option+BGo to Implementation
Ctrl+Shift+BCmd+Shift+BGo to Type Declaration
Ctrl+UCmd+UGo to Super Method
Alt+F7Option+F7Find Usages
Ctrl+F7Cmd+F7Find Usages in File
Ctrl+Shift+F7Cmd+Shift+F7Highlight Usages
Ctrl+Alt+F7Cmd+Option+F7Show Usages
Ctrl+ClickCmd+ClickGo to Declaration

Editing

Windows/LinuxmacOSDescription
Ctrl+SpaceCtrl+SpaceBasic Code Completion
Ctrl+Shift+SpaceCtrl+Shift+SpaceSmart Code Completion
Ctrl+Alt+SpaceCtrl+Option+SpaceClass Name Completion
Ctrl+Shift+EnterCmd+Shift+EnterComplete Current Statement
Ctrl+PCmd+PParameter Info
Ctrl+QCtrl+JQuick Documentation
Shift+F1Shift+F1External Documentation
Ctrl+F1Cmd+F1Show Error Description
Alt+InsertCmd+NGenerate Code
Ctrl+OCtrl+OOverride Methods
Ctrl+ICtrl+IImplement Methods

Code Formatting

Windows/LinuxmacOSDescription
Ctrl+Alt+LCmd+Option+LReformat Code
Ctrl+Alt+OCtrl+Option+OOptimize Imports
Ctrl+Alt+ICtrl+Option+IAuto-Indent Lines
TabTabIndent Selection
Shift+TabShift+TabUnindent Selection
Ctrl+Alt+TCmd+Option+TSurround With
Ctrl+/Cmd+/Comment/Uncomment Line
Ctrl+Shift+/Cmd+Shift+/Comment/Uncomment Block

Refactoring

Windows/LinuxmacOSDescription
F5F5Copy
F6F6Move
Shift+F6Shift+F6Rename
Ctrl+F6Cmd+F6Change Signature
Ctrl+Alt+NCmd+Option+NInline
Ctrl+Alt+MCmd+Option+MExtract Method
Ctrl+Alt+VCmd+Option+VExtract Variable
Ctrl+Alt+FCmd+Option+FExtract Field
Ctrl+Alt+CCmd+Option+CExtract Constant
Ctrl+Alt+PCmd+Option+PExtract Parameter

Running and Debugging

Windows/LinuxmacOSDescription
Shift+F10Ctrl+RRun
Shift+F9Ctrl+DDebug
Ctrl+Shift+F10Ctrl+Shift+RRun Context Configuration
Ctrl+Shift+F9Ctrl+Shift+DDebug Context Configuration
F8F8Step Over
F7F7Step Into
Shift+F7Shift+F7Smart Step Into
Shift+F8Shift+F8Step Out
Alt+F9Option+F9Run to Cursor
Alt+F8Option+F8Evaluate Expression

PHP-Specific Features

Windows/LinuxmacOSDescription
Ctrl+Shift+F10Ctrl+Shift+RRun PHP Script
Alt+Shift+F10Option+Shift+RRun PHP Web Page
Ctrl+Alt+SCmd+,Open Settings
Ctrl+Alt+Shift+SCmd+;Project Structure
Ctrl+Shift+ACmd+Shift+AFind Action

Laravel Development

Windows/LinuxmacOSDescription
Ctrl+Alt+RCmd+Option+RArtisan Commands
Ctrl+Shift+XCmd+Shift+XRun Artisan Command
Ctrl+Alt+GCmd+Option+GTinker Console
php + Tabphp + TabPHP Tag
class + Tabclass + TabClass Template
function + Tabfunction + TabFunction Template

Symfony Development

Windows/LinuxmacOSDescription
Ctrl+Alt+RCmd+Option+RSymfony Console
Ctrl+Shift+XCmd+Shift+XRun Symfony Command
route + Tabroute + TabRoute Annotation
controller + Tabcontroller + TabController Template

Database Tools

Windows/LinuxmacOSDescription
Ctrl+Alt+Shift+LCmd+Option+Shift+LReformat SQL
Ctrl+EnterCmd+EnterExecute Query
Ctrl+Shift+EnterCmd+Shift+EnterExecute Query (New Tab)
F4F4Edit Source
F5F5Refresh
Ctrl+NCmd+NNew Query Console

Composer Integration

Windows/LinuxmacOSDescription
Ctrl+Alt+Shift+UCmd+Option+Shift+UUpdate Dependencies
Ctrl+Alt+Shift+ICmd+Option+Shift+IInstall Dependencies
Ctrl+Shift+ACmd+Shift+AComposer Commands

Testing (PHPUnit)

Windows/LinuxmacOSDescription
Ctrl+Shift+F10Ctrl+Shift+RRun Test
Ctrl+Shift+F9Ctrl+Shift+DDebug Test
Alt+Shift+F10Option+Shift+RRun All Tests
Ctrl+Alt+F6Cmd+Option+F6Run Failed Tests

Version Control (Git)

Windows/LinuxmacOSDescription
Ctrl+KCmd+KCommit
Ctrl+Shift+KCmd+Shift+KPush
Ctrl+TCmd+TUpdate Project
Alt+9Cmd+9Version Control Tool Window
Ctrl+Alt+ZCmd+Option+ZRollback

Search and Replace

Windows/LinuxmacOSDescription
Ctrl+FCmd+FFind
F3Cmd+GFind Next
Shift+F3Cmd+Shift+GFind Previous
Ctrl+RCmd+RReplace
Ctrl+Shift+FCmd+Shift+FFind in Path
Ctrl+Shift+RCmd+Shift+RReplace in Path

Tool Windows

Windows/LinuxmacOSDescription
Alt+1Cmd+1Project Tool Window
Alt+2Cmd+2Favorites
Alt+3Cmd+3Find Tool Window
Alt+4Cmd+4Run Tool Window
Alt+5Cmd+5Debug Tool Window
Alt+6Cmd+6TODO Tool Window
Alt+7Cmd+7Structure Tool Window
Alt+8Cmd+8Services Tool Window
Alt+9Cmd+9Version Control
Alt+0Cmd+0Messages Tool Window

Best Practices

Project Setup

  1. Configure PHP Interpreter: File → Settings → Languages & Frameworks → PHP
  2. Enable Composer: File → Settings → Languages & Frameworks → PHP → Composer
  3. Set Code Style: File → Settings → Editor → Code Style → PHP

Laravel Development

  1. Install Laravel Plugin: File → Settings → Plugins → Laravel
  2. Configure Laravel: File → Settings → Languages & Frameworks → PHP → Laravel
  3. Enable Blade: File → Settings → Languages & Frameworks → PHP → Blade

Database Integration

  1. Add Data Source: Database tool window → + → Data Source
  2. Configure Connection: Set host, port, database, credentials
  3. Test Connection: Verify database connectivity

Debugging Setup

  1. Install Xdebug: Configure Xdebug in PHP installation
  2. Configure PhpStorm: File → Settings → Languages & Frameworks → PHP → Debug
  3. Set Breakpoints: Click in gutter or Ctrl+F8