'laravel project deploy to Heroku but bootstrap styles missing
Solution 1:[1]
Go to app >> Providers >> AppServiceProvider.php
Import this:
use \Illuminate\Support\Facades\URL;
Under the boot method, paste the code below
if ($this->app->environment('production')) {
URL::forceScheme('https');
}
Note: The code above checks whether you are in development mode or production to render your assets.
Solution 2:[2]
Try the following.
@production
<link rel="stylesheet" href="{{ secure_asset('css/AdminLTE.min.css') }}">
@endproduction
Solution 3:[3]
Just Add the Following lines in AppServiceProvide.php inside boot function
if (env('APP_ENV') != 'local') {
URL::forceScheme('https');
}
This will automatically detect your current host and convert simple HTTP request to HTTPS. Hopefully it will work for you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kalkulus |
| Solution 2 | Karl Hill |
| Solution 3 | Hashaam Khurshid |

