Add a new menu entry
This is only a placeholder for now, it does not send to a real page yet.
This commit is contained in:
parent
1c456d4aca
commit
5beaf94f3a
4 changed files with 55 additions and 1 deletions
15
Http/Controllers/CustomersGroupsController.php
Normal file
15
Http/Controllers/CustomersGroupsController.php
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Modules\MMFCustomersGroups\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Routing\Controller;
|
||||||
|
|
||||||
|
class CustomersGroupsController extends Controller {
|
||||||
|
public function list() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,6 +13,6 @@ Route::group(
|
||||||
'namespace' => 'Modules\MMFCustomersGroups\Http\Controllers'
|
'namespace' => 'Modules\MMFCustomersGroups\Http\Controllers'
|
||||||
],
|
],
|
||||||
function() {
|
function() {
|
||||||
// TODO
|
Route::get('/groups/list', ['uses' => CustomersGroupsController::class . '@list', 'laroute' => true])->name('groups.list');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -23,7 +23,9 @@ class MMFCustomersGroupsServiceProvider extends ServiceProvider {
|
||||||
*/
|
*/
|
||||||
public function boot() {
|
public function boot() {
|
||||||
$this->registerConfig();
|
$this->registerConfig();
|
||||||
|
$this->registerViews();
|
||||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||||
|
$this->hooks();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,4 +50,33 @@ class MMFCustomersGroupsServiceProvider extends ServiceProvider {
|
||||||
public function provides() {
|
public function provides() {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register views.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function registerViews() {
|
||||||
|
$viewPath = resource_path('views/modules/mmfcustomersgroups');
|
||||||
|
|
||||||
|
$sourcePath = __DIR__.'/../Resources/views';
|
||||||
|
|
||||||
|
$this->publishes([
|
||||||
|
$sourcePath => $viewPath,
|
||||||
|
],'views');
|
||||||
|
|
||||||
|
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
||||||
|
return $path . '/modules/mmfcustomersgroups';
|
||||||
|
}, \Config::get('view.paths')), [$sourcePath]), 'mmfcustomersgroups');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module hooks.
|
||||||
|
*/
|
||||||
|
public function hooks() {
|
||||||
|
// Add a menu entry to manage the customer groups.
|
||||||
|
\Eventy::addAction('menu.manage.after_mailboxes', function() {
|
||||||
|
echo \View::make('mmfcustomersgroups::partials/menu', [])->render();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
8
Resources/views/partials/menu.blade.php
Normal file
8
Resources/views/partials/menu.blade.php
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<li class=""><a href="{{ route('groups.list') }}">{{ __('Customers groups') }}</a></li>
|
Loading…
Reference in a new issue