new helpdesk module

This commit is contained in:
Mark Gregory
2026-06-12 09:41:57 +01:00
parent 67c9bb22d9
commit da35c7eb95
50 changed files with 1874 additions and 270 deletions
@@ -1,69 +1,49 @@
<?php
declare(strict_types=1);
namespace Modules\Helpdesk\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;
use Modules\Helpdesk\Support\ModuleInfo;
class RouteServiceProvider extends ServiceProvider
final class RouteServiceProvider extends ServiceProvider
{
/**
* The module namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $moduleNamespace = 'Modules\Helpdesk\Http\Controllers';
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
* Define module routes.
*
* @return void
*/
public function boot()
{
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
public function map(): void
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
* Define web routes.
*
* @return void
*/
protected function mapWebRoutes()
protected function mapWebRoutes(): void
{
Route::middleware('web')
->namespace($this->moduleNamespace)
->group(module_path('Helpdesk', '/Routes/web.php'));
Route::middleware(config('helpdesk.middleware', ['web', 'auth']))
->prefix(config('helpdesk.route_prefix', 'helpdesk'))
->name('helpdesk.')
->group(module_path(ModuleInfo::name(), 'Routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
* Define API routes.
*
* @return void
*/
protected function mapApiRoutes()
protected function mapApiRoutes(): void
{
Route::prefix('api')
Route::prefix('api/helpdesk')
->middleware('api')
->namespace($this->moduleNamespace)
->group(module_path('Helpdesk', '/Routes/api.php'));
->name('api.helpdesk.')
->group(module_path(ModuleInfo::name(), 'Routes/api.php'));
}
}