Revert "merge 1"

This reverts commit 0bc6c20a6d.
This commit is contained in:
2022-10-24 01:03:43 +01:00
parent 0bc6c20a6d
commit 0c463d1f10
166 changed files with 1849 additions and 4266 deletions

View File

@@ -1,30 +0,0 @@
<?php
namespace App\Listeners;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class NewUser
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param object $event
* @return void
*/
public function handle($event)
{
//
}
}

View File

@@ -49,11 +49,10 @@ class OnUserRegistration
// TODO: Send push notification to online admins via browser (w/ pusher)
Log::info('User '.$event->user->name.' has just registered for an account.');
User::whereHas('roles', function ($q) {
$q->where('name', 'admin');
})->get()->each(function ($user, $key) use ($event) {
$user->notify(new NewUser($event->user));
});
foreach (User::all() as $user) {
if ($user->hasRole('admin')) {
$user->notify(new NewUser($event->user));
}
}
}
}

View File

@@ -45,15 +45,11 @@ class PromoteUser
*/
public function handle(ApplicationApprovedEvent $event)
{
Log::info('User promoted automatically (application approved)', [
'user' => $event->application->user->name,
'vacancy' => $event->application->response->vacancy->vacancyName,
'role' => 'staff'
]);
Log::info('User '.$event->application->user->name . 'has just been promoted (application approved)');
$event->application->setStatus('APPROVED');
$event->application->response->vacancy->decrease();
$event->application->user->assignRole('staff');
$event->application->user->assignRole('reviewer');
$event->application->user->notify(new ApplicationApproved($event->application));
}