Stub out some folders for jobs / commands and events.

This commit is contained in:
Taylor Otwell
2014-12-27 16:45:11 -06:00
parent 3cfe2a0c85
commit dc384fe1f5
8 changed files with 54 additions and 25 deletions

7
app/Commands/Command.php Normal file
View File

@@ -0,0 +1,7 @@
<?php namespace App\Commands;
abstract class Command {
//
}

View File

@@ -21,22 +21,12 @@ class InspireCommand extends Command {
*/
protected $description = 'Display an inspiring quote';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
public function handle()
{
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
}

7
app/Events/Event.php Normal file
View File

@@ -0,0 +1,7 @@
<?php namespace App\Events;
abstract class Event {
//
}

View File

View File

View File

@@ -1,10 +1,11 @@
<?php namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
abstract class Controller extends BaseController {
use ValidatesRequests;
use DispatchesCommands, ValidatesRequests;
}

View File

@@ -0,0 +1,34 @@
<?php namespace App\Providers;
use Illuminate\Bus\Dispatcher;
use Illuminate\Support\ServiceProvider;
class BusServiceProvider extends ServiceProvider {
/**
* Bootstrap any application services.
*
* @param \Illuminate\Bus\Dispatcher $dispatcher
* @return void
*/
public function boot(Dispatcher $dispatcher)
{
$dispatcher->mapUsing(function($command)
{
return Dispatcher::simpleMapping(
$command, 'App\Commands', 'App\Handlers\Commands'
);
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}