Skip to main content

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

Read more here

crivion/laraboard-careers

79 stars
2 code files
View crivion/laraboard-careers on GitHub

app/Notifications/JobApplicationReceivedNotification.php

Open in GitHub
use App\Models\JobApplication;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
 
class JobApplicationReceivedNotification extends Notification implements ShouldQueue
{
use Queueable;
 
public $application;
 
public function __construct(JobApplication $application)
{
$this->application = $application;
}
 
public function via($notifiable)
{
return ["mail"];
}
 
public function toMail($notifiable)
{
return (new MailMessage())
->subject(__("New Job Application"))
->line(__("Hey :name,", ["name" => $notifiable->name]))
->line(
__("You have just received a new job application for :job", [
"job" => $this->application->job->job_title,
])
)
->line(
__("Applicant name: :applicantName", [
"applicantName" => $this->application->name,
])
)
->line(
__("Applicant phone: :applicantPhone", [
"applicantPhone" => $this->application->phone,
])
)
->line(
__("Applicant email: :applicantEmail", [
"applicantEmail" => $this->application->email,
])
)
->action(__("Go to dashboard"), url(route("dashboard")))
->line(__("Regards"));
}
// ...
}

app/Listeners/JobApplicationListener.php

Open in GitHub
use App\Events\JobApplicationReceivedEvent;
use App\Notifications\JobApplicationReceivedNotification;
 
class JobApplicationListener
{
// ...
public function handle(JobApplicationReceivedEvent $event)
{
$user = $event->application->job->user;
 
$user->notify(new JobApplicationReceivedNotification($event->application));
}
}

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.