yasinkose / file-handler
A file handler
1.2.0
2021-12-02 15:11 UTC
Requires
- php: >=7.4
- illuminate/auth: ^5.2|^6|^7|^8
- illuminate/collections: ^8.0
- illuminate/support: ^6.0|^7.0|^8.0
- ixudra/curl: ^6.22
Requires (Dev)
- orchestra/testbench: ^4.0|^5.0|^6.0
- phpunit/phpunit: ^8.4|^9.0
This package is auto-updated.
Last update: 2024-12-29 06:52:29 UTC
README
Description
You can send your files to remote server application (YasinKose/lumen-file-storage-service) using this repository.
Installation
Install via composer
composer require yasinkose/file-handler
Add the following to your .env file
FILE_HANDLER_URL=https://***.com/
FILE_HANDLER_API_KEY=api_key
FILE_HANDLER_TABLE_NAME=files
Publish package assets
If you are using Laravel run this command
php artisan vendor:publish --provider="YasinKose\FileHandler\ServiceProvider"
or if you're using Lumen, Add the following snippet to the bootstrap/app.php
file under the providers section
as follows:
$app->register(YasinKose\FileHandler\ServiceProvider::class);
Usage
Here's how you can send files:
FileHandler::sendFile($request->allFiles());
OR
FileHandler::addFile($request->allFiles())->sendFile();
OR
$file = new FileHandler(); $file->sendFile($request->allFiles());
Here's the response you'll get
Array
(
[0] => stdClass Object
(
[original_name] => screenshot_1.png
[slug] => lHVRttkrqM
[url] => https://***.com/file/lHVRttkrqM
)
[1] => stdClass Object
(
[original_name] => screenshot_2.png
[slug] => kC8Svz0njs
[url] => https://***.com/file/kC8Svz0njs
)
)
Security
If you discover any security related issues, please email instead of using the issue tracker.
Contributors ✨
Thanks goes to these people: