barryvdh / laravel-async-queue

Laravel Async Queue Driver
286 stars 76 forks source link

Laravel 5.3 not supported #56

Closed rob1121 closed 7 years ago

barryvdh commented 8 years ago

Why not? What error do you get?

rob1121 commented 8 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.

rob1121 commented 8 years ago

Hi Sir Barry,

no email has been thrown.. Please have time to check my code below...

config/app.php

Barryvdh\Queue\AsyncServiceProvider::class

config/queue.php

'default' => env('QUEUE_DRIVER', 'async'),

    'connections' => [

        'async' => [
            'driver' => 'async',
            'table' => 'jobs',
            'queue' => 'default',
            'binary'      => 'php',
            'binary_args' => '',
        ],

.env

QUEUE_DRIVER=async

web.php

Route::get("/", function() {
    $user = User::first();
    $spec = Companyspec::first();
    $user->notify(new InternalSpecUpdateNotifier($spec));
});

InternalSpecUpdateNotifier.php

<?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');
    }
}
oriceon commented 8 years ago

[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

seiler-steinbach commented 7 years ago

Any news on this one. I experience the same problem.

Quezler commented 7 years ago

same error as @oriceon here.

(I should note that I am on Laravel Spark v3.0.4)

Quezler commented 7 years ago

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

Quezler commented 7 years ago

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)

barryvdh commented 7 years ago

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