Issues (404)

Branch: dev

app/Mail/JobStatusChanged.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace App\Mail;
4
5
use App\Models\JobPosterStatusHistory;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Mail\Mailable;
9
use Illuminate\Queue\SerializesModels;
10
11
class JobStatusChanged extends Mailable implements ShouldQueue
12
{
13
    use Queueable, SerializesModels;
14
15
    /**
16
     * The job status transition which caused this notification.
17
     *
18
     * @var JobPosterStatusHistory
19
     */
20
    protected $transition;
21
22
    /**
23
     * Create a new message instance.
24
     *
25
     * @return void
26
     */
27
    public function __construct(JobPosterStatusHistory $transition)
28
    {
29
        $this->transition = $transition;
30
    }
31
32
    /**
33
     * Build the message.
34
     *
35
     * @return $this
36
     */
37
    public function build()
38
    {
39
        $job = $this->transition->job_poster;
40
        $to = $this->transition->to->name;
41
        $subject = "Job $job->title changed status to $to";
42
        return $this->markdown('emails.job_posters.status_transition')
43
            ->subject($subject)
44
            ->with([
45
                'jobPoster' => $this->transition->job_poster,
46
                'user' => $this->transition->user,
47
                'from' => $this->transition->from->name,
48
                'to' => $to,
49
                'url' => backpack_url('job-poster'),
0 ignored issues
show
The function backpack_url was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

49
                'url' => /** @scrutinizer ignore-call */ backpack_url('job-poster'),
Loading history...
50
            ]);
51
    }
52
}
53