nasirkhan/laravel-starter
Laravel 13 modular starter with separated frontend/backend. Includes auth & authorization, user/role management, admin backend, backups, log viewer, and custom artisan commands (install, update, module builder). Use as a base to build reusable modules.
Last Updated: February 3, 2026
This guide explains how to use IDE helper files for better code completion and type hinting in your IDE.
Laravel Starter includes Laravel IDE Helper to improve the development experience with better autocomplete, type hinting, and code navigation in popular IDEs.
Three helper files are automatically generated:
_ide_helper.phpContains PHPDoc definitions for Laravel facades and helper functions.
/**
* [@see](https://github.com/see) \Illuminate\Support\Facades\Route
*/
class Route extends \Illuminate\Support\Facades\Route {}
_ide_helper_models.phpContains PHPDoc blocks for Eloquent models with properties and relationships.
/**
* App\Models\User
*
* [@property](https://github.com/property) int $id
* [@property](https://github.com/property) string $name
* [@property](https://github.com/property) string $email
* [@property](https://github.com/property) \Illuminate\Support\Carbon $created_at
* [@property](https://github.com/property) \Illuminate\Support\Carbon $updated_at
* [@method](https://github.com/method) static \Illuminate\Database\Eloquent\Builder|User whereEmail($value)
*/
class User extends \Eloquent {}
.phpstorm.meta.phpPhpStorm-specific metadata for better code completion.
IDE helper files are automatically generated:
composer update:composer update
# Automatically runs: ide-helper:generate and ide-helper:meta
# Generate all helper files
composer ide-helper
# Or individually:
php artisan ide-helper:generate # Facades
php artisan ide-helper:models -N # Models (no interaction)
php artisan ide-helper:meta # PhpStorm meta
Regenerate helper files when you:
When you create or modify models:
# Regenerate model helpers
php artisan ide-helper:models -N
Without -N flag (interactive mode):
php artisan ide-helper:models
# Asks: Do you want to overwrite the existing model files?
When you add packages with facades:
composer update
# Automatically regenerates facades helper
Or manually:
php artisan ide-helper:generate
Already Configured! No additional setup needed.
The .phpstorm.meta.php file is automatically recognized.
To reduce indexing time:
_ide_helper.php_ide_helper_models.phpInstall the recommended extensions:
code --install-extension bmewburn.vscode-intelephense-client
code --install-extension amiralizadeh9480.laravel-extra-intellisense
VS Code will automatically use the _ide_helper.php file for type hinting.
Install LSP-intelephense package:
Solution 1: Regenerate files
composer ide-helper
Solution 2: Clear IDE cache
Problem: Added new properties but autocomplete doesn't show them.
Solution:
php artisan ide-helper:models -N
Problem: Getting duplicate autocomplete suggestions.
Solution: Make sure helper files are excluded from indexing or marked as plain text in your IDE.
Problem: Helper files accidentally committed.
Solution:
# Remove from Git but keep locally
git rm --cached _ide_helper.php
git rm --cached _ide_helper_models.php
git rm --cached .phpstorm.meta.php
# Verify .gitignore includes:
# _ide_helper.php
# _ide_helper_models.php
# .phpstorm.meta.php
Problem: php artisan ide-helper:models runs out of memory.
Solution:
# Increase memory limit
php -d memory_limit=512M artisan ide-helper:models -N
To customize IDE helper behavior:
php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config
Edit config/ide-helper.php to customize:
return [
// Write annotations to model files instead of _ide_helper_models.php
'write_model_magic_where' => true,
// Include fluent methods in model helper
'include_fluent' => true,
// Custom model directories
'model_locations' => [
'app/Models',
'app/Modules/*/Models',
],
];
Add to your CI pipeline to ensure helpers are up-to-date:
# .github/workflows/tests.yml
- name: Generate IDE Helpers
run: |
composer ide-helper
git diff --exit-code _ide_helper.php
composer install
# Helpers regenerate automatically
php artisan make:model MyModel -m
php artisan ide-helper:models -N
# Ensure helpers are in .gitignore
git status
# Should NOT show helper files
Add to README.md:
## IDE Setup
After cloning, run:
```bash
composer install
composer ide-helper
For PhpStorm users, enable Laravel plugin:
---
## Resources
### Official Documentation
- [Laravel IDE Helper GitHub](https://github.com/barryvdh/laravel-ide-helper)
- [Laravel IDE Helper Configuration](https://github.com/barryvdh/laravel-ide-helper#configuration)
### IDE-Specific Guides
- [PhpStorm Laravel Plugin](https://plugins.jetbrains.com/plugin/7532-laravel)
- [VS Code PHP Intelephense](https://intelephense.com/)
- [Sublime Text LSP Setup](https://lsp.sublimetext.io/)
---
*This document is part of Laravel Starter. For issues or suggestions, please open an issue on GitHub.*
How can I help you explore Laravel packages today?