starrysea / uimages
Explicit/implicit photo manager
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/starrysea/uimages
Requires
- php: ^7.0
This package is auto-updated.
Last update: 2025-10-12 07:39:12 UTC
README
Laravel
该软件包可用于 Laravel 5.6 或更高版本。
您可以通过 composer 安装软件包:
composer require starrysea/uimages
Lumen
您可以通过 composer 安装软件包:
composer require starrysea/uimages
用法
// routes/web.php Route::post('/img','ImagesGatherTest@upload'); Route::get('/img/{base64}','ImagesGatherTest@getPicture');
use Starrysea\Uimages\Images; class ImagesGatherTest extends Images { // open privacy mode protected $secret = true; // allow all domain cross-domain protected function crossDomainWhitelist() { return '*'; // all domain can access } // set secret picture access address protected function secretUrl() { return 'https://xingyue.test/img'; // https:/xingyue.test/img/aW1hZ2VzL3 } // set picture storage directory protected function storage() { return 'user/avatar'; } // allow upload picture format protected function accept() { return ['png']; // only upload png picture } // success callback protected function call_success($filed, string $url, string $path) { dump('success', $url, $path); } // error callback protected function call_error(string $message, $data = '') { dump('error', $message, $data); } }