PHPackages                             dptsi/laravel-storage - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dptsi/laravel-storage

ActiveLibrary

dptsi/laravel-storage
=====================

Laravel helper package for access ITS file storage API

v2.2.2(5mo ago)026.0k↓46%1PHPPHP ^7.4|8.0.\*|8.1.\*|8.2.\*|8.3.\*|8.4.\*

Since Jun 8Pushed 5mo ago6 watchersCompare

[ Source](https://github.com/dptsi/laravel-storage)[ Packagist](https://packagist.org/packages/dptsi/laravel-storage)[ RSS](/packages/dptsi-laravel-storage/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (17)Used By (0)

Laravel Storage
===============

[](#laravel-storage)

A helper package for access ITS file storage API in laravel framework

Requirements
------------

[](#requirements)

1. PHP 7.4 or greater
2. Laravel version 8

Installation
------------

[](#installation)

Install using composer:

```
composer require dptsi/laravel-storage
```

example
-------

[](#example)

### Upload

[](#upload)

> @method static mixed upload(\\Illuminate\\Http\\File|\\Illuminate\\Http\\UploadedFile $request)

Using form(`\Illuminate\Http\UploadedFile`)

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::upload($request->file('berkas'))
```

Using local file(`\Illuminate\Http\File`)

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::upload(new File($path))
```

Success response

```
{
    "file_ext": "",
    "file_id": "",
    "file_mimetype": "",
    "file_name": "",
    "file_size": ,
    "public_link": "",
    "tag": "",
    "timestamp": "",
},
```

### Delete

[](#delete)

> @method static mixed delete(string $file\_id)

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::delete($dokumen->file_id)
```

Success response

```
{
    "file_ext": "",
    "file_id": "",
    "file_mimetype": "",
    "file_name": "",
    "file_size": ,
    "public_link": "",
    "tag": "",
    "timestamp": "",
},
```

### Check Status

[](#check-status)

Success

> @method static string statusSuccess()

```
use Dptsi\FileStorage\Facade\FileStorage;

if($response->status == FileStorage::statusSuccess())
```

Error

> @method static string statusError()

```
use Dptsi\FileStorage\Facade\FileStorage;

if($response->status == FileStorage::statusError())
```

### AWS

[](#aws)

Make sure your aws config exist on filestorage.php

```
    'aws_key'                   => env('AWS_ACCESS_KEY_ID'),
    'aws_secret'                => env('AWS_SECRET_ACCESS_KEY'),
    'aws_region'                => env('AWS_DEFAULT_REGION'),
    'aws_bucket'                => env('AWS_BUCKET'),
```

### Upload to Aws

[](#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.

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::awsUpload($request->file('berkas'), 'images')
//or
FileStorage::awsUpload($request->file('berkas'), 'assets/images')
```

### Make Temporary public link from Aws S3

[](#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)

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::awsGetTemporaryPublicLink('fileid.pdf', Carbon::now->addMinutes(5))
```

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

[](#get-file-from-aws)

You can get file from aws S3 storage with

> @method static mixed awsGetFileById(string $aws\_file\_id)

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::awsGetFileById('aws_file_id');
```

### Google Storage

[](#google-storage)

Make sure your google config exist on filestorage.php

```
    'gcs_key_path'              => env('GOOGLE_KEY_PATH'),
    'gcs_project_id'            => env('GOOGLE_PROJECT_ID'),
    'gcs_bucket'                => env('GOOGLE_BUCKET'),
```

### Upload to Google Storage

[](#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.

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::gcsUpload($request->file('berkas'), 'images')
//or
FileStorage::gcsUpload($request->file('berkas'), 'assets/images')
```

### Delete from Google Storage

[](#delete-from-google-storage)

> @method static mixed gcsDelete(string $gcs\_file\_id, string $bucketname = null, string $projectId = null)

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::gcsDelete('gcs_file_id')
```

### Get File by ID from Google Storage

[](#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

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::gcsGetFileById('gcs_file_id')
```

### Download File To Local Storage

[](#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

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::gcsDownloadFile('gcs_file_id', storage_path('temp/image.png'))
```

### Get File as Binary String

[](#get-file-as-binary-string)

> @method static mixed gcsGetFileByIdAsString(string $gcs\_file\_id, string $bucketname = null, string $projectId = null) Return object

```
{# ▼
  +"status": "OK"
  +"string_data": bynary_string_data
}
```

example

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::gcsGetFileByIdAsString('gcs_file_id')
```

### Get File as Binary Stream

[](#get-file-as-binary-stream)

> @method static mixed gcsGetFileByIdAsStream(string $gcs\_file\_id, string $bucketname = null, string $projectId = null) Return object

```
{# ▼
  +"status": "OK"
  +"stream_data": GuzzleHttp\Psr7\Stream
}
```

example

```
use Dptsi\FileStorage\Facade\FileStorage;

FileStorage::gcsGetFileByIdAsStream('gcs_file_id')
```

### Make Temporary public link from Google Storage

[](#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

```
{# ▼
  +"status": "OK"
  +"expired_at": "xxxxxxxxxxxxx"
  +"url": "xxxxxxxxxxxxx"
}
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance73

Regular maintenance activity

Popularity27

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~110 days

Recently: every ~133 days

Total

16

Last Release

153d ago

Major Versions

v1.3.0 → v2.0.02024-02-07

v1.4.1 → v2.2.02024-07-05

PHP version history (5 changes)v1.0.0PHP ^7.4|8.0.\*

v1.2.3PHP ^7.4|8.0.\*|8.1.\*|8.2.\*

v1.3.0PHP &gt;7.4

v2.0.0PHP ^8.0.2

v2.2.2PHP ^7.4|8.0.\*|8.1.\*|8.2.\*|8.3.\*|8.4.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/325c06ca594835aa37001ef03863e1d189286e9d55e61f3e34e2dfc951b6dd93?d=identicon)[dptsi](/maintainers/dptsi)

---

Top Contributors

[![ersadishla](https://avatars.githubusercontent.com/u/36990076?v=4)](https://github.com/ersadishla "ersadishla (13 commits)")[![hisamwp](https://avatars.githubusercontent.com/u/36986744?v=4)](https://github.com/hisamwp "hisamwp (11 commits)")[![durianpeople](https://avatars.githubusercontent.com/u/2001867?v=4)](https://github.com/durianpeople "durianpeople (3 commits)")[![bagusnusantara](https://avatars.githubusercontent.com/u/19530857?v=4)](https://github.com/bagusnusantara "bagusnusantara (3 commits)")[![gslayer0](https://avatars.githubusercontent.com/u/37019764?v=4)](https://github.com/gslayer0 "gslayer0 (1 commits)")[![mangsurali](https://avatars.githubusercontent.com/u/31875547?v=4)](https://github.com/mangsurali "mangsurali (1 commits)")[![zydhanlinnar11](https://avatars.githubusercontent.com/u/18348815?v=4)](https://github.com/zydhanlinnar11 "zydhanlinnar11 (1 commits)")

### Embed Badge

![Health badge](/badges/dptsi-laravel-storage/health.svg)

```
[![Health](https://phpackages.com/badges/dptsi-laravel-storage/health.svg)](https://phpackages.com/packages/dptsi-laravel-storage)
```

###  Alternatives

[georgeboot/laravel-echo-api-gateway

Use Laravel Echo with API Gateway Websockets

10435.5k](/packages/georgeboot-laravel-echo-api-gateway)[keboola/storage-api-client

Keboola Storage API PHP Client

10387.5k25](/packages/keboola-storage-api-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
