<?php

namespace App\Notifications;

use App\Models\ServiceOrder;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class ServiceOrderDeclined extends Notification
{
    use Queueable;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct()
    {
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail','database'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
                    ->line('Your order declined by worker. However, your money is refunded to your wallet.')
            ->line('No worries you can find more great services on Muhandisin')
                    ->action('Check Services', url('/services'))
                    ->line('Thank you for using our application!');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            "title" => 'Service Order Declined',
            "description" => 'Your order declined by worker. However, your money is refunded to your wallet. No worries you can find more great services on Muhandisin',
            'title_ar'=> 'تم رفض طلب الخدمة',
            'description_ar'=>'قام مزود الخدمة برفض طلبك يمكنك اختيار خدمة اخرى من خدمات مهندسين الرائعة',
            "relative_url" =>'/services',
        ];
    }
}
