Closed rob1121 closed 7 years ago
Hi Sir Barry, no email has been thrown.. Please have time to check my code below... Thanks in advance and regards,Rob
my notification class
my .env
queue.php
On Tuesday, October 4, 2016 3:08 PM, Barry vd. Heuvel <notifications@github.com> wrote:
Why not? What error do you get?— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
no email has been thrown.. Please have time to check my code below...
Barryvdh\Queue\AsyncServiceProvider::class
'default' => env('QUEUE_DRIVER', 'async'),
'connections' => [
'async' => [
'driver' => 'async',
'table' => 'jobs',
'queue' => 'default',
'binary' => 'php',
'binary_args' => '',
],
QUEUE_DRIVER=async
Route::get("/", function() {
$user = User::first();
$spec = Companyspec::first();
$user->notify(new InternalSpecUpdateNotifier($spec));
});
<?php
namespace App\Notifications;
use App\CompanySpec;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class InternalSpecUpdateNotifier extends Notification implements ShouldQueue
{
use Queueable;
private $spec;
public function __construct(CompanySpec $spec)
{
$this->spec = $spec;
}
public function via($notifiable)
{
return ['mail'];
}
public function toMail($notifiable)
{
return (new MailMessage)
->subject("Internal spec update: {$this->spec->spec_no} - {$this->spec->name}")
->line("Revision summary:")
->line("{$this->spec->companySpecRevision->revision_summary}")
->action('View it now', url('/'))
->success()
->line('Feel free to contance me');
}
}
[Symfony\Component\Debug\Exception\FatalThrowableError] Type error: Argument 3 passed to Illuminate\Queue\Worker::process() must be an instance of Illuminate\Queu e\WorkerOptions, none given, called in C:\SlotSys\www\aplicatie\vendor\barryvdh\laravel-async-queue\src\Co nsole\AsyncCommand.php on line 84
Any news on this one. I experience the same problem.
same error as @oriceon here.
(I should note that I am on Laravel Spark v3.0.4)
And seeing that @rob1121 has in his web.php:
$user->notify(new InternalSpecUpdateNotifier($spec));
Is a fairly safe assumption that he uses Spark's notification system
I have made a fix locally, and when i looked up the file in the repo, it appears @oriceon has fixed it in 21093d1.
The reason it does not fork for me, @seiler-steinbach and others,
is that the installation instructions say composer require barryvdh/laravel-async-queue:"0.4.x"
(which does not include the fix)
so in short, here is the fix:
composer require barryvdh/laravel-async-queue dev-master
(issue can be closed now @barryvdh)
Don't ever require dev-master please.
It has a branch alias, so you could use 0.5.x@dev
.
Also, I've tagged the current master as 0.5.0
Why not? What error do you get?