Skip to content

Commit

Permalink
Register listener
Browse files Browse the repository at this point in the history
  • Loading branch information
netpok committed Mar 17, 2021
1 parent c8b49af commit 6354ead
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/IdeHelperServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Barryvdh\LaravelIdeHelper\Console\GeneratorCommand;
use Barryvdh\LaravelIdeHelper\Console\MetaCommand;
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
use Barryvdh\LaravelIdeHelper\Listeners\GenerateHelperAndMeta;
use Barryvdh\LaravelIdeHelper\Listeners\GenerateModelHelper;
use Illuminate\Console\Events\CommandFinished;
use Illuminate\Contracts\Support\DeferrableProvider;
Expand All @@ -35,6 +36,10 @@ class IdeHelperServiceProvider extends ServiceProvider implements DeferrableProv
*/
public function boot()
{
if ($this->app['config']->get('ide-helper.post_discover', [])) {
$this->app['events']->listen(CommandFinished::class, GenerateHelperAndMeta::class);
}

if ($this->app['config']->get('ide-helper.post_migrate', [])) {
$this->app['events']->listen(CommandFinished::class, GenerateModelHelper::class);
$this->app['events']->listen(MigrationsEnded::class, function () {
Expand Down

0 comments on commit 6354ead

Please sign in to comment.