diff --git a/app/Models/NotificationTemplate.php b/app/Models/NotificationTemplate.php
index 6686940..d3f7757 100755
--- a/app/Models/NotificationTemplate.php
+++ b/app/Models/NotificationTemplate.php
@@ -21,6 +21,7 @@ class NotificationTemplate extends Model
'title',
'content',
'channels',
+ 'models',
'disabled',
];
@@ -83,6 +84,16 @@ public function channels(): Attribute
});
}
+ /**
+ * Models this notification can use
+ *
+ * @return array $models
+ */
+ public function models(): array
+ {
+ return json_decode($this->attributes['models'], true);
+ }
+
/**
* Get the rendered HTML content
*
diff --git a/database/migrations/2022_03_11_144044_create_notification_templates_table.php b/database/migrations/2022_03_11_144044_create_notification_templates_table.php
index d665b33..a67eb0e 100755
--- a/database/migrations/2022_03_11_144044_create_notification_templates_table.php
+++ b/database/migrations/2022_03_11_144044_create_notification_templates_table.php
@@ -19,6 +19,7 @@ public function up()
$table->string('title');
$table->text('content');
$table->text('channels')->comment('Stored as json array');
+ $table->text('models')->comment('Stored as json array');
$table->boolean('disabled')->default(false);
$table->timestamps();
});
diff --git a/database/seeders/Standard/NotificationSeeder.php b/database/seeders/Standard/NotificationSeeder.php
index 058be6a..4428ee4 100755
--- a/database/seeders/Standard/NotificationSeeder.php
+++ b/database/seeders/Standard/NotificationSeeder.php
@@ -3,7 +3,10 @@
namespace Database\Seeders\Standard;
use App\Models\NotificationTemplate;
+use App\Models\Server;
+use App\Models\User;
use Illuminate\Database\Seeder;
+use phpDocumentor\Reflection\Types\Object_;
class NotificationSeeder extends Seeder
{
@@ -25,7 +28,8 @@ public function run()
This dashboard can be used to create and delete servers. These servers can be used and managed on our pterodactyl panel. If you have any questions, please join our Discord server and #create-a-ticket.
We hope you can enjoy this hosting experience and if you have any suggestions please let us know!
Hello {{\$user->username}}, Your Mail settings are configured correctly!
Regards, Controlpanel
",
- 'channels' => json_encode(['mail'])
+ 'channels' => json_encode(['mail']),
+ 'models' => json_encode([User::class]),
]);
NotificationTemplate::query()->firstOrCreate([
@@ -50,7 +55,8 @@ public function run()
Please recharge your account to continue using our services.
Regards, Controlpanel
",
- 'channels' => json_encode(['mail'])
+ 'channels' => json_encode(['mail']),
+ 'models' => json_encode([User::class]),
]);
NotificationTemplate::query()->firstOrCreate([
@@ -64,7 +70,8 @@ public function run()
You can now use your servers again.
Regards, Controlpanel
",
- 'channels' => json_encode(['mail'])
+ 'channels' => json_encode(['mail']),
+ 'models' => json_encode([User::class]),
]);
}
}
diff --git a/lang/en.json b/lang/en.json
index 4403a9f..7a9005d 100755
--- a/lang/en.json
+++ b/lang/en.json
@@ -22,5 +22,7 @@
"A voucher is expired at and after this date": "A voucher is expired at and after this date",
"Voucher saved": "Voucher saved",
"Voucher removed": "Voucher removed",
- "Used / Uses": "Used / Uses"
+ "Used / Uses": "Used / Uses",
+
+ "Example": "Example"
}
diff --git a/lang/en/blade.php b/lang/en/blade.php
new file mode 100644
index 0000000..0231d6d
--- /dev/null
+++ b/lang/en/blade.php
@@ -0,0 +1,18 @@
+ 'Hover over the following button below to view the available variables to use.',
+
+];
diff --git a/resources/views/admin/notifications/edit.blade.php b/resources/views/admin/notifications/edit.blade.php
index a539777..8e9e85a 100755
--- a/resources/views/admin/notifications/edit.blade.php
+++ b/resources/views/admin/notifications/edit.blade.php
@@ -37,9 +37,29 @@
-
-
+
+
+
+ @foreach(json_decode($notification->models) as $a => $item)
+