Apply fixes from StyleCI

This commit is contained in:
2020-10-21 00:01:41 +00:00
committed by StyleCI Bot
parent 53c23f3698
commit 773ec570d9
218 changed files with 5137 additions and 1672 deletions

View File

@@ -1,7 +1,27 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use App\Application;
use App\Facades\Options;
use App\Traits\Cancellable;
use Illuminate\Bus\Queueable;
@@ -9,7 +29,6 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Notification;
use App\Application;
class ApplicationApproved extends Notification implements ShouldQueue
{
@@ -45,10 +64,9 @@ class ApplicationApproved extends Notification implements ShouldQueue
*/
public function toMail($notifiable)
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - ' . $this->application->response->vacancy->vacancyName . ' application approved')
->subject(config('app.name').' - '.$this->application->response->vacancy->vacancyName.' application approved')
->line('<br />')
->line('Congratulations! Our Staff team has reviewed your application today, and your application has been approved.')
->line('You have just received the Reviewer role, which allows you to view and vote on other applications.')
@@ -62,19 +80,18 @@ class ApplicationApproved extends Notification implements ShouldQueue
public function toSlack($notifiable)
{
$url = route('showSingleProfile', ['user' => $notifiable->id]);
$roles = implode(', ', $notifiable->roles->pluck('name')->all());
return (new SlackMessage)
->success()
->content('A user has been approved on the team. Welcome aboard!')
->attachment(function($attachment) use ($notifiable, $url, $roles){
->attachment(function ($attachment) use ($notifiable, $url, $roles) {
$attachment->title('New staff member')
->fields([
'Name' => $notifiable->name,
'Email' => $notifiable->email,
'Roles' => $roles
'Roles' => $roles,
])
->action('View profile', $url);
});

View File

@@ -1,19 +1,37 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use App\Application;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Notification;
use App\Application;
class ApplicationDenied extends Notification implements ShouldQueue
{
use Queueable;
public $application;
/**
@@ -45,10 +63,9 @@ class ApplicationDenied extends Notification implements ShouldQueue
*/
public function toMail($notifiable)
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - ' . $this->application->response->vacancy->vacancyName . ' application denied')
->subject(config('app.name').' - '.$this->application->response->vacancy->vacancyName.' application denied')
->line('Your most recent application has been denied.')
->line('Our review team denies applications for several reasons, including poor answers.')
->line('Please review your application and try again in 30 days.')
@@ -56,20 +73,19 @@ class ApplicationDenied extends Notification implements ShouldQueue
->line('Better luck next time!');
}
public function toSlack($notifiable)
{
$notifiableName = $notifiable->name;
$notifiableName = $notifiable->name;
return (new SlackMessage)
return (new SlackMessage)
->error()
->content('An application has just been denied.')
->attachment(function($attachment) use ($notifiableName){
->attachment(function ($attachment) use ($notifiableName) {
$attachment->title('Application denied!')
->content($notifiableName . '\'s application has just been denied. They can try again in 30 days.');
->content($notifiableName.'\'s application has just been denied. They can try again in 30 days.');
});
}
/**
* Get the array representation of the notification.
*

View File

@@ -1,13 +1,32 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use App\Facades\Options;
use App\Traits\Cancellable;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use App\Traits\Cancellable;
use App\Facades\Options;
class ApplicationMoved extends Notification implements ShouldQueue
{
@@ -38,7 +57,7 @@ class ApplicationMoved extends Notification implements ShouldQueue
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - Application Updated')
->subject(config('app.name').' - Application Updated')
->line('Your most recent application has been moved up a stage.')
->line('This means our team has reviewed it and an interview will be scheduled ASAP.')
->action('Sign in', url(route('login')))

View File

@@ -1,5 +1,24 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use Illuminate\Bus\Queueable;
@@ -42,7 +61,7 @@ class AppointmentFinished extends Notification implements ShouldQueue
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - Appointment completed')
->subject(config('app.name').' - Appointment completed')
->line('Your appointment has been marked as completed!')
->line('Please allow an additional day for your application to be fully processed.')
->action('View applications', url(route('showUserApps')))

View File

@@ -1,19 +1,36 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use App\Appointment;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use App\Appointment;
class AppointmentScheduled extends Notification implements ShouldQueue
{
use Queueable;
protected $appointment;
/**
@@ -47,10 +64,10 @@ class AppointmentScheduled extends Notification implements ShouldQueue
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - Interview scheduled')
->line('A voice interview has been scheduled for you @ ' . $this->appointment->appointmentDate . '.')
->line('With the following details: ' . $this->appointment->appointmentDescription)
->line('This meeting will take place @ ' . $this->appointment->appointmentLocation . '. You will receive an email soon with details on how to join this meeting.')
->subject(config('app.name').' - Interview scheduled')
->line('A voice interview has been scheduled for you @ '.$this->appointment->appointmentDate.'.')
->line('With the following details: '.$this->appointment->appointmentDescription)
->line('This meeting will take place @ '.$this->appointment->appointmentLocation.'. You will receive an email soon with details on how to join this meeting.')
->line('You are expected to show up at least 5 minutes before the scheduled date.')
->action('Sign in', url(route('login')))
->line('Thank you!');

View File

@@ -1,5 +1,24 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use Illuminate\Bus\Queueable;
@@ -42,7 +61,7 @@ class ChangedPassword extends Notification implements ShouldQueue
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - Account password changed')
->subject(config('app.name').' - Account password changed')
->line('The password for the account registered to this email address has just been changed.')
->line('If this was not you, please contact an administrator immediately.')
->action('Sign in', url(route('login')))

View File

@@ -1,5 +1,24 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use Illuminate\Bus\Queueable;
@@ -42,7 +61,7 @@ class EmailChanged extends Notification implements ShouldQueue
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - Email address changed')
->subject(config('app.name').' - Email address changed')
->line('The email address for your account has just been updated, either by you or an administrator.')
->action('Sign in', url(route('login')))
->line('Thank you!');

View File

@@ -1,26 +1,42 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use App\Application;
use App\Facades\Options;
use App\Traits\Cancellable;
use App\Vacancy;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Notification;
use App\Application;
use App\Vacancy;
use App\Traits\Cancellable;
use App\Facades\Options;
class NewApplicant extends Notification implements ShouldQueue
{
use Queueable, Cancellable;
protected $application;
protected $vacancy;
/**
@@ -36,8 +52,7 @@ class NewApplicant extends Notification implements ShouldQueue
public function channels()
{
if (Options::getOption('enable_slack_notifications') == 1)
{
if (Options::getOption('enable_slack_notifications') == 1) {
return ['slack'];
}
@@ -59,17 +74,15 @@ class NewApplicant extends Notification implements ShouldQueue
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - New application')
->subject(config('app.name').' - New application')
->line('Someone has just applied for a position. Check it out!')
->line('You are receiving this because you\'re a staff member at ' . config('app.name') . '.')
->line('You are receiving this because you\'re a staff member at '.config('app.name').'.')
->action('View Application', url(route('showUserApp', ['application' => $this->application->id])))
->line('Thank you!');
}
public function toSlack($notifiable)
{
$vacancyDetails = [];
$vacancyDetails['name'] = $this->vacancy->vacancyName;
$vacancyDetails['slots'] = $this->vacancy->vacancyCount;
@@ -80,16 +93,17 @@ class NewApplicant extends Notification implements ShouldQueue
return (new SlackMessage)
->success()
->content('Notice: New application coming through. Please review as soon as possible.')
->attachment(function($attachment) use ($vacancyDetails, $url, $applicant){
->attachment(function ($attachment) use ($vacancyDetails, $url, $applicant) {
$attachment->title('Application details')
->fields([
'Applied for' => $vacancyDetails['name'],
'Avaiable positions' => $vacancyDetails['slots'],
'Applicant' => $applicant
'Applied for' => $vacancyDetails['name'],
'Avaiable positions' => $vacancyDetails['slots'],
'Applicant' => $applicant,
])
->action('Review application', $url);
});
}
/**
* Get the array representation of the notification.
*

View File

@@ -1,21 +1,39 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use App\Application;
use App\Comment;
use App\Facades\Options;
use App\Traits\Cancellable;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use App\Comment;
use App\Application;
use App\Traits\Cancellable;
use App\Facades\Options;
class NewComment extends Notification implements ShouldQueue
{
use Queueable, Cancellable;
protected $application;
/**
@@ -43,7 +61,7 @@ class NewComment extends Notification implements ShouldQueue
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - New comment')
->subject(config('app.name').' - New comment')
->line('Someone has just posted a new comment on an application you follow.')
->line('You\'re receiving this email because you\'ve voted/commented on this application.')
->action('Check it out', url(route('showUserApp', ['application' => $this->application->id])))

View File

@@ -1,9 +1,27 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Collection;
@@ -44,23 +62,22 @@ class NewContact extends Notification
public function toMail($notifiable)
{
if ($this->message->has([
'message',
'ip',
'email'
]))
{
return (new MailMessage)
'message',
'ip',
'email',
])) {
return (new MailMessage)
->line('We\'ve received a new contact form submission in the StaffManagement app center.')
->line('This is what they sent: ')
->line('')
->line($this->message->get('message'))
->line('')
->line('This message was received from ' . $this->message->get('ip') . ' and submitted by ' . $this->message->get('email') . '.')
->line('This message was received from '.$this->message->get('ip').' and submitted by '.$this->message->get('email').'.')
->action('Sign in', url(route('login')))
->line('Thank you!');
}
throw new \InvalidArgumentException("Invalid arguments supplied to NewContact!");
throw new \InvalidArgumentException('Invalid arguments supplied to NewContact!');
}
/**

View File

@@ -1,17 +1,35 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use App\Facades\Options;
use App\Facades\UUID;
use App\Traits\Cancellable;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\SlackMessage;
use App\User;
use App\Facades\UUID;
use App\Traits\Cancellable;
use App\Facades\Options;
use Illuminate\Notifications\Notification;
class NewUser extends Notification implements ShouldQueue
{
@@ -49,8 +67,8 @@ class NewUser extends Notification implements ShouldQueue
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - New user')
->line($this->user->name . ' has just registered to our site.')
->subject(config('app.name').' - New user')
->line($this->user->name.' has just registered to our site.')
->line('You are receiving this email because you opted to receive new user notifications.')
->action('View profile', url(route('showSingleProfile', ['user' => $this->user->id])))
->line('Thank you!');
@@ -58,28 +76,26 @@ class NewUser extends Notification implements ShouldQueue
public function toSlack($notifiable)
{
$user = [];
$user = [];
$user['name'] = $this->user->name;
$user['email'] = $this->user->email;
$user['username'] = UUID::toUsername($this->user->uuid);
$user['name'] = $this->user->name;
$user['email'] = $this->user->email;
$user['username'] = UUID::toUsername($this->user->uuid);
$date = \Carbon\Carbon::parse($this->user->created_at);
$user['created_at'] = $date->englishMonth . ' ' . $date->day . ' ' . $date->year;
$date = \Carbon\Carbon::parse($this->user->created_at);
$user['created_at'] = $date->englishMonth.' '.$date->day.' '.$date->year;
return (new SlackMessage)
->success()
->content('A new user has signed up!')
->attachment(function($attachment) use ($user){
->attachment(function ($attachment) use ($user) {
$attachment->title('User details')
->fields([
'Email address' => $user['email'],
'Name' => $user['name'],
'Minecraft Username' => $user['username'],
'Registration date' => $user['created_at']
'Email address' => $user['email'],
'Name' => $user['name'],
'Minecraft Username' => $user['username'],
'Registration date' => $user['created_at'],
]);
});
}

View File

@@ -1,15 +1,33 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use App\Ban;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use App\User;
use App\Ban;
class UserBanned extends Notification implements ShouldQueue
{
use Queueable;
@@ -17,6 +35,7 @@ class UserBanned extends Notification implements ShouldQueue
protected $user;
protected $ban;
/**
* Create a new notification instance.
*
@@ -50,8 +69,8 @@ class UserBanned extends Notification implements ShouldQueue
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->line('Hello, ')
->line('Moderators have just banned user ' . $this->user->name . ' for ' . $this->ban->reason)
->line('This ban will remain in effect until ' . $this->ban->bannedUntil . '.')
->line('Moderators have just banned user '.$this->user->name.' for '.$this->ban->reason)
->line('This ban will remain in effect until '.$this->ban->bannedUntil.'.')
->action('View profile', url(route('showSingleProfile', ['user' => $this->user->id])))
->line('Thank you!');
}

View File

@@ -1,17 +1,35 @@
<?php
/*
* Copyright © 2020 Miguel Nogueira
*
* This file is part of Raspberry Staff Manager.
*
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Raspberry Staff Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Notifications;
use App\Facades\Options;
use App\Traits\Cancellable;
use App\Vacancy;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Queue\SerializesModels;
use App\Vacancy;
use App\Facades\Options;
use App\Traits\Cancellable;
class VacancyClosed extends Notification implements ShouldQueue
{
use Queueable, SerializesModels, Cancellable;
@@ -25,7 +43,7 @@ class VacancyClosed extends Notification implements ShouldQueue
*/
public function __construct(Vacancy $vacancy)
{
$this->vacancy = $vacancy;
$this->vacancy = $vacancy;
}
public function optOut($notifiable)
@@ -43,8 +61,8 @@ class VacancyClosed extends Notification implements ShouldQueue
{
return (new MailMessage)
->from(config('notification.sender.address'), config('notification.sender.name'))
->subject(config('app.name') . ' - Vacancy Closed')
->line('The vacancy ' . $this->vacancy->vacancyName . ', with ' . $this->vacancy->vacancyCount . ' remaining slots, has just been closed.')
->subject(config('app.name').' - Vacancy Closed')
->line('The vacancy '.$this->vacancy->vacancyName.', with '.$this->vacancy->vacancyCount.' remaining slots, has just been closed.')
->line('Please be aware that this position may be deleted/reopened any time.')
->action('View positions', url(route('showPositions')))
->line('Thank you!');