Skip to content

Instantly share code, notes, and snippets.

@livevasiliy
Created June 20, 2019 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save livevasiliy/6a42e45d22ee94286d8197fbe5ba5d8e to your computer and use it in GitHub Desktop.
Save livevasiliy/6a42e45d22ee94286d8197fbe5ba5d8e to your computer and use it in GitHub Desktop.
My custom config for package infyom/laravel-generator
<?php
$modulePath = 'Modules\\' . env('CURRENT_MODULE');
$moduleNamespace = 'Modules\\'. env('CURRENT_MODULE'). '\\';
return [
/*
|--------------------------------------------------------------------------
| Paths
|--------------------------------------------------------------------------
|
*/
'path' => [
'migration' => base_path($modulePath . '\\Database\\Migrations/'),
'model' => base_path($modulePath . '\\Models/'),
'datatables' => base_path($modulePath . '\\DataTables/'),
'repository' => base_path($modulePath . '\\Repositories/'),
'routes' => base_path($modulePath . '\\Routes/web.php'),
'api_routes' => base_path($modulePath . '\\Routes/api.php'),
'request' => base_path($modulePath . '\\Http/Requests/'),
'api_request' => base_path($modulePath . '\\Http/Requests/API/'),
'controller' => base_path($modulePath . '\\Http/Controllers/'),
'api_controller' => base_path($modulePath . '\\Http/Controllers/API/'),
'test_trait' => base_path($modulePath . '\\Tests/Traits/'),
'repository_test' => base_path($modulePath . '\\Tests/Repositories/'),
'api_test' => base_path($modulePath . '\\Tests/APIs/'),
'tests' => base_path($modulePath . '\\Tests/'),
'views' => base_path($modulePath . '\\Resources/Views/'),
'schema_files' => base_path($modulePath . '\\Resources/model_schemas/'),
'templates_dir' => base_path($modulePath . '\\Resources/infyom/infyom-generator-templates/'),
'modelJs' => base_path($modulePath . '\\Resources/assets/js/models/'),
],
/*
|--------------------------------------------------------------------------
| Namespaces
|--------------------------------------------------------------------------
|
*/
'namespace' => [
'model' => $moduleNamespace . 'Models',
'datatables' => $moduleNamespace . 'DataTables',
'repository' => $moduleNamespace . 'Repositories',
'controller' => $moduleNamespace . 'Http\Controllers',
'api_controller' => $moduleNamespace . 'Http\Controllers\API',
'request' => $moduleNamespace . 'Http\Requests',
'api_request' => $moduleNamespace . 'Http\Requests\API',
'test_trait' => $moduleNamespace . 'Tests\Traits',
'repository_test' => $moduleNamespace . 'Tests\Repositories',
'api_test' => $moduleNamespace . 'Tests\APIs',
'tests' => $moduleNamespace . 'Tests',
],
/*
|--------------------------------------------------------------------------
| Templates
|--------------------------------------------------------------------------
|
*/
'templates' => 'adminlte-templates',
/*
|--------------------------------------------------------------------------
| Model extend class
|--------------------------------------------------------------------------
|
*/
'model_extend_class' => 'Eloquent',
/*
|--------------------------------------------------------------------------
| API routes prefix & version
|--------------------------------------------------------------------------
|
*/
'api_prefix' => 'api',
'api_version' => 'v1',
/*
|--------------------------------------------------------------------------
| Options
|--------------------------------------------------------------------------
|
*/
'options' => [
'softDelete' => true,
'tables_searchable_default' => false,
'excluded_fields' => ['id'], // Array of columns that doesn't required while creating module
],
/*
|--------------------------------------------------------------------------
| Prefixes
|--------------------------------------------------------------------------
|
*/
'prefixes' => [
'route' => '', // using admin will create route('admin.?.index') type routes
'path' => '',
'view' => '', // using backend will create return view('backend.?.index') type the backend views directory
'public' => '',
],
/*
|--------------------------------------------------------------------------
| Add-Ons
|--------------------------------------------------------------------------
|
*/
'add_on' => [
'swagger' => true,
'tests' => true,
'datatables' => false,
'menu' => [
'enabled' => false,
'menu_file' => 'layouts/menu.blade.php',
],
],
/*
|--------------------------------------------------------------------------
| Timestamp Fields
|--------------------------------------------------------------------------
|
*/
'timestamps' => [
'enabled' => true,
'created_at' => 'created_at',
'updated_at' => 'updated_at',
'deleted_at' => 'deleted_at',
],
/*
|--------------------------------------------------------------------------
| Save model files to `App/Models` when use `--prefix`. see #208
|--------------------------------------------------------------------------
|
*/
'ignore_model_prefix' => false,
/*
|--------------------------------------------------------------------------
| Specify custom doctrine mappings as per your need
|--------------------------------------------------------------------------
|
*/
'from_table' => [
'doctrine_mappings' => [],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment