Hello Friends 👋,
Welcome To Infinitbility! ❤️
using the URL() helper is great for creating full HTTP links, I use this for all links, when working locally HTTP is fine but when going Production you want to use https instead. Replace Your app\Providers\AppServiceProvider.php from below code using this code Laravel on production force helper to use https URL.
1<?php2namespace App\Providers;3use Illuminate\Support\ServiceProvider;4use Illuminate\Routing\UrlGenerator;5class AppServiceProvider extends ServiceProvider6{7 /**8 * Bootstrap any application services.9 *10 * @return void11 */12 public function boot(UrlGenerator $url)13 {14 if (env('APP_ENV') !== 'local') {15 $url->forceScheme('https');16 }17 }18 /**19 * Register any application services.20 *21 * @return void22 */23 public function register()24 {25 //26 }27}
More tutorial form Laravel
- Yajra issue after install in laravel
- Laravel call function from another class
- laravel pagination with customization
- How to solve page expired error in laravel for webhooks, ajax, and form
- Laravel Model
- Laravel Clear cache, config, view and Routes
- how to force Laravel to use https in URL and assets
Thanks for reading…
Follow me on Twitter
Join our email list and get notified about new content
No worries, I respect your privacy and I will never abuse your email.
Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.