{"action":"created","issue":{"url":"https://api.github.com/repos/nWidart/laravel-modules/issues/171","repository_url":"https://api.github.com/repos/nWidart/laravel-modules","labels_url":"https://api.github.com/repos/nWidart/laravel-modules/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/nWidart/laravel-modules/issues/171/comments","events_url":"https://api.github.com/repos/nWidart/laravel-modules/issues/171/events","html_url":"https://github.com/nWidart/laravel-modules/issues/171","id":215022340,"number":171,"title":"Is it the best way to enable/disable module?","user":{"login":"bashet","id":2969902,"avatar_url":"https://avatars2.githubusercontent.com/u/2969902?v=4","gravatar_id":"","url":"https://api.github.com/users/bashet","html_url":"https://github.com/bashet","followers_url":"https://api.github.com/users/bashet/followers","following_url":"https://api.github.com/users/bashet/following{/other_user}","gists_url":"https://api.github.com/users/bashet/gists{/gist_id}","starred_url":"https://api.github.com/users/bashet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bashet/subscriptions","organizations_url":"https://api.github.com/users/bashet/orgs","repos_url":"https://api.github.com/users/bashet/repos","events_url":"https://api.github.com/users/bashet/events{/privacy}","received_events_url":"https://api.github.com/users/bashet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2017-03-17T14:38:12Z","updated_at":"2018-02-06T21:04:43Z","closed_at":null,"author_association":"NONE","body":"Sorry, if this feels stupid!\r\n\r\nWhen I command \"php artisan module:enable MyModule\", it's overriding the status in module.json file! My concern is, MyModule has git repository and each time I change the status, I won't be able to git pull without \"git stash\"! Or should I git ignore the module.json file to overcome this situation?\r\n\r\nMy understanding, it would be nice to make enable/disable by using database or any other config file but has to be out site of that module.\r\n\r\nSorry if I am confusing! :("},"comment":{"url":"https://api.github.com/repos/nWidart/laravel-modules/issues/comments/363563965","html_url":"https://github.com/nWidart/laravel-modules/issues/171#issuecomment-363563965","issue_url":"https://api.github.com/repos/nWidart/laravel-modules/issues/171","id":363563965,"user":{"login":"vmosoti","id":1621619,"avatar_url":"https://avatars2.githubusercontent.com/u/1621619?v=4","gravatar_id":"","url":"https://api.github.com/users/vmosoti","html_url":"https://github.com/vmosoti","followers_url":"https://api.github.com/users/vmosoti/followers","following_url":"https://api.github.com/users/vmosoti/following{/other_user}","gists_url":"https://api.github.com/users/vmosoti/gists{/gist_id}","starred_url":"https://api.github.com/users/vmosoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmosoti/subscriptions","organizations_url":"https://api.github.com/users/vmosoti/orgs","repos_url":"https://api.github.com/users/vmosoti/repos","events_url":"https://api.github.com/users/vmosoti/events{/privacy}","received_events_url":"https://api.github.com/users/vmosoti/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T21:04:43Z","updated_at":"2018-02-06T21:04:43Z","author_association":"NONE","body":"following @gmox 's comment; immediately after `module:make <module>`\r\n1) duplicate` module.json` and rename it to `module.json.example`\r\n2) create a `.gitignore` file and in it insert `module.json`\r\n\r\nI have extracted the following gist from a command i have written, that i have included in my deployment scripts, such that, everytime i deploy, it scans all module directories to check new modules and recreate the` module.json` file;\r\n\r\n ```php\r\npublic function handle()\r\n    {\r\n        $path = config('modules.paths.modules'); // modules path\r\n\r\n        $directories = glob($path . '/*', GLOB_ONLYDIR);\r\n\r\n        foreach ($directories as $directory) {\r\n\r\n            if (!file_exists($directory . DIRECTORY_SEPARATOR . 'module.json')) {\r\n\r\n                copy($directory . DIRECTORY_SEPARATOR . 'module.json.example', $directory . DIRECTORY_SEPARATOR . 'module.json');\r\n\r\n                $this->info('Copied module.json for ' . $directory);\r\n\r\n            } else {\r\n\r\n                $this->warn('module.json file for ' . $directory . ' already exists');\r\n            }\r\n        }\r\n    }\r\n```\r\nthat way, you don't have to worry about the `module.json` file \r\n\r\nFuture suggestions to the package:\r\n- @nWidart you could probably modify the `module:make` command to also do the following:\r\n1) create the `module.json.example`\r\n2) create `.gitignore` file and in it add `module.json`\r\n\r\nfrom there then it will be an individual to know how to do their deployment.\r\n\r\nHope this helps somebody.\r\n\r\n"}}
{"actor":{"display_login":"vmosoti"}}