add $notificationId to every broadcast notification
This commit is contained in:
@@ -100,7 +100,7 @@ class EventsController extends Controller
|
|||||||
|
|
||||||
if (Carbon::now()->lessThanOrEqualTo($event->end)) {
|
if (Carbon::now()->lessThanOrEqualTo($event->end)) {
|
||||||
$notification = Notification::create([
|
$notification = Notification::create([
|
||||||
'content' => "L'événement '{$event->name}' a été supprimé. Vous n'y participez donc plus."
|
'content' => "L'événement {$event->name} a été supprimé. Vous n'y participez donc plus."
|
||||||
]);
|
]);
|
||||||
$notification->users()->attach($participants->pluck('id'));
|
$notification->users()->attach($participants->pluck('id'));
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class TasksController extends Controller
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$event = Event::find($request["events_id"]);
|
$event = Event::find($request["event_id"]);
|
||||||
|
|
||||||
$event->tasks()->create([
|
$event->tasks()->create([
|
||||||
"name" => $request["name"],
|
"name" => $request["name"],
|
||||||
@@ -94,9 +94,9 @@ class TasksController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$user = User::find($id);
|
$user = User::find($id);
|
||||||
|
$task->users()->attach($id);
|
||||||
|
|
||||||
if($user && Carbon::now()->lessThanOrEqualTo($task->end)) {
|
if($user && Carbon::now()->lessThanOrEqualTo($task->end)) {
|
||||||
$task->users()->attach($id);
|
|
||||||
|
|
||||||
$notification = Notification::create([
|
$notification = Notification::create([
|
||||||
'content' => "Vous avez été assigné à la tâche {$task->name} de l'événement {$event->name}."
|
'content' => "Vous avez été assigné à la tâche {$task->name} de l'événement {$event->name}."
|
||||||
@@ -162,7 +162,7 @@ class TasksController extends Controller
|
|||||||
if (Carbon::now()->lessThanOrEqualTo($task->end)) {
|
if (Carbon::now()->lessThanOrEqualTo($task->end)) {
|
||||||
if ($participants->isNotEmpty()) {
|
if ($participants->isNotEmpty()) {
|
||||||
$notification = Notification::create([
|
$notification = Notification::create([
|
||||||
'content' => "La tâche '{$task->name}' pour l'événement '{$event->name}' a été supprimée. Vous n'y participez donc plus."
|
'content' => "La tâche {$task->name} pour l'événement {$event->name} a été supprimée. Vous n'y participez donc plus."
|
||||||
]);
|
]);
|
||||||
$notification->users()->attach($participants->pluck('id'));
|
$notification->users()->attach($participants->pluck('id'));
|
||||||
}
|
}
|
||||||
@@ -298,9 +298,9 @@ class TasksController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$user = User::find($id);
|
$user = User::find($id);
|
||||||
|
$task->users()->detach($id);
|
||||||
|
|
||||||
if ($user && Carbon::now()->lessThanOrEqualTo($task->end)) {
|
if ($user && Carbon::now()->lessThanOrEqualTo($task->end)) {
|
||||||
$task->users()->detach($id);
|
|
||||||
$notification = Notification::create([
|
$notification = Notification::create([
|
||||||
'content' => "Vous avez été désassigné de la tâche {$task->name} de l'événement {$event->name}."
|
'content' => "Vous avez été désassigné de la tâche {$task->name} de l'événement {$event->name}."
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user