Just run following command in your project folder in terminal:
APP_ENV=production php artisan serve
You can also specify your host & port:
APP_ENV=production php artisan serve --host=192.168.0.178 --port=5172
You should put in your app/Providers/AppServiceProvider.php:
public function boot(): void { if (env('APP_ENV') !== 'local') { URL::forceScheme('https'); } }
And include URL class
use Illuminate\Support\Facades\URL;
Whole AppServiceProvider:
<?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\URL; class AppServiceProvider extends ServiceProvider { /** * Register any application services. */ public function register(): void { // } /** * Bootstrap any application services. */ public function boot(): void { if (env('APP_ENV') !== 'local') { URL::forceScheme('https'); } } }