rabiloo/laravel-local-temporary-url
最新稳定版本:v1.1.1
Composer 安装命令:
composer require rabiloo/laravel-local-temporary-url
包简介
This package provides temporary url method for local filesystem driver
README 文档
README
Provides temporaryUrl() method for local filesystem driver
NOTE: Laravel 11 comes with native support for this feature. See https://laravel.com/docs/11.x/filesystem#temporary-urls This package provides the same feature for Laravel 9+ versions.
Installation
You can install the package via composer:
composer require rabiloo/laravel-local-temporary-url
Usage
Enable by config (See https://laravel.com/docs/11.x/filesystem#enabling-local-temporary-urls )
# config/filesystems.php return [ 'disks' => [ // 'local' => [ 'driver' => 'local', 'root' => storage_path('app'), 'throw' => false, 'serve' => true, // Enable file server, default URL is `/local/temp/{path}?expires=xxx&signature=xxx` ], 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', // Enable file server with `visibility` = `public` 'throw' => false, ], // Custom local disk 'local2' => [ 'driver' => 'local', 'root' => storage_path('app/local2'), 'throw' => false, 'serve' => true, // Enable file server 'url' => 'local2/tmp', // The URL will be `/local2/tmp/{path}?expires=xxx&signature=xxx` ], //... ], ];
Make temporary URL
use Illuminate\Support\Facades\Storage; $url = Storage::disk('local')->temporaryUrl($path, now()->addSeconds(120));
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 201
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-17