new modules
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Users',
|
||||
'enabled' => true,
|
||||
];
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Users\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
final class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
$this->routes(function (): void {
|
||||
Route::middleware('web')->group(module_path('Users', 'Routes/web.php'));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Users\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Users\Support\ModuleInfo;
|
||||
|
||||
final class UsersServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
$this->mergeConfigFrom(module_path(ModuleInfo::name(), 'Config/config.php'), ModuleInfo::nameLower());
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
$this->loadMigrationsFrom(module_path(ModuleInfo::name(), 'Database/Migrations'));
|
||||
$this->loadViewsFrom(module_path(ModuleInfo::name(), 'Resources/views'), ModuleInfo::nameLower());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
// Module routes are intentionally registered by each feature as it is enabled.
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Users\Support;
|
||||
|
||||
final class ModuleInfo
|
||||
{
|
||||
public static function name(): string { return 'Users'; }
|
||||
public static function nameLower(): string { return 'users'; }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
it('boots the Users module', function (): void {
|
||||
expect(config('users.name'))->toBe('Users');
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "absdev/users-module",
|
||||
"description": "Users foundation module for the ABSDEV Laravel application platform.",
|
||||
"type": "laravel-module",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Users\\": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "Users",
|
||||
"alias": "users",
|
||||
"version": "1.0.0",
|
||||
"description": "Users foundation module for the ABSDEV Laravel application platform.",
|
||||
"keywords": [
|
||||
"laravel",
|
||||
"modules",
|
||||
"users"
|
||||
],
|
||||
"priority": 10,
|
||||
"providers": [
|
||||
"Modules\\Users\\Providers\\UsersServiceProvider"
|
||||
],
|
||||
"aliases": {},
|
||||
"files": [],
|
||||
"requires": [
|
||||
"Core"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user