PHPackages                             aek/file-uploader - 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. aek/file-uploader

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

aek/file-uploader
=================

This is a library for uploading files in an easy way

03PHP

Since Jul 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/SoulFly579/aek-file-uploader)[ Packagist](https://packagist.org/packages/aek/file-uploader)[ RSS](/packages/aek-file-uploader/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

aek-file-uploader
=================

[](#aek-file-uploader)

This is the official repository for the file uploader.

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

[](#installation)

Install aek-file-uploader with composer

```
  composer require aek/file-uploader
```

You need to update your application configuration in order to register the package so it can be loaded by Laravel, just update your config/app.php file adding the following code at the end of your 'providers' section:

```
config/app.php

 [
        \AEK\FileUploader\FileUploaderServiceProvider::class,
        // ...
    ],
    // ...
];
```

For Laravel, you should publish

```
    php artisan vendor:publish --provider="AEK\FileUploader\FileUploaderServiceProvider"
    // or
    php artisan vendor:publish
```

Usage/Examples
--------------

[](#usageexamples)

You should define the **destination, visibility, and name\_of\_column**. The package will upload the file to the destination as you defined visibility and **add the path of the file after uploading as a value to your model as name\_of\_column variable.**

```
use AEK\FileUploader\Traits\FileUploader;

class User extends Authenticatable
{
    use FileUploader;

    /*
        Here you should define a variable which name is $fileUploader and this should be array.
        This array also should has another arrays which include special configurations for each column that you want to add value to the database.
     */
    public $fileUploader = [
        [
            // this is a folder in which we will keep files
            // each column can have another folder for the keep them in a tidy
            "destination" => "users/profile_pictures",

            // this is visibility of the file "public" or "private"
            "visibility"=> "public",

            // Here, you should define column name of the database
            "name_of_column" => "profile_picture"
        ],
        [
            "destination" => "users/credit_cards",
            "visibility"=> "private",
            "name_of_column" => "credit_card_picture"
        ]
    ];
}
```

```
Route::post('/', function (\Illuminate\Http\Request $request) {
        $user = new \App\Models\User();
        $user->name = $request->name;
        // additional values for the model
        $user->setKey("profile_picture")->saveFile($request->file("profile_picture"));
        $user->save();
});
```

Available Methods
-----------------

[](#available-methods)

```
Warning: you have to use setKey method before all of the methods.

```

Quick way to upload files.

```
  $user->setKey("profile_picture")->saveFile($request->profile_picture);
```

#### setKey("key")

[](#setkeykey)

We specify the name of the column that we will upload.

```
  $user->setKey("user");
```

ParameterTypeDescription`key``string`**Required**. One of the name\_of\_column parameters which we defined in the model.#### deleteFile()

[](#deletefile)

It doesn't take anything as attribute. It deletes file.

#### syncFile($file)

[](#syncfilefile)

Takes file which you want to upload and delete previous file.

```
  $user->syncFile($request->file("profile_picture"));
```

ParameterTypeDescription`file``file`**Required**. Delete old file and upload new one#### isFileExist()

[](#isfileexist)

Checks if file exist in the directory.

```
  $user->isFileExist();
```

#### getRealPathOfFile()

[](#getrealpathoffile)

Returns storage path of the file;

```
  $user->getRealPathOfFile();
```

Authors
-------

[](#authors)

- [Alp Emre Elmas](https://www.github.com/SoulFly579)

Acknowledgements
----------------

[](#acknowledgements)

- Alp Emre Elmas

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![alpemreelmas](https://avatars.githubusercontent.com/u/62440706?v=4)](https://github.com/alpemreelmas "alpemreelmas (9 commits)")

### Embed Badge

![Health badge](/badges/aek-file-uploader/health.svg)

```
[![Health](https://phpackages.com/badges/aek-file-uploader/health.svg)](https://phpackages.com/packages/aek-file-uploader)
```

PHPackages © 2026

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