Skip to content

Instantly share code, notes, and snippets.

@richardDobron
Last active June 1, 2022 18:40
Show Gist options
  • Save richardDobron/1982145875e1078e004b3b35adcbf9fc to your computer and use it in GitHub Desktop.
Save richardDobron/1982145875e1078e004b3b35adcbf9fc to your computer and use it in GitHub Desktop.
Automatic schema generation for ide-helper after finished migrations in Laravel.
<?php
namespace App\Providers;
use Illuminate\Database\Events\MigrationsEnded;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
public function boot()
{
Event::listen(
MigrationsEnded::class,
function () {
Artisan::call('ide-helper:models -r -W');
}
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment