Browse all series

PhpStorm for Laravel Developers

Finding the right IDE that fits your coding workflow and requirements can often be frustrating. Many editors come close but stumble near the finish line. After years of searching, however, PhpStorm is the first editor that somehow manages to tick every requirement of mine. It's fast, feature-rich, incredibly customizable, and the new UI is gorgeous.

In this series, I hope you'll come along as I demonstrate, one episode at a time, my complete Laravel and PhpStorm workflow (including the incredible Laravel Idea plugin). So buckle up, there's a lot to cover!

Progress

Series Info

Episodes
18
Run Time
2h 35m
Difficulty
Intermediate
Last Updated
Jun 21, 2023
Version
Latest

Series Episodes

  1. Getting Started (7)
    1. Hello, PhpStorm

      In this opening episode, I will introduce PhpStorm as a powerful code editor that solves countless common frustrations and enhances workflow. With features like debugging capabilities, integration with popular tools, dynamic code snippets, and seamless testing, PhpStorm ticks every box and requirement of mine.
    2. Customize PhpStorm for Your Perfect Workflow

      Let's get started by exploring the PhpStorm IDE and learning how to customize its appearance and settings to suit our preferences. We'll cover topics such as adjusting the sidebar width, choosing fonts and color schemes, installing plugins, hiding unnecessary toolbars, and even hiding tabs and line numbers for a minimalist interface. By the end of the lesson, you will have a personalized PhpStorm setup that matches your personal coding style.
    3. The Laravel Idea Plugin is a Must

      Next up, we'll install what I consider to be an essential PhpStorm plugin: Laravel Idea. This plugin provides various features and enhancements specifically for Laravel developers. It offers code generation, completion for Eloquent and routing, and countless other useful productivity enhancements.
    4. Get Around in PhpStorm Quickly

      Let's review some various ways to navigate and search for files, classes, and symbols in PhpStorm. Additionally, we'll setup keyboard shortcuts like Command-P to search everywhere, Command-E to visit recent files, and Command-Up to access a floating tree view for quick navigation. We can also filter tree views and create new files directly within a specific directory.
    5. Automatically Format Code (Including Pint)

      In this lesson, I discuss various options available in PhpStorm for auto-formatting code, such as configuring file visibility in the sidebar, opening files with a single click, and enabling code reformatting on save. I also demonstrate how to use PhpStorm's code cleanup feature and set up a file watcher to run Laravel Pint for code formatting. These features can greatly improve code consistency and productivity for Laravel developers.
    6. PHP Class Generators

      In this lesson, we explore code generation using Laravel in PhpStorm. We learn how to generate code for models, migrations, factories, controllers, and form requests using the Laravel plugin. The lesson also covers generating standard PHP classes, constructors, getters, and setters using PhpStorm's code generation features.
    7. Laravel Idea = Speed

      In this lesson, we learn about using the Laravel Idea plugin to speed up common tasks in Laravel. We see how to create relationships between models using shortcuts and snippets, making the process faster and more efficient.
  2. Refactoring (4)
    1. Extract Method

      In this lesson, we explore the refactoring capabilities of PhpStorm using a Laracasts-specific class called AIChat. We learn how to extract methods and use keyboard shortcuts to quickly refactor code, improving readability and efficiency. The lesson covers extracting methods for writing messages and sending API requests, as well as chaining methods for a more concise code structure.
    2. Extract, Inline, and Rename Variables

      In this lesson, we learn how to navigate through code using PhpStorm's refactoring capabilities. We explore options such as viewing the structure of a file, searching for symbols, and using shortcuts to quickly navigate to specific methods. Additionally, we learn how to extract variables and inline them, as well as rename variables and update all occurrences automatically.
    3. Introduce Field

      In this lesson, we learn how to introduce a field and generate a getter using the refactor menu in Laravel. We also explore the option of using the illuminate support array to easily retrieve the last item from an array.
    4. Extract Class and "Pull Up"

      In this lesson, we learn how to refactor code to eliminate duplication and improve code organization. We extract a class and pull up common methods and properties to a parent class. We also make use of constants and abstract methods to provide default implementations that can be overridden when necessary. The lesson concludes with an overview of phpStorm's refactoring capabilities.
  3. Digging Deeper (7)
    1. 5 Essential Laravel Idea Features

      In this lesson, we'll review five Laravel Idea features that will rapidly speed up your workflow. These features include generating helper code to make Laravel's magical features understandable, auto-completion for various code elements, generating code for different components and resources, and auto-completion for fillable fields in models. These features improve productivity and make development more efficient.
    2. Multiple Cursors

      In this lesson, I demonstrate how to use multiple cursors in PhpStorm. Multiple cursors allow you to make changes to multiple instances of a word or selection simultaneously, saving time and effort. I show examples of using multiple cursors to swap visibility, rename variables, and populate HTML elements.
    3. Live Templates

      In this lesson, I demonstrate how to use live templates in PhpStorm to quickly generate code snippets. I show how to create templates for importing a CDN version of Tailwind CSS and scaffolding basic test structures in Laravel using PEST. I also explain how to use dynamic tab stops and expressions within live templates.
    4. Tailwind Integration With Automatic Class Sorting

      In this lesson, we will learn how to integrate Tailwind CSS into our editor workflow and use Prettier to automatically sort utility classes. We will install Tailwind, configure it in our project, and then set up Prettier to sort the classes whenever we save our files. This will save us time and ensure consistent class ordering in our CSS.
    5. AI-Powered Code Assistance with Copilot

      In this lesson, we explore the use of the Copilot tool from GitHub, which leverages OpenAI to provide real-time code suggestions and auto-completion within JetBrains projects. We learn how to install and use Copilot in PhpStorm, and see examples of how it can assist with tasks such as generating code, writing tests, and providing suggestions for code completion. While it may not always provide the exact desired output, Copilot proves to be a valuable tool for saving time and enhancing productivity in coding.
    6. Testing Workflow

      In this lesson, we will focus on testing workflows within PHPStorm using Laravel. The instructor demonstrates how to run tests, rerun failed tests, and make changes to test implementations. They also show how to leverage PHPStorm features like shortcuts and plugins to enhance the testing process.
    7. Debugging With Xdebug

      In this lesson, we will learn how to set up and use Xdebug for debugging PHP applications. We will cover the installation process, configuring php.ini, setting breakpoints, and using the debugger to inspect variables and step through code. Xdebug is a powerful tool that can greatly enhance your debugging workflow.

Continue Learning