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

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

globalxtreme/php-storage
========================

GlobalXtreme Storage Package for PHP Language

2.0.7(8mo ago)02501MITPHPPHP 8.\*

Since Jun 5Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/globalxtreme/php-storage)[ Packagist](https://packagist.org/packages/globalxtreme/php-storage)[ RSS](/packages/globalxtreme-php-storage/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (4)Versions (26)Used By (1)

GlobalXtreme PHP Storage Package
================================

[](#globalxtreme-php-storage-package)

[![Version](https://camo.githubusercontent.com/5928d2235489af22b6ba07a43025e8ddf0548a7ef250f3cec124a39d4bf03982/687474703a2f2f706f7365722e707567782e6f72672f676c6f62616c787472656d652f7068702d73746f726167652f76657273696f6e)](https://packagist.org/packages/globalxtreme/php-storage)[![Total Downloads](https://camo.githubusercontent.com/b9aec483b00d76d22f0ceb5aae506a6eac998577694c15df60b0d1aa8dc879af/687474703a2f2f706f7365722e707567782e6f72672f676c6f62616c787472656d652f7068702d73746f726167652f646f776e6c6f616473)](https://packagist.org/packages/globalxtreme/php-storage)[![License](https://camo.githubusercontent.com/4fcffab8fe9eb27e4dcce2f262debd4c8a858fad762fa6b354cfa7e141c7a36e/687474703a2f2f706f7365722e707567782e6f72672f676c6f62616c787472656d652f7068702d73746f726167652f6c6963656e7365)](https://packagist.org/packages/globalxtreme/php-storage)

### Install with composer

[](#install-with-composer)

To install with [Composer](https://getcomposer.org/), simply require the latest version of this package.

```
composer require globalxtreme/php-storage
```

Using
-----

[](#using)

- Setup .env. ```
    STORAGE_BASE_URL= // OPTIONAL
    STORAGE_BASE_URL_EXTERNAL= // OPTIONAL
    STORAGE_CLIENT_ID=
    STORAGE_CLIENT_SECRET=
    ```
- In laravel. ```
      use App\Http\Controllers\Controller;
      use App\Http\Request;
      use GlobalXtreme\PHPStorage\GXStorage;

      class CustomController extends Controller
      {
          public function testing(Request $request)
          {
              // Store from parameter request
              $store = GXStorage::store(new GXStorageForm(
                  file: $request->file('file'), // Required: Ambil langsung dari parameter request
                  path: "images/attachments/", // Required: Isi dengan path dimana kamu mau simpan file ini. pastikan path sudah terdaftar dan locked
                  mimeType: "image/jpeg", // Optional: Jika bisa langsung kirim juga untuk meringankan beban public storage
                  savedUntil: 10, // Optional: Isi jika ingin menghapus setelah disimpan selama beberapa hari
                  title: "", // Optional: Isi jika perlu title
                  ownerId: "", // Optional: Isi jika ingin menentukan pemilik file dan agar saat folder di lock dengan password, pemilik file tidak perlu memasukan password
                  ownerType: "", // Optional: (employee, customer). Hanaya untuk identifikasi id yang dikirim adalah employee atau customer
                  createdBy: "", // Optional: Isi jika kamu perlu menyimpan siapa yang upload file tersebut
                  createdByName: "", // Optional: Isi jika kamu perlu menyimpan siapa yang upload file tersebut
                  reference: "", // Optional: Ini berfungsi agar saat file dihapus di public storage, server / pemilik file bisa tahu tabel mana yang harus dihapus link nya
                  referenceType: "", // Optional: Ini berfungsi agar saat file dihapus di public storage, server / pemilik file bisa tahu tabel mana yang harus dihapus link nya
                  external: true, // Optional: Isi jika ingin menyimpan dan mengkases link dengan url / domain public (gunakan jika ingin mengirim link ke customer)
              ));

              // Store from file path
              $store = GXStorage::store(new GXStorageForm(
                  file: storage_path('path/to/filename'), // Required: Ambil langsung dari parameter request
                  path: "images/attachments/", // Required: Isi dengan path dimana kamu mau simpan file ini. pastikan path sudah terdaftar dan locked
                  mimeType: "image/jpeg", // Optional: Jika bisa langsung kirim juga untuk meringankan beban public storage
                  savedUntil: 10, // Optional: Isi jika ingin menghapus setelah disimpan selama beberapa hari
                  title: "", // Optional: Isi jika perlu title
                  ownerId: "", // Optional: Isi jika ingin menentukan pemilik file dan agar saat folder di lock dengan password, pemilik file tidak perlu memasukan password
                  ownerType: "", // Optional: (employee, customer). Hanaya untuk identifikasi id yang dikirim adalah employee atau customer
                  createdBy: "", // Optional: Isi jika kamu perlu menyimpan siapa yang upload file tersebut
                  createdByName: "", // Optional: Isi jika kamu perlu menyimpan siapa yang upload file tersebut
                  reference: "", // Optional: Ini berfungsi agar saat file dihapus di public storage, server / pemilik file bisa tahu tabel mana yang harus dihapus link nya
                  referenceType: "", // Optional: Ini berfungsi agar saat file dihapus di public storage, server / pemilik file bisa tahu tabel mana yang harus dihapus link nya
                  external: true, // Optional: Isi jika ingin menyimpan dan mengkases link dengan url / domain public (gunakan jika ingin mengirim link ke customer)
              ));

              // Copy file to another service
              $copy = GXStorage::copyToAnotherService(new GXStorageMoveCopyToAnotherServiceForm(
                  file: "https://dev.storage.globalxtreme-gateway.net/link/path/filename", // Required: full path (link) yang ingin di copy
                  toClientId: 111111111111, // Required: Client id tempat tujuan file di copy
                  toPath: "photos/attachments/" // Required: Path tempat file ingin di copy
              ));

              // Move file to another service
              $move = GXStorage::moveToAnotherService(new GXStorageMoveCopyToAnotherServiceForm(
                  file: "https://dev.storage.globalxtreme-gateway.net/link/path/filename", // Required: full path (link) yang ingin di copy
                  toClientId: 111111111111, // Required: Client id tempat tujuan file di copy
                  toPath: "photos/attachments/" // Required: Path tempat file ingin di copy
              ));

              // Copy file from another service
              $copy = GXStorage::copyFromAnotherService(new GXStorageMoveCopyFromAnotherServiceForm(
                  file: "https://dev.storage.globalxtreme-gateway.net/link/path/filename", // Required: full path (link) yang ingin di copy
                  fromClientId: 111111111111, // Required: Client id tempat asal file di copy
                  toPath: "photos/attachments/" // Required: Path tempat file ingin di copy
              ));

              // Move file from another service
              $move = GXStorage::moveFromAnotherService(new GXStorageMoveCopyFromAnotherServiceForm(
                  file: "https://dev.storage.globalxtreme-gateway.net/link/path/filename", // Required: full path (link) yang ingin di copy
                  fromClientId: 111111111111, // Required: Client id tempat asal file di copy
                  toPath: "photos/attachments/" // Required: Path tempat file ingin di copy
              ));

              // Form untuk generate file zip menggunakan public storage links
              $zipForm = new GXStorageZIPForm(
                  path: 'attachments/zips/', // Required: Isi dengan path tempat file zip ingin disimpan
                  filename: 'contoh-file.zip', // Required: Isi dengan nama file zip yang dinginkan, ini berguna saat download file
                  title: "", // Optional: Isi jika perlu title
                  ownerId: "", // Optional: Isi jika ingin menentukan pemilik file dan agar saat folder di lock dengan password, pemilik file tidak perlu memasukan password
                  ownerType: "", // Optional: (employee, customer). Hanaya untuk identifikasi id yang dikirim adalah employee atau customer
                  reference: "", // Optional: Ini berfungsi agar saat file dihapus di public storage, server / pemilik file bisa tahu tabel mana yang harus dihapus link nya
                  referenceType: "", // Optional: Ini berfungsi agar saat file dihapus di public storage, server / pemilik file bisa tahu tabel mana yang harus dihapus link nya
                  createdBy: "", // Optional: Isi jika kamu perlu menyimpan siapa yang upload file tersebut
                  createdByName: "", // Optional: Isi jika kamu perlu menyimpan siapa yang upload file tersebut
                  savedUntil: 10, // Optional: Isi jika ingin menghapus setelah disimpan selama beberapa hari
                  external: true, // Optional: Isi jika ingin menyimpan dan mengkases link dengan url / domain public (gunakan jika ingin mengirim link ke customer)
              );

              // Daftarkan file-file yang ingin kamu masukan ke dalam zip. (MINIMAL 1 FILE)
              $zipForm->setFile(
                  filename: 'INVOICE-1111111.pdf', // Required: Isi dengan nama file yang ingin kamu simpan nanti di zip
                  link: 'https://dev.storage.globalxtreme-gateway.net/link/path/filename', // Required: Isi dengan full link yang kamu dapatkan dari public storage (PASTIKAN LINK NYA BENAR)
              );
              $zipForm->setFile(
                  filename: 'INVOICE-22222222.pdf', // Required: Isi dengan nama file yang ingin kamu simpan nanti di zip
                  link: 'https://dev.storage.globalxtreme-gateway.net/link/path/filename', // Required: Isi dengan full link yang kamu dapatkan dari public storage (PASTIKAN LINK NYA BENAR)
              );

              $zip = GXStorage::generateZIP($zipForm)

              // 200
              $store->status;

              // Success
              $store->message;

              // inventories/pdf/4z0Zw5FUCrWfC9oQiian1686389620255618000.xlsx
              $store->path;

              // https://storage.globalxtreme-gateway.net/storages/inventories/pdf/4z0Zw5FUCrWfC9oQiian1686389620255618000.xlsx
              $store->fullPath;

              // Title
              $store->title;

              // Saved Until
              $store->savedUntil;

              // Delete file
              $delete = GXStorage::delete("inventories/pdf/4z0Zw5FUCrWfC9oQiian1686389620255618000.xlsx");

              // 200
              $delete->status;
          }
      }
    ```
- In PHP Native ```
    include("vendor/autoload.php")

    use GlobalXtreme\PHPStorage\GXStorage;

    // Load .env file
    $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
    $dotenv->safeLoad();

    // Store from file path
    $store = GXStorage::store(new GXStorageForm(
        file: $_FILES['file']['tmp_name'], // Required: Ambil langsung dari parameter request
        path: "images/attachments/", // Required: Isi dengan path dimana kamu mau simpan file ini. pastikan path sudah terdaftar dan locked
        originalName: $_FILES['file']['original_name'], // Optional: Isi jika perlu menyimpan original name juga
        mimeType: "image/jpeg", // Optional: Jika bisa langsung kirim juga untuk meringankan beban public storage
        savedUntil: 10, // Optional: Isi jika ingin menghapus setelah disimpan selama beberapa hari
        title: "", // Optional: Isi jika perlu title
        ownerId: "", // Optional: Isi jika ingin menentukan pemilik file dan agar saat folder di lock dengan password, pemilik file tidak perlu memasukan password
        ownerType: "", // Optional: (employee, customer). Hanaya untuk identifikasi id yang dikirim adalah employee atau customer
        createdBy: "", // Optional: Isi jika kamu perlu menyimpan siapa yang upload file tersebut
        createdByName: "", // Optional: Isi jika kamu perlu menyimpan siapa yang upload file tersebut
    ));

    // 200
    $store->status;

    // Success
    $store->message;

    // inventories/pdf/4z0Zw5FUCrWfC9oQiian1686389620255618000.xlsx
    $store->path;

    // https://storage.globalxtreme-gateway.net/storages/inventories/pdf/4z0Zw5FUCrWfC9oQiian1686389620255618000.xlsx
    $store->fullPath;

    // Title
    $store->title;

    // Saved Until
    $store->savedUntil;

    // Delete file
    $delete = GXStorage::delete("inventories/pdf/4z0Zw5FUCrWfC9oQiian1686389620255618000.xlsx");

    // 200
    $delete->status;
    ```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance60

Regular maintenance activity

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~36 days

Recently: every ~17 days

Total

25

Last Release

256d ago

Major Versions

v1.x-dev → 2.0.02025-03-22

PHP version history (2 changes)1.0.0PHP 7.\*|8.\*

2.0.0PHP 8.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/17e52063ab79a90d8f0d74b88a69b32f26321d910c7808ac934ad704c26f4da2?d=identicon)[globalxtreme](/maintainers/globalxtreme)

---

Top Contributors

[![yuswa-arba](https://avatars.githubusercontent.com/u/34733910?v=4)](https://github.com/yuswa-arba "yuswa-arba (36 commits)")

### Embed Badge

![Health badge](/badges/globalxtreme-php-storage/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[illuminate/http

The Illuminate Http package.

11937.2M6.5k](/packages/illuminate-http)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)

PHPackages © 2026

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