Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix subdirectory config url #4020

Merged
merged 6 commits into from
May 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ HASH_LENGTH=18
# The URL of your application.
APP_URL=http://localhost

# Set to true to force using APP_URL. You should not need this, unless you are using subdirectory config
APP_FORCE_URL=false

# Database information
# To keep this information secure, we urge you to change the default password
DB_CONNECTION=mysql
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

### Fixes:

* Fix subdirectory config url
* Fix google2fa column size
* Fix errors display for api
* Fix currency in double
Expand Down
5 changes: 5 additions & 0 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use App\Exceptions\WrongIdException;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Config;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

Expand All @@ -33,6 +34,10 @@ public function boot()
{
parent::boot();

if (Config::get('app.force_url')) {
URL::forceRootUrl(config('app.url'));
}

if (App::environment('production')) {
URL::forceScheme('https');
}
Expand Down
2 changes: 2 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@

'asset_url' => env('ASSET_URL', null),

'force_url' => (bool) env('APP_FORCE_URL', false),

/*
|--------------------------------------------------------------------------
| TIMEZONE
Expand Down