PHPackages                             sim-mbkm/filestorage-laravel - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. sim-mbkm/filestorage-laravel

ActiveLibrary[File &amp; Storage](/categories/file-storage)

sim-mbkm/filestorage-laravel
============================

Laravel helper package for file storage using AWS S3 and Google Cloud Storage

v2.0.0(11mo ago)010PHPPHP ^7.4|8.0.\*|8.1.\*|8.2.\*|8.3.\*|8.4.\*

Since May 26Pushed 11mo agoCompare

[ Source](https://github.com/SIM-MBKM/filestorage-laravel)[ Packagist](https://packagist.org/packages/sim-mbkm/filestorage-laravel)[ RSS](/packages/sim-mbkm-filestorage-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

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

[](#laravel-storage)

Laravel helper package for file storage using AWS S3 and Google Cloud Storage. Edited from dptsi/laravel-storage package

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

[](#requirements)

1. PHP 7.4 or greater
2. Laravel version 8, 11, and 12

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

[](#installation)

Install using composer:

```
composer require sim-mbkm/filestorage-laravel
```

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

32

—

LowBetter than 72% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

352d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65ca04c4c45928f6ff0de66423e428e59662e697ac2cdae702dec25ee0dcb705?d=identicon)[dimss113](/maintainers/dimss113)

---

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)")[![bagusnusantara](https://avatars.githubusercontent.com/u/19530857?v=4)](https://github.com/bagusnusantara "bagusnusantara (3 commits)")[![durianpeople](https://avatars.githubusercontent.com/u/2001867?v=4)](https://github.com/durianpeople "durianpeople (3 commits)")[![zeon-kun](https://avatars.githubusercontent.com/u/65074635?v=4)](https://github.com/zeon-kun "zeon-kun (2 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/sim-mbkm-filestorage-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/sim-mbkm-filestorage-laravel/health.svg)](https://phpackages.com/packages/sim-mbkm-filestorage-laravel)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[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)
