Skip to content

Commit

Permalink
Update: nWidart/laravel-modules to ^6.x.
Browse files Browse the repository at this point in the history
Add: New config for Laravel modules including File Activator Class.
Add: modules_statuses.json
Fix: Workshop Module to add correctly the version 1.0.0.
  • Loading branch information
imagina committed Nov 4, 2020
1 parent c0b5792 commit fea5498
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Modules/Workshop/Scaffold/Module/ModuleScaffold.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private function setModuleOrderOrder($content)
*/
private function setModuleVersion($content)
{
return str_replace("\"active\"", "\"version\": \"1.0.0\",\n\t\"active\"", $content);
return str_replace("\"description\"", "\"version\": \"1.0.0\",\n\t\"description\"", $content);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"maatwebsite/laravel-sidebar": "^2.4",
"mcamara/laravel-localization": "^1.6",
"nwidart/laravel-menus": "^5.0",
"nwidart/laravel-modules": "^5.0",
"nwidart/laravel-modules": "^6.0",
"symfony/yaml": "^5.1",
"typicms/nestablecollection": "^1.1",
"venturecraft/revisionable": "^1.35",
Expand All @@ -43,6 +43,7 @@
"idavoll/translation-module": "4.0.x-dev",
"idavoll/user-module": "4.0.x-dev",
"idavoll/workshop-module": "4.0.x-dev"

},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.5",
Expand Down
3 changes: 2 additions & 1 deletion composer.travis.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
"maatwebsite/laravel-sidebar": "^2.4",
"mcamara/laravel-localization": "^1.6",
"nwidart/laravel-menus": "^5.0",
"nwidart/laravel-modules": "^5.0",
"nwidart/laravel-modules": "^6.0",
"symfony/yaml": "^5.1",
"typicms/nestablecollection": "^1.1",
"venturecraft/revisionable": "^1.35"

},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.5",
Expand Down
41 changes: 34 additions & 7 deletions config/modules.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Nwidart\Modules\Activators\FileActivator;

return [

/*
Expand All @@ -26,6 +28,8 @@
'enabled' => false,
'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs',
'files' => [
'routes/web' => 'Routes/web.php',
'routes/api' => 'Routes/api.php',
'views/index' => 'Resources/views/index.blade.php',
'views/master' => 'Resources/views/layouts/master.blade.php',
'scaffold/config' => 'Config/config.php',
Expand All @@ -39,7 +43,7 @@
'routes/web' => ['LOWER_NAME', 'STUDLY_NAME'],
'routes/api' => ['LOWER_NAME'],
'webpack' => ['LOWER_NAME'],
'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'],
'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'PROVIDER_NAMESPACE'],
'views/index' => ['LOWER_NAME'],
'views/master' => ['LOWER_NAME', 'STUDLY_NAME'],
'scaffold/config' => ['STUDLY_NAME'],
Expand All @@ -50,6 +54,7 @@
'AUTHOR_NAME',
'AUTHOR_EMAIL',
'MODULE_NAMESPACE',
'PROVIDER_NAMESPACE',
],
],
'gitkeep' => true,
Expand Down Expand Up @@ -101,17 +106,19 @@
'seeder' => ['path' => 'Database/Seeders', 'generate' => true],
'factory' => ['path' => 'Database/factories', 'generate' => true],
'model' => ['path' => 'Entities', 'generate' => true],
'routes' => ['path' => 'Routes', 'generate' => true],
'controller' => ['path' => 'Http/Controllers', 'generate' => true],
'filter' => ['path' => 'Http/Middleware', 'generate' => true],
'request' => ['path' => 'Http/Requests', 'generate' => true],
'provider' => ['path' => 'Providers', 'generate' => true],
'assets' => ['path' => 'Assets', 'generate' => true],
'assets' => ['path' => 'Resources/assets', 'generate' => true],
'lang' => ['path' => 'Resources/lang', 'generate' => true],
'views' => ['path' => 'Resources/views', 'generate' => true],
'test' => ['path' => 'Tests', 'generate' => true],
'repository' => ['path' => 'Repositories', 'generate' => true],
'event' => ['path' => 'Events', 'generate' => true],
'listener' => ['path' => 'Events/Handlers', 'generate' => true],
'test' => ['path' => 'Tests/Unit', 'generate' => true],
'test-feature' => ['path' => 'Tests/Feature', 'generate' => true],
'repository' => ['path' => 'Repositories', 'generate' => false],
'event' => ['path' => 'Events', 'generate' => false],
'listener' => ['path' => 'Listeners', 'generate' => false],
'policies' => ['path' => 'Policies', 'generate' => false],
'rules' => ['path' => 'Rules', 'generate' => false],
'jobs' => ['path' => 'Jobs', 'generate' => false],
Expand Down Expand Up @@ -173,7 +180,7 @@
|--------------------------------------------------------------------------
*/
'register' => [
'translations' => false,
'translations' => true,
/**
* load files on boot or register method
*
Expand All @@ -183,4 +190,24 @@
*/
'files' => 'register',
],

/*
|--------------------------------------------------------------------------
| Activators
|--------------------------------------------------------------------------
|
| You can define new types of activators here, file, database etc. The only
| required parameter is 'class'.
| The file activator will store the activation status in storage/installed_modules
*/
'activators' => [
'file' => [
'class' => FileActivator::class,
'statuses-file' => base_path('modules_statuses.json'),
'cache-key' => 'activator.installed',
'cache-lifetime' => 604800,
],
],

'activator' => 'file',
];
12 changes: 12 additions & 0 deletions modules_statuses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Core": true,
"Dashboard": true,
"Media": true,
"Menu": true,
"Page": true,
"Setting": true,
"Tag": true,
"Translation": true,
"User": true,
"Workshop": true
}

0 comments on commit fea5498

Please sign in to comment.