-
-
Notifications
You must be signed in to change notification settings - Fork 956
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into enable-module-has-method-to-accept-both-lo…
…wercase-and-uppercase
- Loading branch information
Showing
422 changed files
with
1,291 additions
and
15,920 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Nwidart\Modules\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Nwidart\Modules\ModuleManifest; | ||
|
||
class ModuleClearCompiledCommand extends Command | ||
{ | ||
/** | ||
* The console command signature. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'module:clear-compiled'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Remove the module compiled class file'; | ||
|
||
public function handle(ModuleManifest $manifest): void | ||
{ | ||
if (is_file($manifest->manifestPath)) { | ||
@unlink($manifest->manifestPath); | ||
} | ||
|
||
$this->components->info('Compiled module files removed successfully.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Nwidart\Modules\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Nwidart\Modules\ModuleManifest; | ||
|
||
class ModuleDiscoverCommand extends Command | ||
{ | ||
/** | ||
* The console command signature. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'module:discover'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Create module compiled class file'; | ||
|
||
public function handle(ModuleManifest $manifest): void | ||
{ | ||
$this->components->info('Discovering modules'); | ||
|
||
$manifest->build(); | ||
|
||
collect($manifest->providersArray()) | ||
->map(fn ($provider) => preg_match('/Modules\\\\(.*?)\\\\/', $provider, $matches) ? $matches[1] : null) | ||
->unique() | ||
->each(fn ($description) => $this->components->task($description)) | ||
->whenNotEmpty(fn () => $this->newLine()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Nwidart\Modules\Constants; | ||
|
||
class ModuleEvent | ||
{ | ||
const BOOT = 'boot'; | ||
|
||
const REGISTER = 'register'; | ||
|
||
const DISABLING = 'disabling'; | ||
|
||
const DISABLED = 'disabled'; | ||
|
||
const ENABLING = 'enabling'; | ||
|
||
const ENABLED = 'enabled'; | ||
|
||
const CREATING = 'creating'; | ||
|
||
const CREATED = 'created'; | ||
|
||
const DELETING = 'deleting'; | ||
|
||
const DELETED = 'deleted'; | ||
|
||
const USED = 'used'; | ||
|
||
const UNUSED = 'unused'; | ||
} |
Oops, something went wrong.