PHPackages                             djurovicigoor/lara-files - 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. djurovicigoor/lara-files

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

djurovicigoor/lara-files
========================

Lara-files is a package which will make it easier to work with files. Package has built-in support for DigitalOcean spaces and Amazon S3.

v2.2.0(1mo ago)1196.5k↑38.9%14MITPHPPHP ^8.2 || ^8.3 || ^8.4CI passing

Since May 8Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/djurovicigoor/lara-files)[ Packagist](https://packagist.org/packages/djurovicigoor/lara-files)[ Docs](https://github.com/djurovicigoor/lara-files)[ RSS](/packages/djurovicigoor-lara-files/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (31)Versions (32)Used By (0)

LaraFiles
=========

[](#larafiles)

[![Packagist Downloads](https://camo.githubusercontent.com/30faf8d44530892d5dd13c9a74aacdaee200427967eb58d7831abf03470af336/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646a75726f76696369676f6f722f6c6172612d66696c65733f6c6162656c3d546f74616c253230646f776e6c6f616473)](https://camo.githubusercontent.com/30faf8d44530892d5dd13c9a74aacdaee200427967eb58d7831abf03470af336/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646a75726f76696369676f6f722f6c6172612d66696c65733f6c6162656c3d546f74616c253230646f776e6c6f616473)[![Packagist Version](https://camo.githubusercontent.com/e2ed444eb1854928153e3979993961beca1c875d6022f17182589a9b1afe7297/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646a75726f76696369676f6f722f6c6172612d66696c65733f6c6162656c3d4c617465737425323076657273696f6e)](https://camo.githubusercontent.com/e2ed444eb1854928153e3979993961beca1c875d6022f17182589a9b1afe7297/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646a75726f76696369676f6f722f6c6172612d66696c65733f6c6162656c3d4c617465737425323076657273696f6e)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Run tests](https://github.com/djurovicigoor/lara-files/actions/workflows/run-tests.yml/badge.svg)](https://github.com/djurovicigoor/lara-files/actions/workflows/run-tests.yml)[![Fix Code Style](https://github.com/djurovicigoor/lara-files/actions/workflows/pint.yml/badge.svg)](https://github.com/djurovicigoor/lara-files/actions/workflows/pint.yml)

📦 Lara Files

Lara Files is a lightweight and flexible Laravel package for handling file uploads for Eloquent models.

It provides a fully-featured LaraFile model, a powerful upload service, and clean integration via traits—allowing you to easily attach files (images, documents, etc.) to any model in your application.

Built for Laravel 10, 11, 12, and 13 support in mind, and it's ideal for modern Laravel projects that need organized file management.

[![lara-files preview](https://repository-images.githubusercontent.com/111447584/a5686a8f-a040-49e9-8bf9-bbf14ffeef70)](https://repository-images.githubusercontent.com/111447584/a5686a8f-a040-49e9-8bf9-bbf14ffeef70)

- [Choose version](#versions)
- [Installation](#installation)
- [Configurations](#config-file)
- [Database setup](#preparing-the-database)
- [LaraFile model](#larafile-model)
- [Multiple disks](#multiple-disks-support)
- [Preparing your model](#preparing-your-model)
- [Associating HTTP file](#associating-http-filefiles)
- [Associating base64 representation of file/files](#associating-base64-representation-of-filefiles)
- [Ordering files](#ordering-files)
- [Upload without model (temp file)](#upload-file-without-model-temp-file)
- [Custom properties](#using-custom-properties)
- [Change log](#change-log)
- [Contributing](#contributing)
- [Security](#security)
- [Donate](#donate)
- [Credits](#credits)
- [Contributors](#contributors)
- [License](#license)

Versions
========

[](#versions)

Lara filesLaravelPHP[v2.x](https://github.com/djurovicigoor/lara-files/tree/master)10.x - 13.x8.2+ (L13: 8.3+)[v1.x](https://github.com/djurovicigoor/lara-files/tree/v1.x)5.5 - 9.x7.2+Installation
============

[](#installation)

Lara files can be installed via Composer:

```
composer require djurovicigoor/lara-files
```

The service provider will automatically get registered if not you can manually add it in your `bootstrap/providers.php` file:

```
return [
    App\Providers\AppServiceProvider::class,
    ...
    DjurovicIgoor\LaraFiles\LaraFilesProvider::class,
];
```

Now you can publish a service provider:

```
php artisan vendor:publish --provider="DjurovicIgoor\LaraFiles\LaraFileServiceProvider"
```

Config file
===========

[](#config-file)

This is the default content of the config file:

```
