Files
merchbay_admin/app/Providers/AppServiceProvider.php
webmaster 4f2a435e2a
Some checks failed
Deploy Production (admin.merchbay.app) / deploy (push) Failing after 36s
dev (#2)
Co-authored-by: Frank John Begornia <frank.begornia@yahoo.com>
Reviewed-on: #2
2025-12-20 20:04:56 +00: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()
{
//
}
}