%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/geotechnics/api/app/Notifications/
Upload File :
Create Path :
Current File : /var/www/html/geotechnics/api/app/Notifications/NotifyManagerForProjectDeadline.php

<?php

namespace App\Notifications;

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

class NotifyManagerForProjectDeadline extends Notification implements ShouldQueue
{
    use Queueable;
    /**
     * @var Project
     */
    private $project;

    /**
     * Create a new notification instance.
     *
     * @param Project $project
     */
    public function __construct(Project $project)
    {
        $this->project = $project;
    }

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

    /**
     * Get the mail representation of the notification.
     *
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail()
    {
        return (new MailMessage)->from(env('MAIL_USERNAME', 'greengeotechnics2019@gmail.com'), 'Green Geotechnics')
                                ->subject('Project deadline coming up')
                                ->greeting(' ')
                                ->line(trans('notifications.greetings', [
                                    'name' => $this->project->client->name,
                                ]))
                                ->line(trans('notifications.project_deadline', [
                                    'name'        => $this->project->name,
                                    'date'        => Carbon::parse($this->project->due_date)
                                                           ->format('dd mmm'),
                                    'portal_link' => env('DASHBOARD_URL') . 'projects/edit/' . $this->project->id,
                                ]))
                                ->line(trans('notifications.footer', [
                                    'portal_link' => env('DASHBOARD_URL'),
                                ]))
                                ->salutation(' ');
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [//
        ];
    }
}

Zerion Mini Shell 1.0