PHPackages                             msieprawski/eloquent-photos - 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. [Database &amp; ORM](/categories/database)
4. /
5. msieprawski/eloquent-photos

ActiveLibrary[Database &amp; ORM](/categories/database)

msieprawski/eloquent-photos
===========================

Photos for Laravel models

0.1(9y ago)119MITPHP

Since Feb 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/msieprawski/eloquent-photos)[ Packagist](https://packagist.org/packages/msieprawski/eloquent-photos)[ RSS](/packages/msieprawski-eloquent-photos/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Eloquent Photos
===============

[](#eloquent-photos)

About
-----

[](#about)

This package has been created for everyone which has photos related to any eloquent models in projects.

Compatibility
-------------

[](#compatibility)

Currently this package has been tested and developed for Laravel 5.3 or greater.

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

[](#installation)

1. `composer require msieprawski/eloquent-photos`
2. Add package service provider in your `config/app.php` file: `Msieprawski\EloquentPhotos\EloquentPhotosServiceProvider::class,`
3. Publish migrations and run `php artisan migrate`: `php artisan vendor:publish --tag=migrations`
4. Add HasPhotos trait to your model: `use Msieprawski\EloquentPhotos\HasPhotos`
5. Add protected property to your model with directory name where photos should be stored: `protected $targetPhotosDirectory = 'users';`

Usage
-----

[](#usage)

### Add photos to your model

[](#add-photos-to-your-model)

```
