Search by

lara-igniter / laraigniter-ide-helper

giorgosstab

IDE Helper for Laraigniter — generates PHPDoc and PhpStorm meta files for better autocomplete.

Package info

github.com/lara-igniter/laraigniter-ide-helper

pkg:composer/lara-igniter/laraigniter-ide-helper

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-09-10 13:42 UTC

This package is auto-updated.

Last update: 2026-09-10 13:44:32 UTC


README

Generates IDE helper files for Laraigniter applications — PHPDoc for facades and models, plus PhpStorm .phpstorm.meta.php metadata for autocomplete on view(), route(), config(), and env().

Requires lara-igniter/framework ^1.51.

Installation

composer require --dev lara-igniter/laraigniter-ide-helper

Register the provider in config/hooks.php when package discovery is disabled:

Laraigniter\IdeHelper\IdeHelperServiceProvider::class,

Publish config (optional):

php artisan vendor:publish --tag=ide-helper-config

Local checkout (path repository)

"repositories": [
    {
        "type": "path",
        "url": "../packages/laraigniter/laraigniter-ide-helper",
        "options": { "symlink": true }
    }
],
"require-dev": {
    "lara-igniter/laraigniter-ide-helper": "@dev"
}
composer update lara-igniter/laraigniter-ide-helper

Usage

Automatic PHPDoc generation for Laraigniter Facades

You can re-generate facade docs yourself whenever facades or their underlying services change:

php artisan ide-helper:generate

This writes _ide_helper.php in your project root. Your IDE parses that file for autocomplete — it is not loaded by the application. Change the output name via the filename key in config/ide-helper.php, or pass --filename=custom.php on the command line.

Include framework helper functions in the output (optional):

php artisan ide-helper:generate --helpers

Or set include_helpers to true in the config (equivalent to always passing --helpers).

Run generation automatically after every composer update by adding scripts to your app's composer.json:

"scripts": {
    "post-update-cmd": [
        "@php artisan ide-helper:generate",
        "@php artisan ide-helper:meta"
    ]
}

Publish the config file to customize facade aliases, output paths, or helper defaults:

php artisan vendor:publish --tag=ide-helper-config

This copies config/ide-helper.php into your application. Edit the published file — your values override the package defaults.

Commands

Command Output Description
php artisan ide-helper:generate _ide_helper.php Facade PHPDoc stubs
php artisan ide-helper:models _ide_helper_models.php Model @property / @property-read docs
php artisan ide-helper:meta .phpstorm.meta.php PhpStorm meta for helpers and facades

Options

generate

php artisan ide-helper:generate
php artisan ide-helper:generate --filename=custom.php
php artisan ide-helper:generate --helpers

models

php artisan ide-helper:models
php artisan ide-helper:models --write
php artisan ide-helper:models --model=App\\Models\\User
php artisan ide-helper:models --filename=custom_models.php

Builds annotations from $fillable, $casts, and $hasOne / $hasMany / $hasManyPivot on Elegant\Database\Model\Model subclasses.

meta

php artisan ide-helper:meta
php artisan ide-helper:meta --filename=.phpstorm.meta.php

Generated files

These files are for the IDE only — do not include them in runtime code.

File Purpose
_ide_helper.php Facade method stubs
_ide_helper_models.php Model property and relation hints
.phpstorm.meta.php View, route, config, and env autocomplete

Regenerate after changing models, routes, views, or facades.

Configuration

Defaults: config/ide-helper.php in this package. Override by publishing to your app's config/ide-helper.php.

Key Default Description
filename _ide_helper.php Facade helper path
models_filename _ide_helper_models.php Model helper path
meta_filename .phpstorm.meta.php Meta file path
model_locations [app/Models] Model scan directories (set at boot)
ignored_models base Model class Excluded models
model_namespace App\Models\ Namespace for short relation names
facades Blade, Gate, Route, View, … Facade map for generate
read_facades_from_hooks true Merge aliases from config/hooks.php
include_helpers false Embed helper files in output
type_overrides integerint, etc. Cast to PHPDoc type map
user_model App\Models\User User model class

Requirements

  • PHP ^7.4
  • lara-igniter/framework ^1.51
  • Laraigniter CLI (php artisan)

License

MIT — see LICENSE.md.