Files
merchbay_admin/app/Providers/AppServiceProvider.php
Frank John Begornia 075c6bfdf9
All checks were successful
Deploy Development / deploy (push) Successful in 2m11s
Fix typo in AppServiceProvider to use forceSchema instead of forceScheme
2025-12-18 12:31:11 +08:00

39 lines
847 B
PHP

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Storage;
use League\Flysystem\Filesystem;
use League\Flysystem\Sftp\SftpAdapter;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// Force HTTPS when behind a proxy (Traefik)
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
\URL::forceSchema('https');
}
Storage::extend('sftp', function ($app, $config) {
return new Filesystem(new SftpAdapter($config));
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}