laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

IDE Helper for Laravel packages

Open maicol07 opened this issue 4 years ago • 4 comments

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

maicol07 avatar Sep 22 '21 10:09 maicol07

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 avatar Oct 27 '21 08:10 Stevemoretz

for models use:

    'model_locations' => [
...

Done you can close your issue.

Stevemoretz avatar Nov 08 '21 11:11 Stevemoretz

@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.

envatic avatar May 26 '22 06:05 envatic

@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)

Stevemoretz avatar May 26 '22 07:05 Stevemoretz