Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
536535e4
Unverified
Commit
536535e4
authored
Jul 21, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using new sidebar event listener
parent
4ff96528
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
20 deletions
+14
-20
RegisterSettingSidebar.php
Modules/Setting/Events/Handlers/RegisterSettingSidebar.php
+4
-19
SettingServiceProvider.php
Modules/Setting/Providers/SettingServiceProvider.php
+9
-1
changelog.yml
Modules/Setting/changelog.yml
+1
-0
No files found.
Modules/Setting/
Sidebar/SidebarExtende
r.php
→
Modules/Setting/
Events/Handlers/RegisterSettingSideba
r.php
View file @
536535e4
<?php
<?php
namespace
Modules\Setting\
Sidebar
;
namespace
Modules\Setting\
Events\Handlers
;
use
Maatwebsite\Sidebar\Group
;
use
Maatwebsite\Sidebar\Group
;
use
Maatwebsite\Sidebar\Item
;
use
Maatwebsite\Sidebar\Item
;
use
Maatwebsite\Sidebar\Menu
;
use
Maatwebsite\Sidebar\Menu
;
use
Modules\
User\Contracts\Authentication
;
use
Modules\
Core\Sidebar\AbstractAdminSidebar
;
class
SidebarExtender
implements
\Maatwebsite\Sidebar\SidebarExtende
r
class
RegisterSettingSidebar
extends
AbstractAdminSideba
r
{
{
/**
/**
* @var Authentication
* Method used to define your sidebar menu groups and items
*/
protected
$auth
;
/**
* @param Authentication $auth
*
* @internal param Guard $guard
*/
public
function
__construct
(
Authentication
$auth
)
{
$this
->
auth
=
$auth
;
}
/**
* @param Menu $menu
* @param Menu $menu
*
* @return Menu
* @return Menu
*/
*/
public
function
extendWith
(
Menu
$menu
)
public
function
extendWith
(
Menu
$menu
)
...
...
Modules/Setting/Providers/SettingServiceProvider.php
View file @
536535e4
...
@@ -4,9 +4,12 @@ namespace Modules\Setting\Providers;
...
@@ -4,9 +4,12 @@ namespace Modules\Setting\Providers;
use
Illuminate\Foundation\AliasLoader
;
use
Illuminate\Foundation\AliasLoader
;
use
Illuminate\Support\ServiceProvider
;
use
Illuminate\Support\ServiceProvider
;
use
Modules\Core\Events\BuildingSidebar
;
use
Modules\Core\Traits\CanGetSidebarClassForModule
;
use
Modules\Core\Traits\CanPublishConfiguration
;
use
Modules\Core\Traits\CanPublishConfiguration
;
use
Modules\Setting\Blade\SettingDirective
;
use
Modules\Setting\Blade\SettingDirective
;
use
Modules\Setting\Entities\Setting
;
use
Modules\Setting\Entities\Setting
;
use
Modules\Setting\Events\Handlers\RegisterSettingSidebar
;
use
Modules\Setting\Facades\Settings
as
SettingsFacade
;
use
Modules\Setting\Facades\Settings
as
SettingsFacade
;
use
Modules\Setting\Repositories\Cache\CacheSettingDecorator
;
use
Modules\Setting\Repositories\Cache\CacheSettingDecorator
;
use
Modules\Setting\Repositories\Eloquent\EloquentSettingRepository
;
use
Modules\Setting\Repositories\Eloquent\EloquentSettingRepository
;
...
@@ -15,7 +18,7 @@ use Modules\Setting\Support\Settings;
...
@@ -15,7 +18,7 @@ use Modules\Setting\Support\Settings;
class
SettingServiceProvider
extends
ServiceProvider
class
SettingServiceProvider
extends
ServiceProvider
{
{
use
CanPublishConfiguration
;
use
CanPublishConfiguration
,
CanGetSidebarClassForModule
;
/**
/**
* Indicates if loading of the provider is deferred.
* Indicates if loading of the provider is deferred.
*
*
...
@@ -44,6 +47,11 @@ class SettingServiceProvider extends ServiceProvider
...
@@ -44,6 +47,11 @@ class SettingServiceProvider extends ServiceProvider
$this
->
app
->
bind
(
'setting.setting.directive'
,
function
()
{
$this
->
app
->
bind
(
'setting.setting.directive'
,
function
()
{
return
new
SettingDirective
();
return
new
SettingDirective
();
});
});
$this
->
app
[
'events'
]
->
listen
(
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'setting'
,
RegisterSettingSidebar
::
class
)
);
}
}
public
function
boot
()
public
function
boot
()
...
...
Modules/Setting/changelog.yml
View file @
536535e4
...
@@ -6,6 +6,7 @@ versions:
...
@@ -6,6 +6,7 @@ versions:
-
Normalise the setting was updated event
-
Normalise the setting was updated event
-
Trigger <code>SettingIsCreating</code> hook
-
Trigger <code>SettingIsCreating</code> hook
-
Trigger <code>SettingIsUpdating</code> hook
-
Trigger <code>SettingIsUpdating</code> hook
-
New Sidebar event handler class replacing the old <code>SidebarExtender</code> class
changed
:
changed
:
-
Using the @push js stacks over the scripts section
-
Using the @push js stacks over the scripts section
-
Using the @push css stacks over the styles section
-
Using the @push css stacks over the styles section
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment