-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #360 from nasirkhan/update
nasirkhan/module-manager package installed
- Loading branch information
Showing
79 changed files
with
1,313 additions
and
1,130 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,64 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Module Config | ||
|-------------------------------------------------------------------------- | ||
| | ||
*/ | ||
|
||
'namespace' => 'Modules', | ||
|
||
'stubs' => [ | ||
'path' => base_path('stubs/laravel-starter-stubs'), | ||
], | ||
|
||
'module' => [ | ||
'files' => [ | ||
'composer' => ['composer.stub', 'composer.json'], | ||
'json' => ['module.stub', 'module.json'], | ||
'config' => ['Config/config.stub', 'Config/config.php'], | ||
'database' => ['database/migrations/stubMigration.stub', 'database/migrations/stubMigration.php', 'rename'], | ||
'factories' => ['database/factories/stubFactory.stub', 'database/factories/stubFactory.php', 'rename'], | ||
'seeders' => ['database/seeders/stubSeeders.stub', 'database/seeders/stubSeeders.php', 'rename'], | ||
'command' => ['Console/Commands/StubCommand.stub', 'Console/Commands/StubCommand.php', 'rename'], | ||
'lang' => ['lang/en/text.stub', 'lang/en/text.php'], | ||
'models' => ['Models/stubModel.stub', 'Models/stubModel.php'], | ||
'providersRoute' => ['Providers/RouteServiceProvider.stub', 'Providers/RouteServiceProvider.php'], | ||
'providers' => ['Providers/stubServiceProvider.stub', 'Providers/stubServiceProvider.php'], | ||
'route_web' => ['routes/web.stub', 'routes/web.php'], | ||
'route_api' => ['routes/api.stub', 'routes/api.php'], | ||
'controller_backend' => ['Http/Controllers/Backend/stubBackendController.stub', 'Http/Controllers/Backend/stubBackendController.php'], | ||
'controller_frontend' => ['Http/Controllers/Frontend/stubFrontendController.stub', 'Http/Controllers/Frontend/stubFrontendController.php'], | ||
'middleware_menu' => ['Http/Middleware/GenerateMenus.stub', 'Http/Middleware/GenerateMenus.php'], | ||
'views_backend_index' => ['Resources/views/backend/stubViews/index.blade.stub', 'Resources/views/backend/stubViews/index.blade.php'], | ||
'views_backend_index_datatable' => ['Resources/views/backend/stubViews/index_datatable.blade.stub', 'Resources/views/backend/stubViews/index_datatable.blade.php'], | ||
'views_backend_create' => ['Resources/views/backend/stubViews/create.blade.stub', 'Resources/views/backend/stubViews/create.blade.php'], | ||
'views_backend_form' => ['Resources/views/backend/stubViews/form.blade.stub', 'Resources/views/backend/stubViews/form.blade.php'], | ||
'views_backend_show' => ['Resources/views/backend/stubViews/show.blade.stub', 'Resources/views/backend/stubViews/show.blade.php'], | ||
'views_backend_edit' => ['Resources/views/backend/stubViews/edit.blade.stub', 'Resources/views/backend/stubViews/edit.blade.php'], | ||
'views_backend_trash' => ['Resources/views/backend/stubViews/trash.blade.stub', 'Resources/views/backend/stubViews/trash.blade.php'], | ||
'views_frontend_index' => ['Resources/views/frontend/stubViews/index.blade.stub', 'Resources/views/frontend/stubViews/index.blade.php'], | ||
'views_frontend_show' => ['Resources/views/frontend/stubViews/show.blade.stub', 'Resources/views/frontend/stubViews/show.blade.php'], | ||
], | ||
], | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Module Composer | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Config for the composer.json file | ||
| | ||
*/ | ||
|
||
'composer' => [ | ||
'vendor' => 'nasirkhan', | ||
'author' => [ | ||
'name' => 'Nasir Khan', | ||
'email' => '[email protected]', | ||
], | ||
], | ||
]; |
File renamed without changes.
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,5 @@ | ||
<?php | ||
|
||
return [ | ||
'name' => '{{moduleName}}', | ||
]; |
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
stubs/laravel-starter-stubs/Console/Commands/StubCommand.stub
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 {{namespace}}\{{moduleName}}\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
|
||
class {{moduleName}}Command extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'command:{{moduleName}}Command'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = '{{moduleName}} Command description'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return int | ||
*/ | ||
public function handle() | ||
{ | ||
return Command::SUCCESS; | ||
} | ||
} |
Empty file.
30 changes: 30 additions & 0 deletions
30
stubs/laravel-starter-stubs/Http/Controllers/Backend/stubBackendController.stub
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 {{namespace}}\{{moduleName}}\Http\Controllers\Backend; | ||
|
||
use App\Authorizable; | ||
use App\Http\Controllers\Backend\BackendBaseController; | ||
|
||
class {{moduleNamePlural}}Controller extends BackendBaseController | ||
{ | ||
use Authorizable; | ||
|
||
public function __construct() | ||
{ | ||
// Page Title | ||
$this->module_title = '{{moduleNamePlural}}'; | ||
|
||
// module name | ||
$this->module_name = '{{moduleNameLowerPlural}}'; | ||
|
||
// directory path of the module | ||
$this->module_path = '{{moduleNameLower}}::backend'; | ||
|
||
// module icon | ||
$this->module_icon = 'fa-regular fa-sun'; | ||
|
||
// module model name, path | ||
$this->module_model = "{{namespace}}\{{moduleName}}\Models\{{moduleName}}"; | ||
} | ||
|
||
} |
79 changes: 79 additions & 0 deletions
79
stubs/laravel-starter-stubs/Http/Controllers/Frontend/stubFrontendController.stub
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,79 @@ | ||
<?php | ||
|
||
namespace {{namespace}}\{{moduleName}}\Http\Controllers\Frontend; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Illuminate\Http\Response; | ||
use Illuminate\Support\Str; | ||
|
||
class {{moduleNamePlural}}Controller extends Controller | ||
{ | ||
public function __construct() | ||
{ | ||
// Page Title | ||
$this->module_title = '{{moduleNamePlural}}'; | ||
|
||
// module name | ||
$this->module_name = '{{moduleNameLowerPlural}}'; | ||
|
||
// directory path of the module | ||
$this->module_path = '{{moduleNameLower}}::backend'; | ||
|
||
// module icon | ||
$this->module_icon = 'fa-regular fa-sun'; | ||
|
||
// module model name, path | ||
$this->module_model = "{{namespace}}\{{moduleName}}\Models\{{moduleName}}"; | ||
} | ||
|
||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @return Response | ||
*/ | ||
public function index() | ||
{ | ||
$module_title = $this->module_title; | ||
$module_name = $this->module_name; | ||
$module_path = $this->module_path; | ||
$module_icon = $this->module_icon; | ||
$module_model = $this->module_model; | ||
$module_name_singular = Str::singular($module_name); | ||
|
||
$module_action = 'List'; | ||
|
||
$$module_name = $module_model::latest()->paginate(); | ||
|
||
return view( | ||
"{{moduleNameLower}}::frontend.$module_path.index", | ||
compact('module_title', 'module_name', "$module_name", 'module_icon', 'module_action', 'module_name_singular') | ||
); | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
* | ||
* @param int $id | ||
* @return Response | ||
*/ | ||
public function show($id) | ||
{ | ||
$id = decode_id($id); | ||
|
||
$module_title = $this->module_title; | ||
$module_name = $this->module_name; | ||
$module_path = $this->module_path; | ||
$module_icon = $this->module_icon; | ||
$module_model = $this->module_model; | ||
$module_name_singular = Str::singular($module_name); | ||
|
||
$module_action = 'Show'; | ||
|
||
$$module_name_singular = $module_model::findOrFail($id); | ||
|
||
return view( | ||
"{{moduleNameLower}}::frontend.$module_name.show", | ||
compact('module_title', 'module_name', 'module_icon', 'module_action', 'module_name_singular', "$module_name_singular", 'posts') | ||
); | ||
} | ||
} |
Empty file.
Oops, something went wrong.