Skip to content

Instantly share code, notes, and snippets.

@densityx
Created December 24, 2018 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save densityx/7464706b0b6d4f9d4fa84f393647650a to your computer and use it in GitHub Desktop.
Save densityx/7464706b0b6d4f9d4fa84f393647650a to your computer and use it in GitHub Desktop.
Listening global events and performing action for it
Event::listen(CommandStarting::class, function ($event) {
if ($event->command === 'migrate:fresh') {
Storage::deleteDirectory('/public/clubs');
Storage::deleteDirectory('/public/users');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment