本文整理汇总了PHP中Illuminate\Support\Facades\Storage::extend方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::extend方法的具体用法?PHP Storage::extend怎么用?PHP Storage::extend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Storage
的用法示例。
在下文中一共展示了Storage::extend方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
Storage::extend('bos', function ($app, $config) {
$client = new BosClient($config);
return new Filesystem(new BosAdapter($client, $config));
});
}
示例2: boot
public function boot()
{
Storage::extend('dropbox', function ($app, $config) {
$client = new DropboxClient($config['accessToken'], $config['appSecret']);
return new Filesystem(new DropboxAdapter($client));
});
}
示例3: boot
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot()
{
Storage::extend('cloudinary', function ($app, $config) {
$client = new CloudinaryClient(['cloud_name' => $config['name'], 'api_key' => $config['key'], 'api_secret' => $config['secret']]);
return new Filesystem(new CloudinaryAdapter($client));
});
}
示例4: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Storage::extend('s3', function ($app, $config) {
$client = S3Client::factory(['key' => env('AWS_KEY'), 'secret' => env('AWS_SECRET'), 'region' => env('AWS_REGION')]);
$adapter = new AwsS3Adapter($client, env('AWS_BUCKET'));
return new Filesystem($adapter);
});
}
示例5: boot
/**
* Perform post-registration booting of services.
*/
public function boot()
{
/**
* php artisan vendor:publish --provider="bernardomacedo\DBTranslator\DBTranslatorServiceProvider"
*/
$this->publishes([__DIR__ . '/../resources/config/laravel-db-translator.php' => config_path('db-translator.php')], 'config');
$this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'dbtranslator');
$this->publishes([__DIR__ . '/../resources/lang' => base_path('resources/lang/vendor/dbtranslator')], 'lang');
if (!class_exists('CreateTranslationsTable')) {
// Publish the migration
$timestamp = date('Y_m_d_His', time());
$this->publishes([__DIR__ . '/../resources/migrations/create_translations_tables.php.stub' => $this->app->basePath() . '/database/migrations/' . $timestamp . '_create_translations_tables.php'], 'migrations');
}
/**
* Create an helper file for using at blade like {{ intl() }}
*/
require_once __DIR__ . '/Helpers/intl.php';
Storage::extend('translations', function () {
$client = ['driver' => 'local', 'root' => base_path('resources/vendor/dbtranslator')];
return new Filesystem($client);
});
}
示例6: boot
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot()
{
Storage::extend('sftp', function ($app, $config) {
return new Filesystem(new SftpAdapter(['host' => $config['host'], 'port' => $config['port'], 'username' => $config['username'], 'password' => $config['password'], 'privateKey' => $config['privateKey'], 'root' => $config['root'], 'timeout' => $config['timeout']]));
});
}
示例7: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
Storage::extend('dag', function ($app, $config) {
return new Filesystem(new DagAdapter($config));
});
}
示例8: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Storage::extend('gae', function ($app, $config) {
return new Flysystem(new GaeFilesystemAdapter($config['root']));
});
}