Notification Fixed
This commit is contained in:
parent
c6471def2b
commit
3927800bce
|
|
@ -79,6 +79,7 @@ return [
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'failed' => [
|
'failed' => [
|
||||||
|
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||||
'database' => env('DB_CONNECTION', 'mysql'),
|
'database' => env('DB_CONNECTION', 'mysql'),
|
||||||
'table' => 'failed_jobs',
|
'table' => 'failed_jobs',
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateFailedJobsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('uuid')->unique();
|
||||||
|
$table->text('connection');
|
||||||
|
$table->text('queue');
|
||||||
|
$table->longText('payload');
|
||||||
|
$table->longText('exception');
|
||||||
|
$table->timestamp('failed_at')->useCurrent();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('failed_jobs');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,27 +2,16 @@
|
||||||
|
|
||||||
namespace Webkul\Notification\Events;
|
namespace Webkul\Notification\Events;
|
||||||
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
use Illuminate\Broadcasting\Channel;
|
use Illuminate\Broadcasting\Channel;
|
||||||
use Illuminate\Foundation\Events\Dispatchable;
|
|
||||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||||
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
class CreateOrderNotification implements ShouldBroadcast
|
class CreateOrderNotification implements ShouldBroadcast
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new event instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the channels the event should broadcast on.
|
* Get the channels the event should broadcast on.
|
||||||
*
|
*
|
||||||
|
|
@ -33,7 +22,13 @@ class CreateOrderNotification implements ShouldBroadcast
|
||||||
return new Channel('notification');
|
return new Channel('notification');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Seperate queue.
|
||||||
|
*
|
||||||
|
* Command: `php artisan queue:work --queue=broadcastable`
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function broadcastQueue()
|
public function broadcastQueue()
|
||||||
{
|
{
|
||||||
return 'broadcastable';
|
return 'broadcastable';
|
||||||
|
|
@ -42,7 +37,7 @@ class CreateOrderNotification implements ShouldBroadcast
|
||||||
/**
|
/**
|
||||||
* Get the channels the event should broadcast as.
|
* Get the channels the event should broadcast as.
|
||||||
*
|
*
|
||||||
* @return broadcast name
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function broadcastAs()
|
public function broadcastAs()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
namespace Webkul\Notification\Events;
|
namespace Webkul\Notification\Events;
|
||||||
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
use Illuminate\Broadcasting\Channel;
|
use Illuminate\Broadcasting\Channel;
|
||||||
use Illuminate\Foundation\Events\Dispatchable;
|
|
||||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||||
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
class UpdateOrderNotification implements ShouldBroadcast
|
class UpdateOrderNotification implements ShouldBroadcast
|
||||||
{
|
{
|
||||||
|
|
@ -34,7 +34,7 @@ class UpdateOrderNotification implements ShouldBroadcast
|
||||||
return new Channel('notification');
|
return new Channel('notification');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Broadcast with data.
|
* Broadcast with data.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
|
@ -44,16 +44,25 @@ class UpdateOrderNotification implements ShouldBroadcast
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function broadcastQueue () {
|
/**
|
||||||
|
* Seperate queue.
|
||||||
|
*
|
||||||
|
* Command: `php artisan queue:work --queue=broadcastable`
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function broadcastQueue()
|
||||||
|
{
|
||||||
return 'broadcastable';
|
return 'broadcastable';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the channels the event should broadcast as.
|
* Get the channels the event should broadcast as.
|
||||||
*
|
*
|
||||||
* @return broadcast name
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function broadcastAs () {
|
public function broadcastAs()
|
||||||
|
{
|
||||||
return 'update-notification';
|
return 'update-notification';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue