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
1db2ee6c
Unverified
Commit
1db2ee6c
authored
Jul 17, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creating new stub files for the sidebar listeners
parent
46900237
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
0 deletions
+93
-0
sidebar-listener-empty.stub
...orkshop/Scaffold/Module/stubs/sidebar-listener-empty.stub
+41
-0
sidebar-listener.stub
Modules/Workshop/Scaffold/Module/stubs/sidebar-listener.stub
+52
-0
No files found.
Modules/Workshop/Scaffold/Module/stubs/sidebar-listener-empty.stub
0 → 100644
View file @
1db2ee6c
<?php
namespace
Modules
\
$MODULE_NAME
$
\Events\Handlers
;
use
Maatwebsite\Sidebar\Group
;
use
Maatwebsite\Sidebar\Item
;
use
Maatwebsite\Sidebar\Menu
;
use
Modules\Core\Events\BuildingSidebar
;
use
Modules\User\Contracts\Authentication
;
class
$
CLASS_NAME
$
implements
\Maatwebsite\Sidebar\SidebarExtender
{
/**
* @var Authentication
*/
protected
$auth
;
/**
* @param Authentication $auth
*
* @internal param Guard $guard
*/
public
function
__construct
(
Authentication
$auth
)
{
$this
->
auth
=
$auth
;
}
public
function
handle
(
BuildingSidebar
$sidebar
)
{
$sidebar
->
add
(
$this
->
extendWith
(
$sidebar
->
getMenu
()));
}
/**
* @param Menu $menu
* @return Menu
*/
public
function
extendWith
(
Menu
$menu
)
{
return
$menu
;
}
}
Modules/Workshop/Scaffold/Module/stubs/sidebar-listener.stub
0 → 100644
View file @
1db2ee6c
<?php
namespace
Modules
\
$MODULE_NAME
$
\Events\Handlers
;
use
Maatwebsite\Sidebar\Group
;
use
Maatwebsite\Sidebar\Item
;
use
Maatwebsite\Sidebar\Menu
;
use
Modules\Core\Events\BuildingSidebar
;
use
Modules\User\Contracts\Authentication
;
class
$
CLASS_NAME
$
implements
\Maatwebsite\Sidebar\SidebarExtender
{
/**
* @var Authentication
*/
protected
$auth
;
/**
* @param Authentication $auth
*
* @internal param Guard $guard
*/
public
function
__construct
(
Authentication
$auth
)
{
$this
->
auth
=
$auth
;
}
public
function
handle
(
BuildingSidebar
$sidebar
)
{
$sidebar
->
add
(
$this
->
extendWith
(
$sidebar
->
getMenu
()));
}
/**
* @param Menu $menu
* @return Menu
*/
public
function
extendWith
(
Menu
$menu
)
{
$menu
->
group
(
trans
(
'core::sidebar.content'
),
function
(
Group
$group
)
{
$group
->
item
(
trans
(
'$LOWERCASE_MODULE_NAME$::$PLURAL_LOWERCASE_MODULE_NAME$.title.$PLURAL_LOWERCASE_MODULE_NAME$'
),
function
(
Item
$item
)
{
$item
->
icon
(
'fa fa-copy'
);
$item
->
weight
(
10
);
$item
->
authorize
(
/* append */
);
// append
});
});
return
$menu
;
}
}
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