You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< ? php
namespace App\Providers ;
use Illuminate\Support\Facades\Storage ;
use Illuminate\Support\ServiceProvider ;
use League\Flysystem\Filesystem ;
use App\Filesystem\HttpGoAdapter ;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register ()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot ()
{
Storage :: extend ( 'http_go' , function ( $app , $config ) {
$adapter = new HttpGoAdapter ( $config [ 'base_uri' ]);
$filesystem = new Filesystem ( $adapter );
// 直接返回 FilesystemAdapter 并传入 config, 确保 url() 方法能读取配置
return new \Illuminate\Filesystem\FilesystemAdapter ( $filesystem , $config );
});
}
}