Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

alighasemzadeh/bap

154 stars
2 code files
View alighasemzadeh/bap on GitHub

app/Notifications/TicketReplied.php

Open in GitHub
use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
 
class TicketReplied extends Notification
{
use Queueable;
 
public $ticket;
 
public function __construct(Ticket $ticket)
{
$this->ticket = $ticket;
}
 
public function via($notifiable)
{
return ['mail', 'database'];
}
 
public function toMail($notifiable)
{
return (new MailMessage)
->line('The introduction to the notification.')
->action('Notification Action', url('/'))
->line('Thank you for using our application!');
}
 
public function toArray($notifiable)
{
return [
'title' => __('bap.new_ticket_replied') . $this->ticket->id,
'url' => route('panel.support.ticket.view', [$this->ticket->id]),
];
}
}

app/Http/Livewire/Admin/Support/Ticket/View.php

Open in GitHub
use App\Models\TicketReplay;
use App\Notifications\TicketReplied;
use Livewire\Component;
 
class View extends Component
{
//
public $ticket;
 
public function replay()
{
//
$this->ticket->user->notify(new TicketReplied($this->ticket));
//
}
 
public function mount(Ticket $ticket)
{
$this->ticket = $ticket;
$this->replays = TicketReplay::with(['user', 'files'])->where('ticket_id', $this->ticket->id)->latest()->get();
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.