LaravelInstaller
LaravelInstaller copied to clipboard
compact(): Undefined variable: envConfig
after installation wizard finished .
i got this error :
compact(): Undefined variable: envConfig
file :
\vendor\rachidlaasri\laravel-installer\src\Controllers\EnvironmentController.php
Line :
97
Url :
http://127.0.0.1:8000/install/environment/saveWizard
i'm using laravel 5.8
i've tried to add the variable to the controller like this
$envConfig = $this->EnvironmentManager->getEnvContent();
and it works of course.
As you can see the saveWizard method throw this error when the validation failed. And this is the problem here! I'm working locally and using default localhost phpmyadmin with no password
and the validation failed because the database password field is empty
I think the password field should be nullable
@AMAFsoft I don't like to modify vendor files. Do you have any advise to workaround this issue without modifying those files?
@kloentje2 as you can see no one answered !!
Anyway ,if you want to fix this issue just create EnvironmentController.php
in your App\Contollers
extended from \vendor\rachidlaasri\laravel-installer\src\Controllers\EnvironmentController.php
not from the default controller and start override it methods .
ex :
<?php
namespace App\Http\Controllers;
use rachidlaasri\laravel-installer\src\Controllers\EnvironmentController as EnvironmentPackage; //you can put any name
class EnvironmentController extends EnvironmentPackage
{
// Override methods here
}
This way you can edit package files without touching vendor.
Note : this solution didn't tested yet I hope this works for you!
For the second error message : database password field is required.
Please refer to this pull request f693fba
@kloentje2 as you can see no one answered !! Anyway ,if you want to fix this issue just create
EnvironmentController.php
in yourApp\Contollers
extended from\vendor\rachidlaasri\laravel-installer\src\Controllers\EnvironmentController.php
not from the default controller and start override it methods . ex :<?php namespace App\Http\Controllers; use rachidlaasri\laravel-installer\src\Controllers\EnvironmentController as EnvironmentPackage; //you can put any name class EnvironmentController extends EnvironmentPackage { // Override methods here }
This way you can edit package files without touching vendor.
Note : this solution didn't tested yet I hope this works for you!
For the second error message :
database password field is required.
Please refer to this pull request f693fba
An easy way I sort this issue out was editting the installer.php in the app\config.php. Publishing installer.php with php artisan vendor:publish --tag=laravelinstaller you will have access to edit installer requirement.