PHPackages                             kalider/filesystem - 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. kalider/filesystem

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

kalider/filesystem
==================

1.0.0(2y ago)020MITPHPPHP &gt;=7.4

Since Jan 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kalider/filesystem)[ Packagist](https://packagist.org/packages/kalider/filesystem)[ RSS](/packages/kalider-filesystem/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Filesystem
==========

[](#filesystem)

Instalasi
---------

[](#instalasi)

```
composer require kalider/filesystem
```

Konfigurasi dan Inisialisasi
----------------------------

[](#konfigurasi-dan-inisialisasi)

```
use Kalider\Filesystem\Storage;

Storage::init([
    'default' => 'public',
    'disks' => [
        // local
        'public' => [
            'driver' => 'local',
            'root' => './storages/public',
            'url' => 'http://localhost'
        ],

        // local private
        'private' => [
            'driver' => 'local',
            'root' => './storages/private',
        ],

        // s3 fybe
        's3' => [
            'driver' => 's3',
            'key' => 'STORAGE_S3_KEY',
            'secret' => 'STORAGE_S3_SECRET',
            'version' => 'latest',
            'bucket' => 'STORAGE_S3_BUCKET',
            'prefix' => 'STORAGE_S3_PREFIX',
            'region' => 'STORAGE_S3_REGION',
            'endpoint' => 'STORAGE_S3_ENDPOINT',
            'bucket_endpoint' => true,
            'url' => 'STORAGE_S3_URL'
        ]
    ]
]);
```

File &amp; Uploaded File
------------------------

[](#file--uploaded-file)

### Instance

[](#instance)

```
use Kalider\Filesystem\File\File;
use Kalider\Filesystem\File\UploadedFile;

// file
$file = new File('path/to/file');

// uploaded file
$uploaded = UploadedFile::getInstanceByName('name');
```

### Store

[](#store)

Simpan file ke storage yang diinginkan, nama file digenerate otomatis

```
use Kalider\Filesystem\File\File;
use Kalider\Filesystem\File\UploadedFile;

// file
$file = new File('path/to/file');
$path = $file->store('path/to/store/file');

// uploaded file
$uploaded = UploadedFile::getInstanceByName('name');
$path = $uploaded->store('path/to/store/file');
```

Simpan ke storage selain default

```
$path = $file->store('path/to/store/file', 's3');
```

### Store As

[](#store-as)

Simpan file ke storage dengan mengganti nama

```
use Kalider\Filesystem\File\File;
use Kalider\Filesystem\File\UploadedFile;

// file
$file = new File('path/to/file');
$path = $file->storeAs('path/to/store/file', 'file-name');

// uploaded file
$uploaded = UploadedFile::getInstanceByName('name');
$path = $uploaded->storeAs('path/to/store/file', 'file-name');
```

Validasi
--------

[](#validasi)

Validasi menggunakan [Symfony Validator](https://symfony.com/doc/5.x/reference/constraints.html)

1. Validasi per instance, mengembalikan `Symfony\Component\Validator\ConstraintViolationList`

```
use Kalider\Filesystem\File\File;
use Kalider\Filesystem\File\UploadedFile;
use Symfony\Component\Validator\Constraints as Assert;

// file
$file = new File('path/to/file');
$violations = $file->validate([
    new Assert\NotBlank(),
    new Assert\File([
        'maxSize' => '1024k',
        'mimeTypes' => [
            'application/pdf',
            'application/x-pdf',
        ],
        'mimeTypesMessage' => 'Please upload a valid PDF',
    ])
]);

// uploaded file
$uploaded = UploadedFile::getInstanceByName('name');
$violations = $uploaded->validate([
    new Assert\NotBlank(),
    new Assert\File([
        'maxSize' => '1024k',
        'mimeTypes' => [
            'application/pdf',
            'application/x-pdf',
        ],
        'mimeTypesMessage' => 'Please upload a valid PDF',
    ])
]);
```

2. Validasi bulk uploaded file

```
use Kalider\Filesystem\File\UploadedFile;
use Symfony\Component\Validator\Constraints as Assert;

$violations = UploadedFile::validator([
    'single' => [
        new Assert\NotBlank(),
        new Assert\File([
            'maxSize' => '1024k',
            'mimeTypes' => [
                'text/plain',
            ],
            'mimeTypesMessage' => 'Please upload a valid text file',
        ])
    ],
    'image1' => [
        new Assert\NotBlank(),
        new Assert\File([
            'maxSize' => '2M',
            'mimeTypes' => [
                'image/jpeg',
            ],
        ])
    ]
]);

if (count($violations) > 0) {
    // invalid
    // errors tersimpan pada var $violations
}

// valid
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

846d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89d6f306aacea6ca9c2e2b04827572dba093df74823c00cdfe3a32c6197105dd?d=identicon)[kalider](/maintainers/kalider)

---

Top Contributors

[![kalider](https://avatars.githubusercontent.com/u/12792557?v=4)](https://github.com/kalider "kalider (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kalider-filesystem/health.svg)

```
[![Health](https://phpackages.com/badges/kalider-filesystem/health.svg)](https://phpackages.com/packages/kalider-filesystem)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[vich/uploader-bundle

Ease file uploads attached to entities

1.9k25.9M116](/packages/vich-uploader-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[magento/community-edition

Magento 2 (Open Source)

12.1k52.1k10](/packages/magento-community-edition)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

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