barryvdh / laravel-ide-helper

IDE Helper for Laravel
MIT License
14.22k stars 1.16k forks source link

IDE Helper for Laravel packages #1256

Open maicol07 opened 3 years ago

maicol07 commented 3 years ago

Summary

Add a way to use the IDE helper with Laravel Packages, that doesn't have the artisan file. Maybe add an option to link the package to a Laravel project

Stevemoretz commented 3 years ago

You can add their aliases in config/app.php for facades, but for the rest I don't think you can do anything right now.

Stevemoretz commented 3 years ago

for models use:

    'model_locations' => [
...

Done you can close your issue.

envatic commented 2 years ago

@Stevemoretz There is no config when developing a package, The easiest way is to grab _ide_helper.php from another project and drop it in your package root folder.

Stevemoretz commented 2 years ago

@Stevemoretz There is no config when developing a package, The easiest way is to grab _ide_helper.php from another project and drop it in your package root folder.

You can modify configs on the fly, in your package's service provider boot method try:

$config = $this->app->make("config");
//usage eg
$config->get("ide-helper.model_locations");
//modify
$config->set("ide-helper.model_locations", $modified);

Be sure to wrap this in a app->runningInConsole to not encounter any performance changes. (it's too small to worry about but whatever you can't get hurt being more careful)