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
b68e85a4
Unverified
Commit
b68e85a4
authored
Jul 24, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using new sidebar event listener for tag module
parent
ff240541
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
20 deletions
+13
-20
RegisterTagSidebar.php
Modules/Tag/Events/Handlers/RegisterTagSidebar.php
+4
-19
TagServiceProvider.php
Modules/Tag/Providers/TagServiceProvider.php
+8
-1
changelog.yml
Modules/Tag/changelog.yml
+1
-0
No files found.
Modules/Tag/
Sidebar/SidebarExtende
r.php
→
Modules/Tag/
Events/Handlers/RegisterTagSideba
r.php
View file @
b68e85a4
<?php
namespace
Modules\Tag\
Sidebar
;
namespace
Modules\Tag\
Events\Handlers
;
use
Maatwebsite\Sidebar\Group
;
use
Maatwebsite\Sidebar\Item
;
use
Maatwebsite\Sidebar\Menu
;
use
Modules\
User\Contracts\Authentication
;
use
Modules\
Core\Sidebar\AbstractAdminSidebar
;
class
SidebarExtender
implements
\Maatwebsite\Sidebar\SidebarExtende
r
class
RegisterTagSidebar
extends
AbstractAdminSideba
r
{
/**
* @var Authentication
*/
protected
$auth
;
/**
* @param Authentication $auth
*
* @internal param Guard $guard
*/
public
function
__construct
(
Authentication
$auth
)
{
$this
->
auth
=
$auth
;
}
/**
* Method used to define your sidebar menu groups and items
* @param Menu $menu
*
* @return Menu
*/
public
function
extendWith
(
Menu
$menu
)
...
...
Modules/Tag/Providers/TagServiceProvider.php
View file @
b68e85a4
...
...
@@ -3,9 +3,12 @@
namespace
Modules\Tag\Providers
;
use
Illuminate\Support\ServiceProvider
;
use
Modules\Core\Events\BuildingSidebar
;
use
Modules\Core\Traits\CanGetSidebarClassForModule
;
use
Modules\Core\Traits\CanPublishConfiguration
;
use
Modules\Tag\Blade\TagWidget
;
use
Modules\Tag\Entities\Tag
;
use
Modules\Tag\Events\Handlers\RegisterTagSidebar
;
use
Modules\Tag\Repositories\Cache\CacheTagDecorator
;
use
Modules\Tag\Repositories\Eloquent\EloquentTagRepository
;
use
Modules\Tag\Repositories\TagManager
;
...
...
@@ -14,7 +17,7 @@ use Modules\Tag\Repositories\TagRepository;
class
TagServiceProvider
extends
ServiceProvider
{
use
CanPublishConfiguration
;
use
CanPublishConfiguration
,
CanGetSidebarClassForModule
;
/**
* Indicates if loading of the provider is deferred.
*
...
...
@@ -34,6 +37,10 @@ class TagServiceProvider extends ServiceProvider
$this
->
app
->
singleton
(
'tag.widget.directive'
,
function
(
$app
)
{
return
new
TagWidget
(
$app
[
TagRepository
::
class
]);
});
$this
->
app
[
'events'
]
->
listen
(
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'tag'
,
RegisterTagSidebar
::
class
)
);
}
public
function
boot
()
...
...
Modules/Tag/changelog.yml
View file @
b68e85a4
...
...
@@ -8,6 +8,7 @@ versions:
changed
:
-
Using the @push js stacks over the scripts section
-
Using the @push css stacks over the styles section
-
Sidebar is now loaded via the <code>BuildingSidebar</code> hook
"
2.1.0"
:
changed
:
-
Fixed tags not being removed probably on update & delete
...
...
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