Skip to content

Conversation

aknEvrnky
Copy link

@aknEvrnky aknEvrnky commented Jul 30, 2022

Hi everybody,
this PR targets creating config files from artisan CLI. Since we could create almost every files from artisan, creating the config files were missing. We can create config files now.

usage:

php artisan make:config theme

result

In base directory, config/theme.php file is created. Now we can fill inside how we want.

<?php

return [
    'default' => env('ADMIN_THEME', 'main'),

    'themes' => [
        'main' => [
            'admin_color_1' => '#188ea4',
            'admin_color_2' => '#312cb8',
            'admin_color_3' => '#1325a3',
            'admin_login_image' => '/admin/bgs/0.jpg',
            // ...
        ],
    ]
];

Tests are run, nothing is broken. Codes are generated like other php artisan make commands.

Main purpose of code is that, we should be able to create configs from CLI.

@aknEvrnky aknEvrnky requested a review from GrahamCampbell July 30, 2022 22:21
@ankurk91
Copy link
Contributor

Why did you clear cache in the command?

{{class}} is not being populated?

@aknEvrnky
Copy link
Author

aknEvrnky commented Jul 31, 2022

Why did you clear cache in the command?

{{class}} is not being populated?

My thought is that if you are creating a config file, your cached config will not include your new config. Maybe clearing the cache can be optional.

edit: I just become aware of the mistake. It should be config:clear instead of cache:clear

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!

If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants