Sort of working beta
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\Notifications\Hellcase;
|
||||
|
||||
use App\Browser\Jobs\Hellcase\HellcaseDailyFreeScreenshot;
|
||||
use App\Browser\Jobs\Hellcase\HellcaseLoginQrCode;
|
||||
use App\Notification\Notification;
|
||||
use App\Notification\Notifications\NotificationLogin;
|
||||
use Laravel\Dusk\Browser;
|
||||
|
||||
class HellcaseNotificationDailyFree extends NotificationLogin {
|
||||
|
||||
public function __construct(int $jobId, \App\Notification\NotificationBody $body) {
|
||||
parent::__construct($jobId, $body);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getImageProjectPath(): string|null {
|
||||
return HellcaseDailyFreeScreenshot::getImgFileProjectPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getLinkURL(): string|null {
|
||||
return route('jobs.show', ['job' => $this->job->id]);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\Notifications\Hellcase;
|
||||
|
||||
use App\Browser\Jobs\Hellcase\HellcaseLoginQrCode;
|
||||
use App\Notification\Notification;
|
||||
use App\Notification\Notifications\NotificationLogin;
|
||||
use Laravel\Dusk\Browser;
|
||||
|
||||
class HellcaseNotificationLogin extends NotificationLogin {
|
||||
|
||||
public function __construct(int $jobId, \App\Notification\NotificationBody $body) {
|
||||
parent::__construct($jobId, $body);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getImageProjectPath(): string|null {
|
||||
return HellcaseLoginQrCode::getImgFileProjectPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getLinkURL(): string|null {
|
||||
return route('jobs.show', ['job' => $this->job->id]);
|
||||
}
|
||||
}
|
11
app/Notification/Notifications/NotificationLogin.php
Normal file
11
app/Notification/Notifications/NotificationLogin.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\Notifications;
|
||||
|
||||
use App\Notification\Notification;
|
||||
|
||||
abstract class NotificationLogin extends Notification {
|
||||
public function __construct(int $jobId, \App\Notification\NotificationBody $body) {
|
||||
parent::__construct($jobId, $body, true);
|
||||
}
|
||||
}
|
36
app/Notification/Notifications/SimpleNotification.php
Normal file
36
app/Notification/Notifications/SimpleNotification.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\Notifications;
|
||||
|
||||
use App\Notification\Notification;
|
||||
use App\Notification\NotificationBody\SimpleNotificationBody;
|
||||
use App\Notification\Stringifiable;
|
||||
use App\Notification\Stringifiable\StringifiableSimpleText;
|
||||
|
||||
class SimpleNotification extends Notification {
|
||||
|
||||
private StringifiableSimpleText $title;
|
||||
|
||||
public function __construct(int $jobId, string $title, string $body, bool $isError = false) {
|
||||
$this->title = new StringifiableSimpleText($title);
|
||||
parent::__construct($jobId, new SimpleNotificationBody($body), $isError);
|
||||
}
|
||||
|
||||
public function getTitle(): Stringifiable {
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getImageProjectPath(): string|null {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getLinkURL(): string|null {
|
||||
return route('home');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user