Apply fixes from StyleCI

[ci skip] [skip ci]
This commit is contained in:
HDVinnie
2021-02-28 23:40:09 +00:00
committed by StyleCI Bot
parent 85b31e81e4
commit 752c357e85
35 changed files with 201 additions and 198 deletions
+6 -6
View File
@@ -13,19 +13,18 @@
namespace App\Events;
use App\Models\User;
use App\Models\Comment;
use Illuminate\Broadcasting\Channel;
use App\Models\User;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class CommentCreated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $comment;
public $user;
@@ -34,7 +33,8 @@ class CommentCreated
* Create a new event instance.
*
* @param Comment $comment
* @param User $user
* @param User $user
*
* @return mixed
*/
public function __construct(Comment $comment, User $user)
+4 -4
View File
@@ -14,17 +14,16 @@
namespace App\Events;
use App\Models\Ticket;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class TicketAssigned
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $ticket;
@@ -32,6 +31,7 @@ class TicketAssigned
* Create a new event instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
+4 -4
View File
@@ -14,17 +14,16 @@
namespace App\Events;
use App\Models\Ticket;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class TicketClosed
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $ticket;
@@ -32,6 +31,7 @@ class TicketClosed
* Create a new event instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
+6 -6
View File
@@ -13,19 +13,18 @@
namespace App\Events;
use App\Models\User;
use App\Models\Ticket;
use Illuminate\Broadcasting\Channel;
use App\Models\User;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class TicketCreated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $user;
public $ticket;
@@ -34,7 +33,8 @@ class TicketCreated
* Create a new event instance.
*
* @param Ticket $ticket
* @param User $user
* @param User $user
*
* @return mixed
*/
public function __construct(Ticket $ticket, User $user)
+4 -4
View File
@@ -14,17 +14,16 @@
namespace App\Events;
use App\Models\Ticket;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class TicketWentStale
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $ticket;
@@ -32,6 +31,7 @@ class TicketWentStale
* Create a new event instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
+1 -1
View File
@@ -13,7 +13,6 @@
namespace App\Http\Controllers;
use App\Models\Ticket;
use App\Achievements\UserMade100Comments;
use App\Achievements\UserMade200Comments;
use App\Achievements\UserMade300Comments;
@@ -30,6 +29,7 @@ use App\Models\Article;
use App\Models\Collection;
use App\Models\Comment;
use App\Models\Playlist;
use App\Models\Ticket;
use App\Models\Torrent;
use App\Models\TorrentRequest;
use App\Models\User;
@@ -28,4 +28,4 @@ class TicketAttachmentController extends Controller
{
return \response()->download(\getcwd().'/files/attachments/attachments/'.$attachment->file_name)->deleteFileAfterSend(false);
}
}
}
+9 -12
View File
@@ -14,14 +14,11 @@
namespace App\Http\Controllers;
use App\Models\Comment;
use App\Events\TicketAssigned;
use App\Events\TicketClosed;
use App\Events\TicketCreated;
use App\Models\Ticket;
use App\Models\TicketAttachment;
use App\Models\TicketCategory;
use App\Models\TicketPriority;
use Illuminate\Http\Request;
use App\Models\TicketAttachment;
class TicketController extends Controller
{
@@ -32,7 +29,7 @@ class TicketController extends Controller
*
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
final public function index(Request $request): \Illuminate\Contracts\View\Factory|\Illuminate\View\View|\Illuminate\Contracts\Foundation\Application
final public function index(Request $request): \Illuminate\Contracts\View\Factory | \Illuminate\View\View | \Illuminate\Contracts\Foundation\Application
{
return \view('ticket.index');
}
@@ -42,14 +39,14 @@ class TicketController extends Controller
*
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
final public function create(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View|\Illuminate\Contracts\Foundation\Application
final public function create(): \Illuminate\Contracts\View\Factory | \Illuminate\View\View | \Illuminate\Contracts\Foundation\Application
{
$categories = TicketCategory::all()->sortBy('position');
$priorities = TicketPriority::all()->sortBy('position');
return view('ticket.create', [
'categories' => $categories,
'priorities' => $priorities
'priorities' => $priorities,
]);
}
@@ -99,7 +96,7 @@ class TicketController extends Controller
*
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
final public function show(Request $request, int $id): \Illuminate\Contracts\View\Factory|\Illuminate\View\View|\Illuminate\Contracts\Foundation\Application
final public function show(Request $request, int $id): \Illuminate\Contracts\View\Factory | \Illuminate\View\View | \Illuminate\Contracts\Foundation\Application
{
$user = $request->user();
$ticket = Ticket::with(['comments'])->findOrFail($id);
@@ -113,7 +110,7 @@ class TicketController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @param int $id
*
* @return \Illuminate\Http\Response
*/
@@ -125,8 +122,8 @@ class TicketController extends Controller
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @param \Illuminate\Http\Request $request
* @param int $id
*
* @return \Illuminate\Http\RedirectResponse
*/
@@ -249,4 +246,4 @@ class TicketController extends Controller
return \redirect()->route('tickets.show', ['id' => $ticket->id])
->withSuccess('Helpdesk Ticket Was Closed Successfully!');
}
}
}
+2 -2
View File
@@ -13,9 +13,9 @@
namespace App\Http\Livewire;
use Livewire\WithFileUploads;
use App\Models\TicketAttachment;
use Livewire\Component;
use Livewire\WithFileUploads;
class AttachmentUpload extends Component
{
@@ -57,4 +57,4 @@ class AttachmentUpload extends Component
{
return \view('livewire.attachment-upload');
}
}
}
+1 -1
View File
@@ -77,7 +77,7 @@ class TicketSearch extends Component
public function render()
{
return \view('livewire.ticket-search', [
'tickets' => $this->tickets
'tickets' => $this->tickets,
]);
}
}
@@ -13,11 +13,9 @@
namespace App\Listeners;
use App\Models\User;
use App\Events\CommentCreated;
use App\Models\User;
use App\Notifications\StaffCommentCreated;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Notification;
class NotifyStaffCommentWasCreated
@@ -35,7 +33,8 @@ class NotifyStaffCommentWasCreated
/**
* Handle the event.
*
* @param CommentCreated $event
* @param CommentCreated $event
*
* @return void
*/
public function handle(CommentCreated $event)
@@ -13,11 +13,9 @@
namespace App\Listeners;
use App\Models\User;
use App\Events\TicketAssigned;
use App\Models\User;
use App\Notifications\StaffTicketAssigned;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Notification;
class NotifyStaffTicketWasAssigned
@@ -35,7 +33,7 @@ class NotifyStaffTicketWasAssigned
/**
* Handle the event.
*
* @param TicketAssigned $event
* @param TicketAssigned $event
*
* @return void
*/
+2 -4
View File
@@ -13,11 +13,9 @@
namespace App\Listeners;
use App\Models\User;
use App\Events\TicketClosed;
use App\Models\User;
use App\Notifications\StaffTicketClosed;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Notification;
class NotifyStaffTicketWasClosed
@@ -35,7 +33,7 @@ class NotifyStaffTicketWasClosed
/**
* Handle the event.
*
* @param TicketClosed $event
* @param TicketClosed $event
*
* @return void
*/
@@ -14,8 +14,6 @@
namespace App\Listeners;
use App\Providers\TicketCreated;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class NotifyStaffTicketWasCreated
{
@@ -32,7 +30,8 @@ class NotifyStaffTicketWasCreated
/**
* Handle the event.
*
* @param TicketCreated $event
* @param TicketCreated $event
*
* @return void
*/
public function handle(TicketCreated $event)
@@ -14,8 +14,6 @@
namespace App\Listeners;
use App\Providers\CommentCreated;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class NotifyUserCommentWasCreated
{
@@ -32,7 +30,8 @@ class NotifyUserCommentWasCreated
/**
* Handle the event.
*
* @param CommentCreated $event
* @param CommentCreated $event
*
* @return void
*/
public function handle(CommentCreated $event)
+2 -3
View File
@@ -15,8 +15,6 @@ namespace App\Listeners;
use App\Events\TicketWentStale;
use App\Notifications\UserTicketStale;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class NotifyUserTicketIsStale
{
@@ -33,7 +31,8 @@ class NotifyUserTicketIsStale
/**
* Handle the event.
*
* @param TicketWentStale $event
* @param TicketWentStale $event
*
* @return void
*/
public function handle(TicketWentStale $event)
@@ -14,8 +14,6 @@
namespace App\Listeners;
use App\Providers\TicketAssigned;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class NotifyUserTicketWasAssigned
{
@@ -32,7 +30,8 @@ class NotifyUserTicketWasAssigned
/**
* Handle the event.
*
* @param TicketAssigned $event
* @param TicketAssigned $event
*
* @return void
*/
public function handle(TicketAssigned $event)
+2 -3
View File
@@ -14,8 +14,6 @@
namespace App\Listeners;
use App\Providers\TicketClosed;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class NotifyUserTicketWasClosed
{
@@ -32,7 +30,8 @@ class NotifyUserTicketWasClosed
/**
* Handle the event.
*
* @param TicketClosed $event
* @param TicketClosed $event
*
* @return void
*/
public function handle(TicketClosed $event)
+2 -3
View File
@@ -14,8 +14,6 @@
namespace App\Listeners;
use App\Providers\TicketCreated;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class NotifyUserTicketWasCreated
{
@@ -32,7 +30,8 @@ class NotifyUserTicketWasCreated
/**
* Handle the event.
*
* @param TicketCreated $event
* @param TicketCreated $event
*
* @return void
*/
public function handle(TicketCreated $event)
+2 -4
View File
@@ -152,12 +152,10 @@ class Comment extends Model
*/
public static function checkForStale(Ticket $ticket)
{
if (empty($ticket->reminded_at) || strtotime($ticket->reminded_at) < strtotime('+ 3 days'))
{
if (empty($ticket->reminded_at) || strtotime($ticket->reminded_at) < strtotime('+ 3 days')) {
$last_comment = $ticket->comments()->orderBy('id', 'desc')->first();
if (isset($last_comment->id) && ! $last_comment->user->is_modo && strtotime($last_comment->created_at) < strtotime('- 3 days'))
{
if (isset($last_comment->id) && ! $last_comment->user->is_modo && strtotime($last_comment->created_at) < strtotime('- 3 days')) {
event(new TicketWentStale($last_comment->ticket));
}
}
+4 -12
View File
@@ -16,16 +16,11 @@ class Ticket extends Model
public function scopeStatus($query, $status)
{
if($status === 'all')
{
if ($status === 'all') {
return $query;
}
else if($status === 'closed')
{
} elseif ($status === 'closed') {
return $query->whereNotNull('closed_at');
}
else if($status === 'open')
{
} elseif ($status === 'open') {
return $query->whereNull('closed_at');
}
}
@@ -33,9 +28,7 @@ class Ticket extends Model
public function scopeStale($query)
{
return $query->with(['comments' => function ($query) {
$query->orderBy('id', 'desc');
}, 'comments.user'])
->has('comments')
->where('reminded_at', '<', strtotime('+ 3 days'))
@@ -48,8 +41,7 @@ class Ticket extends Model
->whereNotNull('staff_id')
->get();
foreach($open_tickets as $open_ticket)
{
foreach ($open_tickets as $open_ticket) {
Comment::checkForStale($open_ticket);
}
}
+2 -2
View File
@@ -10,12 +10,12 @@ class TicketAttachment extends Model
use HasFactory;
protected $appends = [
'full_disk_path'
'full_disk_path',
];
public function getFullDiskPathAttribute()
{
return $this->disk_path . '' . $this->file_name;
return $this->disk_path.''.$this->file_name;
}
/**
+6 -6
View File
@@ -15,9 +15,8 @@ namespace App\Notifications;
use App\Models\Comment;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class StaffCommentCreated extends Notification
{
@@ -40,7 +39,7 @@ class StaffCommentCreated extends Notification
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
@@ -52,13 +51,13 @@ class StaffCommentCreated extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
return (new MailMessage())
->subject('A comment was added (Staff)')
->line('A comment was added')
->action('View Ticket', route('tickets.show', ['id' => $this->comment->ticket->id]));
@@ -67,7 +66,8 @@ class StaffCommentCreated extends Notification
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function toArray($notifiable)
+11 -8
View File
@@ -15,9 +15,8 @@ namespace App\Notifications;
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class StaffTicketAssigned extends Notification
{
@@ -29,6 +28,7 @@ class StaffTicketAssigned extends Notification
* Create a new notification instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
@@ -39,7 +39,8 @@ class StaffTicketAssigned extends Notification
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
@@ -50,21 +51,23 @@ class StaffTicketAssigned extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('A ticket was assigned (Ticket # ' . $this->ticket->id . ')')
->line('A ticket was assigned to ' . $this->ticket->staff->username)
return (new MailMessage())
->subject('A ticket was assigned (Ticket # '.$this->ticket->id.')')
->line('A ticket was assigned to '.$this->ticket->staff->username)
->action('View Ticket', route('tickets.show', ['id' => $this->ticket->id]));
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function toArray($notifiable)
+10 -6
View File
@@ -15,9 +15,8 @@ namespace App\Notifications;
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class StaffTicketClosed extends Notification
{
@@ -27,7 +26,9 @@ class StaffTicketClosed extends Notification
/**
* Create a new notification instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
@@ -38,7 +39,8 @@ class StaffTicketClosed extends Notification
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
@@ -49,12 +51,13 @@ class StaffTicketClosed extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
return (new MailMessage())
->subject('A ticket was closed (Staff)')
->line('A ticket was closed')
->action('View Ticket', route('tickets.show', ['id' => $this->ticket->id]));
@@ -63,7 +66,8 @@ class StaffTicketClosed extends Notification
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function toArray($notifiable)
+10 -7
View File
@@ -15,9 +15,8 @@ namespace App\Notifications;
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class StaffTicketCreated extends Notification
{
@@ -29,6 +28,7 @@ class StaffTicketCreated extends Notification
* Create a new notification instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
@@ -39,7 +39,8 @@ class StaffTicketCreated extends Notification
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
@@ -50,13 +51,14 @@ class StaffTicketCreated extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('A ticket was created (Ticket # ' . $this->ticket->id . ')')
return (new MailMessage())
->subject('A ticket was created (Ticket # '.$this->ticket->id.')')
->line('A ticket was created.')
->action('View Ticket', route('tickets.show', ['id' => $this->ticket->id]));
}
@@ -64,7 +66,8 @@ class StaffTicketCreated extends Notification
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function toArray($notifiable)
+10 -6
View File
@@ -15,9 +15,8 @@ namespace App\Notifications;
use App\Models\Comment;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class UserCommentCreated extends Notification
{
@@ -27,7 +26,9 @@ class UserCommentCreated extends Notification
/**
* Create a new notification instance.
*
* @param Comment $comment
*
* @return mixed
*/
public function __construct(Comment $comment)
@@ -38,7 +39,8 @@ class UserCommentCreated extends Notification
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
@@ -49,12 +51,13 @@ class UserCommentCreated extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
return (new MailMessage())
->subject('A comment was added (User)')
->line('A comment was added')
->action('View Ticket', route('tickets.show', ['id' => $this->comment->ticket->id]));
@@ -63,7 +66,8 @@ class UserCommentCreated extends Notification
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function toArray($notifiable)
+11 -8
View File
@@ -15,9 +15,8 @@ namespace App\Notifications;
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class UserTicketAssigned extends Notification
{
@@ -29,6 +28,7 @@ class UserTicketAssigned extends Notification
* Create a new notification instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
@@ -39,7 +39,8 @@ class UserTicketAssigned extends Notification
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
@@ -50,21 +51,23 @@ class UserTicketAssigned extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Your ticket was assigned (Ticket # ' . $this->ticket->id . ')')
->line('Your ticket was assigned to ' . $this->ticket->user->username)
return (new MailMessage())
->subject('Your ticket was assigned (Ticket # '.$this->ticket->id.')')
->line('Your ticket was assigned to '.$this->ticket->user->username)
->action('View Ticket', route('tickets.show', ['id' => $this->ticket->id]));
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function toArray($notifiable)
+10 -6
View File
@@ -15,9 +15,8 @@ namespace App\Notifications;
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class UserTicketClosed extends Notification
{
@@ -27,7 +26,9 @@ class UserTicketClosed extends Notification
/**
* Create a new notification instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
@@ -38,7 +39,8 @@ class UserTicketClosed extends Notification
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
@@ -49,12 +51,13 @@ class UserTicketClosed extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
return (new MailMessage())
->subject('Your ticket was closed (User)')
->line('Your ticket was closed')
->action('View Ticket', route('tickets.show', ['id' => $this->ticket->id]));
@@ -63,7 +66,8 @@ class UserTicketClosed extends Notification
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function toArray($notifiable)
+10 -7
View File
@@ -15,9 +15,8 @@ namespace App\Notifications;
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class UserTicketCreated extends Notification
{
@@ -29,6 +28,7 @@ class UserTicketCreated extends Notification
* Create a new notification instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
@@ -39,7 +39,8 @@ class UserTicketCreated extends Notification
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
@@ -50,13 +51,14 @@ class UserTicketCreated extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Your ticket was created (Ticket # ' . $this->ticket->id . ')')
return (new MailMessage())
->subject('Your ticket was created (Ticket # '.$this->ticket->id.')')
->line('Your ticket was created.')
->action('View Ticket', route('tickets.show', ['id' => $this->ticket->id]));
}
@@ -64,7 +66,8 @@ class UserTicketCreated extends Notification
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function toArray($notifiable)
+9 -6
View File
@@ -15,9 +15,8 @@ namespace App\Notifications;
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class UserTicketStale extends Notification
{
@@ -29,6 +28,7 @@ class UserTicketStale extends Notification
* Create a new notification instance.
*
* @param Ticket $ticket
*
* @return mixed
*/
public function __construct(Ticket $ticket)
@@ -39,7 +39,8 @@ class UserTicketStale extends Notification
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
@@ -50,12 +51,13 @@ class UserTicketStale extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
return (new MailMessage())
->cc($this->ticket->staff->email)
->subject('Your ticket is still open')
->line('This is a reminder that your ticket is still open')
@@ -65,7 +67,8 @@ class UserTicketStale extends Notification
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @param mixed $notifiable
*
* @return array
*/
public function toArray($notifiable)
+20 -20
View File
@@ -13,31 +13,31 @@
namespace App\Providers;
use App\Events\CommentCreated;
use App\Events\TicketAssigned;
use App\Events\TicketClosed;
use App\Events\TicketCreated;
use App\Events\TicketWentStale;
use App\Listeners\AchievementUnlocked;
use App\Listeners\FailedLoginListener;
use App\Listeners\LoginListener;
use App\Listeners\LogoutListener;
use App\Listeners\NotifyStaffCommentWasCreated;
use App\Listeners\NotifyStaffTicketWasAssigned;
use App\Listeners\NotifyStaffTicketWasClosed;
use App\Listeners\NotifyStaffTicketWasCreated;
use App\Listeners\NotifyUserCommentWasCreated;
use App\Listeners\NotifyUserTicketIsStale;
use App\Listeners\NotifyUserTicketWasAssigned;
use App\Listeners\NotifyUserTicketWasClosed;
use App\Listeners\NotifyUserTicketWasCreated;
use App\Listeners\PasswordProtectBackup;
use Assada\Achievements\Event\Unlocked;
use Illuminate\Auth\Events\Failed;
use Illuminate\Auth\Events\Login;
use Illuminate\Auth\Events\Logout;
use App\Listeners\AchievementUnlocked;
use App\Listeners\FailedLoginListener;
use Assada\Achievements\Event\Unlocked;
use App\Listeners\PasswordProtectBackup;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Spatie\Backup\Events\BackupZipWasCreated;
use App\Events\TicketCreated;
use App\Events\CommentCreated;
use App\Listeners\NotifyUserTicketWasCreated;
use App\Listeners\NotifyStaffTicketWasCreated;
use App\Listeners\NotifyUserCommentWasCreated;
use App\Listeners\NotifyStaffCommentWasCreated;
use App\Events\TicketClosed;
use App\Listeners\NotifyUserTicketWasClosed;
use App\Listeners\NotifyStaffTicketWasClosed;
use App\Events\TicketAssigned;
use App\Listeners\NotifyUserTicketWasAssigned;
use App\Listeners\NotifyStaffTicketWasAssigned;
use App\Events\TicketWentStale;
use App\Listeners\NotifyUserTicketIsStale;
class EventServiceProvider extends ServiceProvider
{
@@ -86,8 +86,8 @@ class EventServiceProvider extends ServiceProvider
NotifyStaffTicketWasAssigned::class,
],
TicketWentStale::class => [
NotifyUserTicketIsStale::class
]
NotifyUserTicketIsStale::class,
],
];
/**
+1 -1
View File
@@ -41,7 +41,7 @@ class DatabaseSeeder extends Seeder
MediaLanguagesSeeder::class,
ResolutionsTableSeeder::class,
TicketCategoriesTableSeeder::class,
TicketPrioritiesTableSeeder::class
TicketPrioritiesTableSeeder::class,
]);
}
}
@@ -44,48 +44,48 @@ class TicketCategoriesTableSeeder extends Seeder
{
return [
[
'name' => 'Accounts',
'position' => 0
'name' => 'Accounts',
'position' => 0,
],
[
'name' => 'Appeals',
'position' => 1
'name' => 'Appeals',
'position' => 1,
],
[
'name' => 'Forums',
'position' => 2
'name' => 'Forums',
'position' => 2,
],
[
'name' => 'Requests',
'position' => 3
'name' => 'Requests',
'position' => 3,
],
[
'name' => 'Subtitles',
'position' => 4
'name' => 'Subtitles',
'position' => 4,
],
[
'name' => 'Torrents',
'position' => 5
'name' => 'Torrents',
'position' => 5,
],
[
'name' => 'MediaHub',
'position' => 6
'name' => 'MediaHub',
'position' => 6,
],
[
'name' => 'Technical',
'position' => 7
'name' => 'Technical',
'position' => 7,
],
[
'name' => 'Playlists',
'position' => 8
'name' => 'Playlists',
'position' => 8,
],
[
'name' => 'Bugs',
'position' => 9
'name' => 'Bugs',
'position' => 9,
],
[
'name' => 'Other',
'position' => 10
'name' => 'Other',
'position' => 10,
],
];
}
@@ -44,16 +44,16 @@ class TicketPrioritiesTableSeeder extends Seeder
{
return [
[
'name' => 'Low',
'position' => 0
'name' => 'Low',
'position' => 0,
],
[
'name' => 'Medium',
'position' => 1
'name' => 'Medium',
'position' => 1,
],
[
'name' => 'High',
'position' => 2
'name' => 'High',
'position' => 2,
],
];
}