2021-06-05 09:26:32 +00:00
< ? php
namespace App\Notifications ;
use App\Models\User ;
use Illuminate\Bus\Queueable ;
2021-06-22 21:22:57 +00:00
use Illuminate\Contracts\Queue\ShouldQueue ;
2021-06-05 09:26:32 +00:00
use Illuminate\Notifications\Notification ;
2021-06-22 21:22:57 +00:00
class WelcomeMessage extends Notification implements ShouldQueue
2021-06-05 09:26:32 +00:00
{
use Queueable ;
/**
* @ var User
*/
private $user ;
/**
* Create a new notification instance .
*
2023-01-05 17:01:42 +00:00
* @ param User $user
2021-06-05 09:26:32 +00:00
*/
public function __construct ( User $user )
{
$this -> user = $user ;
}
/**
* Get the notification ' s delivery channels .
*
2023-01-05 17:01:42 +00:00
* @ param mixed $notifiable
2021-06-05 09:26:32 +00:00
* @ return array
*/
public function via ( $notifiable )
{
return [ 'database' ];
}
2023-01-05 17:01:42 +00:00
2021-11-03 19:35:07 +00:00
public function AdditionalLines ()
2022-01-15 17:16:51 +00:00
{
2023-01-05 17:01:42 +00:00
$AdditionalLine = '' ;
2022-01-15 17:16:51 +00:00
if ( config ( 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL' ) != 0 ) {
2023-01-05 17:01:42 +00:00
$AdditionalLine .= __ ( 'Verifying your e-mail address will grant you ' ) . config ( 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL' ) . ' ' . __ ( 'additional' ) . ' ' . config ( 'SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME' ) . '. <br />' ;
2022-01-15 17:16:51 +00:00
}
if ( config ( 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL' ) != 0 ) {
2023-01-05 17:01:42 +00:00
$AdditionalLine .= __ ( 'Verifying your e-mail will also increase your Server Limit by ' ) . config ( 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL' ) . '. <br />' ;
2022-01-15 17:16:51 +00:00
}
2023-01-05 17:01:42 +00:00
$AdditionalLine .= '<br />' ;
2022-01-15 17:16:51 +00:00
if ( config ( 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD' ) != 0 ) {
2023-01-05 17:01:42 +00:00
$AdditionalLine .= __ ( 'You can also verify your discord account to get another ' ) . config ( 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD' ) . ' ' . config ( 'SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME' ) . '. <br />' ;
2021-10-13 21:21:53 +00:00
}
2022-01-15 17:16:51 +00:00
if ( config ( 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD' ) != 0 ) {
2023-01-05 17:01:42 +00:00
$AdditionalLine .= __ ( 'Verifying your Discord account will also increase your Server Limit by ' ) . config ( 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD' ) . '. <br />' ;
2022-01-15 17:16:51 +00:00
}
return $AdditionalLine ;
}
2023-01-05 17:01:42 +00:00
2021-10-26 12:13:42 +00:00
/**
* Get the array representation of the notification .
*
2023-01-05 17:01:42 +00:00
* @ param mixed $notifiable
2021-10-26 12:13:42 +00:00
* @ return array
*/
public function toArray ( $notifiable )
{
2021-06-05 09:26:32 +00:00
return [
2023-01-05 17:01:42 +00:00
'title' => __ ( 'Getting started!' ),
'content' => '
< p > '.__(' Hello ')." <strong>{$this->user->name}</strong>, ".__(' Welcome to our dashboard ').' !</ p >
< h5 > '.__(' Verification ').' </ h5 >
< p > '.__(' You can verify your e - mail address and link / verify your Discord account . ').' </ p >
2021-10-13 21:26:18 +00:00
< p >
2023-01-05 17:01:42 +00:00
'.$this->AdditionalLines().'
2021-10-13 21:21:53 +00:00
</ p >
2023-01-05 17:01:42 +00:00
< h5 > '.__(' Information ').' </ h5 >
< p > '.__(' This dashboard can be used to create and delete servers ').' .< br /> '.__(' These servers can be used and managed on our pterodactyl panel ').' .< br /> '.__(' If you have any questions , please join our Discord server and #create-a-ticket').'.</p>
< p > '.__(' We hope you can enjoy this hosting experience and if you have any suggestions please let us know ').' !</ p >
< p > '.__(' Regards ').' , < br /> '.config(' app . name ', ' Laravel ').' </ p >
' ,
2021-06-05 09:26:32 +00:00
];
}
}