fix: 🐛 Potentional installation fix -> APP_KEY missing
This commit is contained in:
parent
6497f6bf90
commit
1784358fc2
|
@ -9,6 +9,7 @@ use Exception;
|
||||||
use Illuminate\Pagination\Paginator;
|
use Illuminate\Pagination\Paginator;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Support\Facades\URL;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
@ -54,6 +55,14 @@ class AppServiceProvider extends ServiceProvider
|
||||||
return $ok;
|
return $ok;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Force HTTPS if APP_URL is set to https
|
||||||
|
if (config('app.url') && parse_url(config('app.url'), PHP_URL_SCHEME) === 'https') {
|
||||||
|
URL::forceScheme('https');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do not run this code if no APP_KEY is set
|
||||||
|
if (config('app.key') == null) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Schema::hasColumn('useful_links', 'position')) {
|
if (Schema::hasColumn('useful_links', 'position')) {
|
||||||
$useful_links = UsefulLink::where("position", "like", "%topbar%")->get()->sortby("id");
|
$useful_links = UsefulLink::where("position", "like", "%topbar%")->get()->sortby("id");
|
||||||
|
@ -63,6 +72,7 @@ class AppServiceProvider extends ServiceProvider
|
||||||
Log::error("Couldnt find useful_links. Probably the installation is not completet. " . $e);
|
Log::error("Couldnt find useful_links. Probably the installation is not completet. " . $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$settings = $this->app->make(MailSettings::class);
|
$settings = $this->app->make(MailSettings::class);
|
||||||
$settings->setConfig();
|
$settings->setConfig();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue