fix: enforce HTTPS in production environment #2

Merged
kingjaypee12 merged 1 commits from fix/error-on-production into main 2026-02-10 21:38:32 +00:00
Showing only changes of commit 7fa8b75b29 - Show all commits

View File

@@ -4,6 +4,7 @@ namespace App\Providers;
use App\Policies\RolePolicy;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
use Spatie\Permission\Models\Role;
@@ -22,6 +23,10 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
if ($this->app->environment('production')) {
URL::forceScheme('https');
}
Gate::before(function ($user, $ability) {
return $user->hasRole('super_admin') ? true : null;
});