-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
242 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Vilt/Resources/NotificationsLogsResource/Actions/NotificationAction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
|
||
namespace Modules\Notifications\Vilt\Resources\NotificationsLogsResource\Actions; | ||
|
||
use Modules\Base\Services\Components\Actions; | ||
|
||
class NotificationAction extends Actions | ||
{ | ||
public function setup(): void | ||
{ | ||
$this->name("notification"); | ||
$this->label(__('Back')); | ||
$this->type("success"); | ||
$this->icon(""); | ||
$this->modal(null); | ||
$this->action("user_notifications.index", "get"); | ||
$this->url(null); | ||
$this->can(true); | ||
} | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
Vilt/Resources/NotificationsLogsResource/Traits/Components.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Modules\Notifications\Vilt\Resources\NotificationsLogsResource\Traits; | ||
|
||
use Modules\Base\Services\Components\Base\Action; | ||
use Modules\Base\Services\Components\Base\Component; | ||
use Modules\Notifications\Vilt\Resources\NotificationsLogsResource\Actions\NotificationAction; | ||
|
||
trait Components | ||
{ | ||
public function components(): array { | ||
return [ | ||
Component::make(NotificationAction::class)->action(), | ||
]; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Vilt/Resources/NotificationsLogsResource/Traits/Methods.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Modules\Notifications\Vilt\Resources\NotificationsLogsResource\Traits; | ||
|
||
use Illuminate\Http\Request; | ||
use Illuminate\Pagination\LengthAwarePaginator; | ||
|
||
trait Methods | ||
{ | ||
public function afterIndex(LengthAwarePaginator $data,Request $request): void | ||
{ | ||
$data->map(function ($item){ | ||
if ($item->model_id && $item->model_type) { | ||
$item->model_id = $item->model_type::find($item->model_id); | ||
} else { | ||
$item->model_id = [ | ||
"name" => __('Public'), | ||
"id" => "public" | ||
]; | ||
} | ||
|
||
return $item; | ||
}); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Vilt/Resources/NotificationsLogsResource/Traits/Translations.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
|
||
namespace Modules\Notifications\Vilt\Resources\NotificationsLogsResource\Traits; | ||
|
||
trait Translations | ||
{ | ||
public function loadTranslations(): array | ||
{ | ||
return [ | ||
"index" => __(" Notifications Log"), | ||
"create" => __('Create ' . " Notification Log"), | ||
"bulk" => __('Delete Selected ' . " Notification Log"), | ||
"edit_title" => __('Edit ' . " Notification Log"), | ||
"create_title" => __('Create New ' . " Notification Log"), | ||
"view_title" => __('View ' . " Notification Log"), | ||
"delete_title" => __('Delete ' . " Notification Log"), | ||
"bulk_title" => __('Run Bulk Action To ' . " Notification Log"), | ||
]; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Vilt/Resources/NotificationsResource/Actions/LogAction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
|
||
namespace Modules\Notifications\Vilt\Resources\NotificationsResource\Actions; | ||
|
||
use Modules\Base\Services\Components\Actions; | ||
|
||
class LogAction extends Actions | ||
{ | ||
public function setup(): void | ||
{ | ||
$this->name("log"); | ||
$this->label(__('Log')); | ||
$this->type("success"); | ||
$this->icon(""); | ||
$this->modal(null); | ||
$this->action('notifications_logs.index', 'get'); | ||
$this->url(null); | ||
$this->can(true); | ||
} | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
Vilt/Resources/NotificationsResource/Actions/TemplatesAction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
|
||
namespace Modules\Notifications\Vilt\Resources\NotificationsResource\Actions; | ||
|
||
use Modules\Base\Services\Components\Actions; | ||
|
||
class TemplatesAction extends Actions | ||
{ | ||
public function setup(): void | ||
{ | ||
$this->name("templates"); | ||
$this->label(__('Templates')); | ||
$this->type("success"); | ||
$this->icon(""); | ||
$this->modal(null); | ||
$this->action("notifiactions_templates.index", "get"); | ||
$this->url(null); | ||
$this->can(true); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Vilt/Resources/NotificationsResource/Traits/Translations.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
|
||
namespace Modules\Notifications\Vilt\Resources\NotificationsResource\Traits; | ||
|
||
trait Translations | ||
{ | ||
public function loadTranslations(): array | ||
{ | ||
return [ | ||
"index" => __(" Notifications"), | ||
"create" => __('Create ' . " Notification"), | ||
"bulk" => __('Delete Selected ' . " Notification"), | ||
"edit_title" => __('Edit ' . " Notification"), | ||
"create_title" => __('Create New ' . " Notification"), | ||
"view_title" => __('View ' . " Notification"), | ||
"delete_title" => __('Delete ' . " Notification"), | ||
"bulk_title" => __('Run Bulk Action To ' . " Notification"), | ||
]; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Vilt/Resources/TemplatesResource/Actions/NotificationAction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
|
||
namespace Modules\Notifications\Vilt\Resources\TemplatesResource\Actions; | ||
|
||
use Modules\Base\Services\Components\Actions; | ||
|
||
class NotificationAction extends Actions | ||
{ | ||
public function setup(): void | ||
{ | ||
$this->name("notification"); | ||
$this->label(__('Back')); | ||
$this->type("success"); | ||
$this->icon(""); | ||
$this->modal(null); | ||
$this->action("user_notifications.index", "get"); | ||
$this->url(null); | ||
$this->can(true); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.