Closed Countryen closed 4 years ago
What did you put in the app.php file?
@GrahamCampbell First, nothing (just empty file), then
<?php
return ["test" => "test"];
for config/db.php
I did the same with ["dataFolderPath => "..."]
. This works fine.
For config/app.php
it doesn't matter what I put in it.
If you provide an app.php file, it should match the baseline file from the framework, otherwise you will get an error 500, like you saw.
@GrahamCampbell Where is the "baseline file"? Or where can I get information about that? As said, I Just created the project using composer and added 1 file and 1 folder. I did not find any info about how or where to put my config files, only how to register them (lumen documentation).
Found this "folder" https://github.com/laravel/lumen-framework/tree/7.x/config Does that mean, naming my config-files like any of these will "overwrite" them? Would be cool if this was mentioned in the documentation or at least if there was a sample config file in the create-project template (there is one for .env but I am not supposed to only use .env files, am I?)
Does that mean, naming my config-files like any of these will "overwrite" them?
Yes, of course.
Okay, I suggest to add that info to the https://lumen.laravel.com/docs/7.x/configuration docs. Or is there anywhere info about how and where to store config values (other than .env?).
I guess in my case I just don't use the same names, probably like custom_app.php or smth. The question/suggestion still is open, other than that, this issue can be closed :)
To add some meaning:
Why aren't all of the /config/*-files added to the lumen application? It seems like they are for laravel apps? That would probably help pretty much as you instantly understand and see all the config values and where/how to store them.
I think I just copy & paste them into my application to have the full picture.
(Also, if there is a specific repo just for "docs" that I didn't find then please just move that issue there)
Why aren't all of the /config/*-files added to the lumen application?
Because the lumen base structure is designed to be minimal. If you'd like everything in place, or are new to Laravel, I'd recommend using the full Laravel framework, and not Lumen.
Windows 10 x64, using WAMPSERVER 3.1.4 and PowerShell 7
Description:
Installed first Lumen app today with
composer create-project --prefer-dist laravel/laravel blog
. Then added a simple error to test the debug page, shows Symfony Debug page (OK). After adding some config the debug page disappeared, instead the following was shown:After some try and error I found out that placing a file called "app.php" inside a "config" folder results in this.
Why? Am I not supposed to add a "config"-folder and a app.php to add the config via
$app->configure('app');
? Is this supposed to happen? Where should I put my config files?Full tree:
Only happens when the folder name and file name is exactly as written.
Note: Even after removing the registration for "app" inside bootstrap, the detailed error page is missing. Note: Also happens when adding content to the app.php
Steps To Reproduce:
Note: How to throw simple error, inside /routes/web.php