32 lines
803 B
PHP
32 lines
803 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Notifications;
|
||
|
|
|
||
|
|
use Illuminate\Bus\Queueable;
|
||
|
|
use Illuminate\Notifications\Notification;
|
||
|
|
use App\Models\Feature;
|
||
|
|
|
||
|
|
class FeatureCompletedNotification extends Notification
|
||
|
|
{
|
||
|
|
use Queueable;
|
||
|
|
|
||
|
|
public function __construct(public Feature $feature) {}
|
||
|
|
|
||
|
|
public function via($notifiable): array
|
||
|
|
{
|
||
|
|
return ['database'];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function toArray($notifiable): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'type' => 'feature_completed',
|
||
|
|
'feature_id' => $this->feature->id,
|
||
|
|
'project_id' => $this->feature->layer?->phase?->project_id,
|
||
|
|
'feature_name' => $this->feature->name,
|
||
|
|
'progress' => 100,
|
||
|
|
'message' => "Elemento '{$this->feature->name}' marcado como completado",
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|