InfyOmLabs / laravel-generator

API and Admin Panel CRUD Generator for Laravel.
https://www.infyom.com/open-source
MIT License
3.79k stars 812 forks source link

Can't able to change laravel_generator.php configuration settings. #585

Closed QadeerQT closed 5 years ago

QadeerQT commented 5 years ago

I'm trying to set swagger=true but configuration changes are not reflecting on the website. laravel_generator.php `<?php

return [

/*
|--------------------------------------------------------------------------
| Paths
|--------------------------------------------------------------------------
|
*/

'path' => [

    'migration'         => base_path('database/migrations/'),

    'model'             => app_path('Models/'),

    'datatables'        => app_path('DataTables/'),

    'repository'        => app_path('Repositories/'),

    'routes'            => base_path('routes/web.php'),

    'api_routes'        => base_path('routes/api.php'),

    'request'           => app_path('Http/Requests/'),

    'api_request'       => app_path('Http/Requests/API/'),

    'controller'        => app_path('Http/Controllers/'),

    'api_controller'    => app_path('Http/Controllers/API/'),

    'test_trait'        => base_path('tests/traits/'),

    'repository_test'   => base_path('tests/'),

    'api_test'          => base_path('tests/'),

    'views'             => base_path('resources/views/'),

    'schema_files'      => base_path('resources/model_schemas/'),

    'templates_dir'     => base_path('resources/infyom/infyom-generator-templates/'),

    'modelJs'           => base_path('resources/assets/js/models/'),
],

/*
|--------------------------------------------------------------------------
| Namespaces
|--------------------------------------------------------------------------
|
*/

'namespace' => [

    'model'             => 'App\Models',

    'datatables'        => 'App\DataTables',

    'repository'        => 'App\Repositories',

    'controller'        => 'App\Http\Controllers',

    'api_controller'    => 'App\Http\Controllers\API',

    'request'           => 'App\Http\Requests',

    'api_request'       => 'App\Http\Requests\API',
],

/*
|--------------------------------------------------------------------------
| 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,
],

/*
|--------------------------------------------------------------------------
| 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'       => true,

        '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,

]; ` api.php

`<?php

use Illuminate\Http\Request; header('Access-Control-Allow-Origin: '); header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS'); header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token'); / -------------------------------------------------------------------------- API Routes
Here is where you can register API routes for your application. These
routes are loaded by the RouteServiceProvider within a group which
is assigned the "api" middleware group. Enjoy building your API!

*/

Route::middleware('auth:api')->get('/user', function (Request $request) { return $request->user(); });

Route::resource('test_models', 'TestModelAPIController');`

swagger

QadeerQT commented 5 years ago

Fixed