Skip to content

Instantly share code, notes, and snippets.

@mhmohon
Last active May 19, 2020 15:07
Show Gist options
  • Save mhmohon/74802508fdf41efb4856af2b6a9549ee to your computer and use it in GitHub Desktop.
Save mhmohon/74802508fdf41efb4856af2b6a9549ee to your computer and use it in GitHub Desktop.
Change vendor file in crestapps (Crud function create from database table)
**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
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