Download the PHP package dptsi/laravel-storage without Composer
On this page you can find all versions of the php package dptsi/laravel-storage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dptsi/laravel-storage
More information about dptsi/laravel-storage
Files in dptsi/laravel-storage
Package laravel-storage
Short Description Laravel helper package for access ITS file storage API
License
Informations about the package laravel-storage
Laravel Storage
A helper package for access ITS file storage API in laravel framework
Requirements
- PHP 7.4 or greater
- Laravel version 8
Installation
Install using composer:
example
Upload
@method static mixed upload(\Illuminate\Http\File|\Illuminate\Http\UploadedFile $request)
Using form(\Illuminate\Http\UploadedFile
)
Using local file(\Illuminate\Http\File
)
Success response
Delete
@method static mixed delete(string $file_id)
Success response
Check Status
Success
@method static string statusSuccess()
Error
@method static string statusError()
AWS
Make sure your aws config exist on filestorage.php
Upload to Aws
@method static mixed awsUpload(\Illuminate\Http\File|\Illuminate\Http\UploadedFile $request, string $subdirectory = null)
Using form(\Illuminate\Http\UploadedFile
)
Using the optional parameter sub-directory to make files uploaded to a sub-directory instead of the root directory. File ID on AWS S3 use name of uploaded file instead generate uuid for that file, so make sure filename is unique.
Make Temporary public link from Aws S3
You can use temporary public uri with
@method static mixed awsGetTemporaryPublicLink(string $aws_file_id, DateTime $datetime = null)
Using fileid string and optional Datetime for how long the url can be used, by default the url can be used for 30 minutes.
Get File From Aws
You can get file from aws S3 storage with
@method static mixed awsGetFileById(string $aws_file_id)
Google Storage
Make sure your google config exist on filestorage.php
Upload to Google Storage
@method static mixed gcsUpload(\Illuminate\Http\File|\Illuminate\Http\UploadedFile $data, string $subdirectory = null, string $bucketname = null, string $projectId = null) Using form(
\Illuminate\Http\UploadedFile
|\Illuminate\Http\File
) Using the optional parameter sub-directory to make files uploaded to a sub-directory instead of the root directory. File ID on Google Storage use name of uploaded file instead generate uuid for that file, so make sure filename is unique.
Delete from Google Storage
@method static mixed gcsDelete(string $gcs_file_id, string $bucketname = null, string $projectId = null)
Get File by ID from Google Storage
@method static mixed gcsGetFileById(string $gcs_file_id, string $bucketname = null, string $projectId = null) Return base64string data and metadata of the object
Download File To Local Storage
@method static mixed gcsDownloadFile(string $gcs_file_id, string $savepath, string $bucketname = null, string $projectId = null) File downloaded into system directory
Get File as Binary String
@method static mixed gcsGetFileByIdAsString(string $gcs_file_id, string $bucketname = null, string $projectId = null) Return object
example
Get File as Binary Stream
@method static mixed gcsGetFileByIdAsStream(string $gcs_file_id, string $bucketname = null, string $projectId = null) Return object
example
Make Temporary public link from Google Storage
You can use temporary public uri with
@method static mixed gcsGetTemporaryPublicLink(string $gcs_file_id, DateTime $datetime = null, string $bucketname = null, string $projectId = null) Return object
All versions of laravel-storage with dependencies
laravel/framework Version ^9.21|^10.0|^11.0
ext-json Version *
aws/aws-sdk-php Version ^3.20.0
guzzlehttp/guzzle Version ^7.8
google/cloud-storage Version ^1.42