Skip to content

Commit

Permalink
add missing listener files
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio committed Dec 2, 2017
1 parent 78cd6d3 commit 68039f6
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -14,7 +14,7 @@ before_install:
before_script:
- cp .env.travis .env
- composer self-update
- composer update --no-interaction
- composer install --no-interaction

script:
- php artisan database:create --reset
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Expand Up @@ -11,7 +11,6 @@ all: build
.PHONY: build
build:
@composer install --no-interaction
@php artisan optimize
@php artisan config:cache
@make db

Expand All @@ -22,7 +21,6 @@ install: db
.PHONY: clean
clean:
@php artisan cache:clear
@php artisan optimize
@php artisan route:clear
@php artisan config:clear

Expand Down
1 change: 1 addition & 0 deletions app/Console/Kernel.php
Expand Up @@ -36,5 +36,6 @@ protected function schedule(Schedule $schedule)
protected function commands()
{
require base_path('routes/console.php');
$this->load(__DIR__ . '/Commands');
}
}
11 changes: 5 additions & 6 deletions composer.json
Expand Up @@ -43,12 +43,12 @@
"makinacorpus/php-bloom": "dev-master",
"hashids/hashids": "2.0.*",
"maatwebsite/excel": "2.1.*",
"phpunit/phpunit": "6.4.0",
"scriptfusion/phpunit-immediate-exception-printer": "1.3.0",
"nwidart/laravel-modules": "^2.6",
"sebastiaanluca/laravel-helpers": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "6.4.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"laravel/homestead": "v6.2.2",
Expand Down Expand Up @@ -81,17 +81,16 @@
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
"Illuminate\\Foundation\\ComposerScripts::postInstall"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan ide-helper:generate",
"php artisan ide-helper:meta",
"php artisan optimize"
"php artisan ide-helper:meta"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump"
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions modules/.gitignore
@@ -1,6 +1,5 @@
# Ignore everything so if we update via git, nothing is overwritten
*

# But keep the sample and this file around
!.gitignore
!Sample/*
!/Sample/
16 changes: 16 additions & 0 deletions modules/Sample/Listeners/TestEventListener.php
@@ -0,0 +1,16 @@
<?php

namespace Modules\Sample\Listeners;

use App\Events\TestEvent;
use Log;

class TestEventListener
{
/**
* Handle the event.
*/
public function handle(TestEvent $event) {
Log::info('Received event', [$event]);
}
}
25 changes: 25 additions & 0 deletions modules/Sample/Providers/EventServiceProvider.php
@@ -0,0 +1,25 @@
<?php

namespace Modules\Sample\Providers;

use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*/
protected $listen = [
'App\Events\TestEvent' => [
'Modules\Sample\Listeners\TestEventListener',
],
];

/**
* Register any events for your application.
*/
public function boot()
{
parent::boot();
}
}

0 comments on commit 68039f6

Please sign in to comment.