Last active
May 19, 2020 15:07
-
-
Save mhmohon/74802508fdf41efb4856af2b6a9549ee to your computer and use it in GitHub Desktop.
Change vendor file in crestapps (Crud function create from database table)
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
**Change view directory** | |
Add this code to config/laravel-code-generator.php. | |
'views_path' => base_path('app/Interfaces/Resources/views/admin/modules/riskmanagement/fraud/'), | |
vendor\crestapps\laravel-code-generator\src\Commands\Bases\ViewsCommandBase.php in this file change getDestinationPath() method. | |
$path = config('laravel-code-generator.views_path'); | |
**Change route directory** | |
Add this code to config/laravel-code-generator.php. | |
'routes_path' => app_path('Domain/Admin/Modules/FraudManagement/Routes/'), | |
In vendor\crestapps\laravel-code-generator\src\Commands\Framework\CreateRoutesCommand.php file in getRoutesFileName() method | |
add this line return config('laravel-code-generator.routes_path'). $file . '.php'; | |
**Change Controller, modal, from_request, resource directory** | |
Copy Controller, modal, from_request, resource path default.php to laravel-code-generator.php | |
For controller: | |
Add this code to config/laravel-code-generator.php. | |
'controllers_extends_path' => 'App\Interfaces\Http\Controllers\Controller', | |
vendor\crestapps\laravel-code-generator\src\Commands\Framework\CreateScaffoldCommand.php in this file createController() method | |
'--controller-extends' => config('laravel-code-generator.controllers_extends_path') | |
**Change Kernel file location directory** | |
Change file vendor\crestapps\laravel-code-generator\src\Commands\Framework\CreateFormRequestCommand.php. method isConvertEmptyStringsToNullRegistered() | |
$kernal = $this->getLaravel()->make(\App\Interfaces\Http\Kernel::class); | |
**use commands** | |
php artisan resource-file:from-database RuleAction --table-name=rule_actions --force | |
this will create a resource json file in resource folder, change in that file to like added by, updated_by, etc. | |
than use this command: | |
php artisan create:scaffold RuleAction --with-form-request --with-migration --force |
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
Add this code to config/laravel-code-generator.php. | |
'models_namespaces' => 'ModelRoot\Fraudrule', | |
By using this command we can generate faker file and test case with a json file | |
php artisan create:testcases RuleAction --resource-file=resources\laravel-code-generator\sources\rule_actions.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment