Get a special 50% OFF discount on the plugin for new PhpStorm users

Laravel Idea 5.0: Laravel 9 support, convenient Laravel files creation, spatie packages support, and much more

Jan, 27, 2022

The new major Laravel Idea update was released a bit before Laravel 9 release. We prepared everything to support it and added some significant features.

A new Laravel item in the New menu will help to quickly create Laravel classes in a case when usual Code generations aren't available:

New menu

This list is configurable in the Laravel Idea settings: Code generations section.

A new Route::controller() method was introduced in the Laravel 8.80 and now has full support in the Laravel Idea:

Route controller call

We added support for popular spatie/laravel-query-builder package. Relation and field completions for all "allowed*" method calls:

spatie/laravel-query-builder support

As well as completions for some rules from spatie/laravel-validation-rules package.

Convenient completions for Blade pair directives like @if/@endif, @foreach/@endforeach, and others:

Pair Blade directives completions

We removed the @class directive in one of the previous updates, but the PhpStorm team fixed the bug (it was hiding the "class" HTML attribute completion), so we returned it!

@class directive

An updated ide.json files support will help package developers set up some completion specific to their packages. For example, a small ide.json file with this content placed somewhere in the package source:

{
    "$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
    "completions": [
        {
            "complete": "routeName",
            "condition": [
                {
                    "classNames": ["PackageFacade"],
                    "methods": ["routeForTenant"],
                    "parameters": [1]
                }
            ]
        }
    ],
    "blade": {
        "directives": [
            {
                "name": "routeForTenant",
                "prefix": "<?php echo PackageFacade::routeForTenant(",
                "suffix": "); ?>"
            }
        ]
    }
}
            
Will allow package users to have completion not only for routeForTenant method:

ide.json method completion

But for @routeForTenant Blade directive and its parameter:

ide.json method completion

We are preparing complete documentation for ide.json files right now.

Small features:
  • Support for a new Eloquent attributes style (Laravel 8.77).
  • Support for Livewire ".index" components
  • Laravel Idea's helper code moved out from Project files, so it won't pollute the Class search.
  • Improved package fetching for projects with the removed composer.lock file - composer lock option
  • Completions for Eloquent methods: whereFullText, orWhereFullText, getOriginalWithoutRewindingModel, originalIsEquivalent, getRawOriginal, syncOriginalAttribute, syncOriginalAttributes
  • Other completions and a lot of fixes.

Thank you for keeping up with the last updates! We hope they will improve your productivity.
Laravel Idea team.