Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
marco76tv committed Jun 21, 2024
1 parent 15253d4 commit 5f01c94
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 10 deletions.
14 changes: 14 additions & 0 deletions Filament/Clusters/Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Modules\Notify\Filament\Clusters;

use Filament\Clusters\Cluster;

class Test extends Cluster
{
protected static ?string $navigationIcon = 'heroicon-o-squares-2x2';
// protected static ?string $navigationParentItem = 'Notifications';
// protected static ?string $navigationGroup = 'Settings';
}
7 changes: 5 additions & 2 deletions Filament/Pages/SendEmail.php → Filament/Clusters/Test/Pages/SendEmail.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Modules\Notify\Filament\Pages;
namespace Modules\Notify\Filament\Clusters\Test\Pages;

use Filament\Actions\Action;
use Filament\Facades\Filament;
Expand All @@ -18,6 +18,7 @@
use Illuminate\Support\Facades\Mail;
use Modules\Notify\Datas\EmailData;
use Modules\Notify\Emails\EmailDataEmail;
use Modules\Notify\Filament\Clusters\Test;
use Modules\Xot\Filament\Traits\NavigationLabelTrait;

/**
Expand All @@ -26,14 +27,16 @@
class SendEmail extends Page implements HasForms
{
use InteractsWithForms;
use NavigationLabelTrait;
// use NavigationLabelTrait;

public ?array $emailData = [];

protected static ?string $navigationIcon = 'heroicon-o-paper-airplane';

protected static string $view = 'notify::filament.pages.send-email';

protected static ?string $cluster = Test::class;

public function mount(): void
{
$this->fillForms();
Expand Down
12 changes: 8 additions & 4 deletions Filament/Pages/SendPushNotification.php → ...sters/Test/Pages/SendPushNotification.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Modules\Notify\Filament\Pages;
namespace Modules\Notify\Filament\Clusters\Test\Pages;

use Filament\Actions\Action;
use Filament\Facades\Filament;
Expand All @@ -17,19 +17,21 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Stringable;
use Kreait\Firebase\Messaging\CloudMessage;
use Modules\Notify\Filament\Clusters\Test;
use Modules\User\Models\DeviceUser;
use Modules\Xot\Filament\Traits\NavigationLabelTrait;
use Webmozart\Assert\Assert;

use function Safe\json_encode;

use Webmozart\Assert\Assert;

/**
* @property ComponentContainer $notificationForm
*/
class SendPushNotification extends Page implements HasForms
{
use InteractsWithForms;
use NavigationLabelTrait;
// use NavigationLabelTrait;

public ?array $notificationData = [];

Expand All @@ -38,6 +40,8 @@ class SendPushNotification extends Page implements HasForms

protected static string $view = 'notify::filament.pages.send-push-notification';

protected static ?string $cluster = Test::class;

public function mount(): void
{
$this->fillForms();
Expand All @@ -64,7 +68,7 @@ public function notificationForm(Form $form): Form
* ---.
*/
$filterCallback = function ($item) {
return $item->profile != null;
return null != $item->profile;
};

$to = $devices
Expand Down
7 changes: 5 additions & 2 deletions Filament/Pages/SendTelegram.php → ...ment/Clusters/Test/Pages/SendTelegram.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

declare(strict_types=1);

namespace Modules\Notify\Filament\Pages;
namespace Modules\Notify\Filament\Clusters\Test\Pages;

use Filament\Actions\Action;
use Filament\Facades\Filament;
Expand All @@ -20,6 +20,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Notification;
use Modules\Notify\Filament\Clusters\Test;
use Modules\Notify\Notifications\TelegramNotification;
use Modules\Xot\Filament\Traits\NavigationLabelTrait;
use NotificationChannels\Telegram\TelegramMessage;
Expand All @@ -30,14 +31,16 @@
class SendTelegram extends Page implements HasForms
{
use InteractsWithForms;
use NavigationLabelTrait;
// use NavigationLabelTrait;

public ?array $emailData = [];

protected static ?string $navigationIcon = 'heroicon-o-paper-airplane';

protected static string $view = 'notify::filament.pages.send-email';

protected static ?string $cluster = Test::class;

public function mount(): void
{
$this->fillForms();
Expand Down
17 changes: 17 additions & 0 deletions Filament/Clusters/Test/Pages/SlackNotification.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Modules\Notify\Filament\Clusters\Test\Pages;

use Filament\Pages\Page;
use Modules\Notify\Filament\Clusters\Test;

class SlackNotification extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'notify::filament.clusters.test.pages.slack-notification';

protected static ?string $cluster = Test::class;
}
7 changes: 5 additions & 2 deletions Filament/Pages/TestSmtpPage.php → ...ment/Clusters/Test/Pages/TestSmtpPage.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

declare(strict_types=1);

namespace Modules\Notify\Filament\Pages;
namespace Modules\Notify\Filament\Clusters\Test\Pages;

use Filament\Actions\Action;
use Filament\Facades\Filament;
Expand All @@ -35,6 +35,7 @@
use Illuminate\Support\Facades\Mail;
use Modules\Notify\Datas\EmailData;
use Modules\Notify\Datas\SmtpData;
use Modules\Notify\Filament\Clusters\Test;
use Modules\Xot\Datas\XotData;
use Modules\Xot\Filament\Traits\NavigationLabelTrait;
use Symfony\Component\Mailer\Mailer;
Expand All @@ -49,7 +50,7 @@
class TestSmtpPage extends Page implements HasForms
{
use InteractsWithForms;
use NavigationLabelTrait;
// use NavigationLabelTrait;

public ?array $emailData = [];

Expand All @@ -59,6 +60,8 @@ class TestSmtpPage extends Page implements HasForms

protected static string $view = 'notify::filament.pages.send-email';

protected static ?string $cluster = Test::class;

public function mount(): void
{
$this->fillForms();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<x-filament-panels::page>

</x-filament-panels::page>
2 changes: 2 additions & 0 deletions _docs/firebase.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://medium.com/@hala.s.salim/integrating-push-notifications-in-laravel-using-firebase-0bae5411d7f9

0 comments on commit 5f01c94

Please sign in to comment.