Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/app/Notifications/ScheduleCallNotification.php
Назад
<?php namespace App\Notifications; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\DatabaseMessage; use Illuminate\Notifications\Notification; class ScheduleCallNotification extends Notification implements ShouldQueue { use Queueable; protected $appointment; /** * Create a new notification instance. */ public function __construct($appointment) { $this->appointment = $appointment; } /** * Get the notification's delivery channels. * * @return array */ public function via($notifiable) { return ['database']; } /** * Get the mail representation of the notification. */ public function toMail($notifiable) { return (new MailMessage) ->line('You have a new call scheduled.') ->action('View Appointment', url('/appointments/' . $this->appointment->id)) ->line('Thank you for using our application!'); } /** * Get the array representation of the notification for the database. */ public function toArray($notifiable) { return [ 'appointment_id' => $this->appointment->id, 'message' => 'You have a new call scheduled with ' . $this->appointment->user->name, 'scheduled_time' => $this->appointment->date . ' ' . $this->appointment->timeSlot->start_time, ]; } } // TODO: move to contoller when development start // use App\Notifications\ScheduleCallNotification; // use App\Models\Appointment; // public function scheduleCall(Request $request) // { // // Create the appointment // $appointment = Appointment::create([ // 'user_id' => $request->user_id, // 'agent_id' => $request->agent_id, // 'date' => $request->date, // 'time_slot_id' => $request->time_slot_id, // ]); // // Find the agent // $agent = User::find($request->agent_id); // // Send the notification // $agent->notify(new ScheduleCallNotification($appointment)); // return response()->json(['message' => 'Call scheduled and notification sent!']); // }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка