ルーメンページのガイドを使用して、ルーメンにキューを設定しようとしています: http://lumen.laravel.com/docs/queues
<?php
namespace App\Jobs;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;
class BlastEmail extends Job implements SelfHandling, ShouldQueue
{
public function sendEmail()
{
[...CODE TO SEND EMAIL...]
}
public function handle()
{
$this->sendEmail();
}
}
そして私のコントローラーで
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Jobs\BlastEmail;
use App\Models\Blast;
use App\Models\Subscriber;
use Illuminate\Http\Request;
use Validator;
class BlastsController extends BaseController
{
public function queue(Request $request)
{
$job = (new BlastEmail($email,$request->input('content'),$request->input('title')));
$this->dispatch($job);
}
}
Controller.php
<?php
namespace App\Http\Controllers;
use Laravel\Lumen\Routing\Controller as BaseController;
class Controller extends BaseController
{
//
}
BaseController.php
use Dingo\Api\Routing\Helpers;
use Illuminate\Routing\Controller;
use Cartalyst\Sentinel\Native\Facades\Sentinel;
class BaseController extends Controller {
function someFunctionThatOtherGuyWrote()
{
// Some code that other guy wrote
}
}
そして、私は得ました
未定義のメソッド App\Http\Controllers\BlastsController::dispatch
私は何かが恋しいですか?