add information in task date updated notification
This commit is contained in:
@@ -15,15 +15,21 @@ class TaskDateUpdated implements ShouldBroadcastNow
|
|||||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
public $task;
|
public $task;
|
||||||
|
public $event;
|
||||||
|
public $start;
|
||||||
|
public $end;
|
||||||
protected $userId;
|
protected $userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new event instance.
|
* Create a new event instance.
|
||||||
*/
|
*/
|
||||||
public function __construct($userId, Task $task)
|
public function __construct($userId, Task $task, Event $event, $start, $end)
|
||||||
{
|
{
|
||||||
$this->userId = $userId;
|
$this->userId = $userId;
|
||||||
$this->task = $task;
|
$this->task = $task;
|
||||||
|
$this->event = $event;
|
||||||
|
$this->start = $start;
|
||||||
|
$this->end = $end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -215,12 +215,15 @@ class TasksController extends Controller
|
|||||||
|
|
||||||
foreach ($participants as $user) {
|
foreach ($participants as $user) {
|
||||||
$notification = Notification::create([
|
$notification = Notification::create([
|
||||||
'content' => "La date de la tâche {$task->name} de l'événement {$task->event->name} à été mis à jour. Cette tâche aura maintenant lieu du {$formatedTaskStart} au {$formatedTaskEnd}."
|
'content' => "La date de la tâche {$task->name} de l'événement {$event->name} à été mis à jour. Cette tâche aura maintenant lieu du {$formatedTaskStart} au {$formatedTaskEnd}."
|
||||||
]);
|
]);
|
||||||
$notification->users()->attach($user->id);
|
$notification->users()->attach($user->id);
|
||||||
broadcast(new TaskDateUpdated(
|
broadcast(new TaskDateUpdated(
|
||||||
$user->id,
|
$user->id,
|
||||||
$task,
|
$task,
|
||||||
|
$event,
|
||||||
|
$newStart,
|
||||||
|
$newEnd,
|
||||||
));
|
));
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
|||||||
Reference in New Issue
Block a user