PHPackages                             akbsit/laravel-system-file - 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. akbsit/laravel-system-file

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

akbsit/laravel-system-file
==========================

Uploading files to the server.

1.0.13(1y ago)1441MITPHPPHP ^8.1

Since Mar 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/akbsit/laravel-system-file)[ Packagist](https://packagist.org/packages/akbsit/laravel-system-file)[ RSS](/packages/akbsit-laravel-system-file/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (15)Used By (1)

laravel-system-file, [Packagist](https://packagist.org/packages/akbsit/laravel-system-file)
===========================================================================================

[](#laravel-system-file-packagist)

Install
-------

[](#install)

To install package, you need run command:

```
composer require akbsit/laravel-system-file
```

Next install migrations:

```
php artisan migrate
```

Usage
-----

[](#usage)

To connect package to the model, you need to add a trait `InteractsMedia`:

```
use Akbsit\SystemFile\Traits\InteractsMedia;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use InteractsMedia;
}
```

Examples
--------

[](#examples)

1. Upload image:

```
User::first()
    ->addMedia('')
    ->setFileName('user1')
    ->put();
```

2. Attach one file to the model (the old one will be overwritten when re-uploading):

```
User::first()
    ->addMedia('')
    ->setFileName('user1')
    ->single()
    ->put();
```

3. Get first image:

```
$oSystemFile = User::first()->getMediaFirst();
```

4. Get images list:

```
$oSystemFileList = User::first()->getMedia();
```

Methods and properties
----------------------

[](#methods-and-properties)

- `media` - list of files attached to the model;
- `addMedia($file)` - attach file to the model:
    - `$file` - object/link of the uploaded file.
- `mediaExists(string $sCollection)` - check for attached files (by default `default`);
- `getMedia(string $sCollection)` - list of collection files (by default `default`);
- `getMediaFirst(string $sCollection)` - first element of the collection (by default `default`).

#### media

[](#media)

- `getUrl()` - absolute file path;
- `getPath()` - path to the file;
- `getWidthAndHeight()` - get file sizes (for images);
- `getWidth()` - get width (for images);
- `getHeight()` - get height (for pictures);
- `fileExists()` - check for the presence of the file physically.

#### addMedia

[](#addmedia)

- `setFile($file)` - set object/link to a file;
- `setModel(Model $oModel)` - set model;
- `enablePartition()` - enable folder generation (example: `73c/d53/dce`);
- `single()` - add one file to the model (all others are deleted if they were previously attached);
- `setOriginFileName(string $sOriginFileName)` - set origin file name;
- `setFileName(string $sFileName)` - set file name;
- `setProperties(array $arProperties)` - set file properties;
- `toDisk(string $sDisk)` - set storage disk (by default `public`);
- `toCollection(string $sCollection)` - set collection (by default `default`);
- `toDir(string $sDir)` - set storage folder (by default `default`);
- `put()` - save file.

Console commands
----------------

[](#console-commands)

#### File synchronization

[](#file-synchronization)

```
php artisan system-file:sync
```

###  Health Score

31

—

LowBetter than 71% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Recently: every ~173 days

Total

14

Last Release

714d ago

PHP version history (3 changes)1.0.0PHP ^7.4

1.0.7PHP ^7.4|^8.0

1.0.11PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7aecb80f29044896992d45e77f38a09e0773d75faf77091a9f3214ba7323640?d=identicon)[akbsit](/maintainers/akbsit)

---

Top Contributors

[![akbsit](https://avatars.githubusercontent.com/u/18245671?v=4)](https://github.com/akbsit "akbsit (19 commits)")

---

Tags

cmsdownloadsfilesimageslaravelmediauploadlaravelfilesimagesmediacmsdownloadsupload

### Embed Badge

![Health badge](/badges/akbsit-laravel-system-file/health.svg)

```
[![Health](https://phpackages.com/badges/akbsit-laravel-system-file/health.svg)](https://phpackages.com/packages/akbsit-laravel-system-file)
```

###  Alternatives

[erlandmuchasaj/laravel-file-uploader

A simple package to help you easily upload files to your laravel project.

128.5k](/packages/erlandmuchasaj-laravel-file-uploader)[gaspertrix/laravel-backpack-dropzone-field

Add Dropzone support for Laravel Backpack

172.2k](/packages/gaspertrix-laravel-backpack-dropzone-field)[okipa/laravel-medialibrary-ext

Extra features for spatie/laravel-medialibrary package.

1011.2k](/packages/okipa-laravel-medialibrary-ext)

PHPackages © 2026

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