Added new event for menu create method..
This commit is contained in:
parent
22faf0f1e4
commit
c9b2dcdaf7
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Menu;
|
||||
|
||||
use App\Abstracts\Event;
|
||||
|
||||
class AdminCreating extends Event
|
||||
{
|
||||
public $menu;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $menu
|
||||
*/
|
||||
public function __construct($menu)
|
||||
{
|
||||
$this->menu = $menu;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Menu;
|
||||
|
||||
use App\Abstracts\Event;
|
||||
|
||||
class NewwCreating extends Event
|
||||
{
|
||||
public $menu;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $menu
|
||||
*/
|
||||
public function __construct($menu)
|
||||
{
|
||||
$this->menu = $menu;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Menu;
|
||||
|
||||
use App\Abstracts\Event;
|
||||
|
||||
class NotificationsCreating extends Event
|
||||
{
|
||||
public $notifications;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $notifications
|
||||
*/
|
||||
public function __construct($notifications)
|
||||
{
|
||||
$this->notifications = $notifications;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Menu;
|
||||
|
||||
use App\Abstracts\Event;
|
||||
|
||||
class PortalCreating extends Event
|
||||
{
|
||||
public $menu;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $menu
|
||||
*/
|
||||
public function __construct($menu)
|
||||
{
|
||||
$this->menu = $menu;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Menu;
|
||||
|
||||
use App\Abstracts\Event;
|
||||
|
||||
class ProfileCreating extends Event
|
||||
{
|
||||
public $menu;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $menu
|
||||
*/
|
||||
public function __construct($menu)
|
||||
{
|
||||
$this->menu = $menu;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Menu;
|
||||
|
||||
use App\Abstracts\Event;
|
||||
|
||||
class SettingsCreating extends Event
|
||||
{
|
||||
public $menu;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $menu
|
||||
*/
|
||||
public function __construct($menu)
|
||||
{
|
||||
$this->menu = $menu;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Events\Menu;
|
||||
|
||||
use App\Abstracts\Event;
|
||||
|
||||
class SettingsFinished extends Event
|
||||
{
|
||||
public $menu;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $menu
|
||||
*/
|
||||
public function __construct($menu)
|
||||
{
|
||||
$this->menu = $menu;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Livewire\Menu;
|
||||
|
||||
use App\Events\Menu\NewwCreated;
|
||||
use App\Events\Menu\NewwCreating;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Str;
|
||||
use Livewire\Component;
|
||||
|
|
@ -24,6 +25,8 @@ class Neww extends Component
|
|||
menu()->create('neww', function ($menu) {
|
||||
$menu->style('tailwind');
|
||||
|
||||
event(new NewwCreating($menu));
|
||||
|
||||
event(new NewwCreated($menu));
|
||||
|
||||
foreach($menu->getItems() as $item) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Livewire\Menu;
|
||||
|
||||
use App\Events\Menu\NotificationsCreated;
|
||||
use App\Events\Menu\NotificationsCreating;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Notifications\DatabaseNotification;
|
||||
use Illuminate\Support\Str;
|
||||
|
|
@ -88,6 +89,8 @@ class Notifications extends Component
|
|||
$notifications->notifications = collect();
|
||||
$notifications->keyword = $this->keyword;
|
||||
|
||||
event(new NotificationsCreating($notifications));
|
||||
|
||||
event(new NotificationsCreated($notifications));
|
||||
|
||||
$rows = [];
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Livewire\Menu;
|
||||
|
||||
use App\Events\Menu\ProfileCreated;
|
||||
use App\Events\Menu\ProfileCreating;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Livewire\Component;
|
||||
|
||||
|
|
@ -15,6 +16,8 @@ class Profile extends Component
|
|||
menu()->create('profile', function ($menu) {
|
||||
$menu->style('tailwind');
|
||||
|
||||
event(new ProfileCreating($menu));
|
||||
|
||||
event(new ProfileCreated($menu));
|
||||
|
||||
foreach($menu->getItems() as $item) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
namespace App\Http\Livewire\Menu;
|
||||
|
||||
use App\Events\Menu\SettingsCreated;
|
||||
use App\Events\Menu\SettingsCreating;
|
||||
use App\Events\Menu\SettingsFinished;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Str;
|
||||
use Livewire\Component;
|
||||
|
|
@ -26,6 +28,7 @@ class Settings extends Component
|
|||
menu()->create('settings', function ($menu) {
|
||||
$menu->style('tailwind');
|
||||
|
||||
event(new SettingsCreating($menu));
|
||||
event(new SettingsCreated($menu));
|
||||
|
||||
$this->addSettingsOfModulesFromJsonFile($menu);
|
||||
|
|
@ -41,6 +44,9 @@ class Settings extends Component
|
|||
|
||||
$menu->removeByTitle($item->title);
|
||||
}
|
||||
|
||||
#todo event name must be changed to SettingsCreated
|
||||
event(new SettingsFinished($menu));
|
||||
});
|
||||
|
||||
return view('livewire.menu.settings');
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Events\Menu\AdminCreated;
|
||||
use App\Events\Menu\AdminCreating;
|
||||
use Closure;
|
||||
|
||||
class AdminMenu
|
||||
|
|
@ -24,6 +25,8 @@ class AdminMenu
|
|||
menu()->create('admin', function ($menu) {
|
||||
$menu->style('tailwind');
|
||||
|
||||
event(new AdminCreating($menu));
|
||||
|
||||
event(new AdminCreated($menu));
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Events\Menu\PortalCreated;
|
||||
use App\Events\Menu\PortalCreating;
|
||||
use Closure;
|
||||
|
||||
class PortalMenu
|
||||
|
|
@ -24,6 +25,8 @@ class PortalMenu
|
|||
menu()->create('portal', function ($menu) {
|
||||
$menu->style('tailwind');
|
||||
|
||||
event(new PortalCreating($menu));
|
||||
|
||||
event(new PortalCreated($menu));
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue