- Notifications
You must be signed in to change notification settings - Fork31
Generating a helper file for IDEs to support Laravel's macros, as a supplementary to barryvdh's Laravel Ide Helper.
License
KristofMorva/laravel-ide-macros
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Warning
This repository is archived because I'm unable to maintain it, as I'm not a web developer anymore and forgot most of this stuff.
Please use an existing fork, or create your own with your changes.
Sorry about this, have fun working on whatever you're currently building :)
It is advised to be used withLaravel IDE Helper, which generates helper files for your IDE, so it'll be able to highlight and understand some Laravel-specific syntax.This package provides an additional IDE helper file for Laravel macros with the syntax you are already used to in Laravel IDE Helper.
Just require it in your Composer file, and you are good to go:
"tutorigo/laravel-ide-macros": "*"If you are using Laravel 5.4 or lower, you must register theIdeMacrosServiceProvider manually.
Run the following command to publish the configuration file toconfig/ide-macros.php:
php artisan vendor:publish --provider="Tutorigo\LaravelMacroHelper\IdeMacrosServiceProvider"Run the following command to generate the macro IDE helpers:
php artisan ide-helper:macrosMacros can be both static (ie.Route::sth()) and non-static (ie.Request::route()->sth()). To distinct the two, use the@instantiated tag in the PHPDoc of macros, which depend on$this, for example:
/** * Gets the amount of route parameters * * @return array * @instantiated */\Illuminate\Routing\Route::macro('parameterCount', function () { /** @var \Illuminate\Routing\Route $this */ return count($this->parameters);});About
Generating a helper file for IDEs to support Laravel's macros, as a supplementary to barryvdh's Laravel Ide Helper.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors13
Uh oh!
There was an error while loading.Please reload this page.