PHPackages                             marcohern/dimages - 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. [Image &amp; Media](/categories/media)
4. /
5. marcohern/dimages

ActiveLibrary[Image &amp; Media](/categories/media)

marcohern/dimages
=================

Upload images and download them in different densities and sizes

2.2.1(5y ago)0137MITPHP

Since May 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/marcohern/dimages)[ Packagist](https://packagist.org/packages/marcohern/dimages)[ RSS](/packages/marcohern-dimages/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (3)Versions (20)Used By (0)

dimages
=======

[](#dimages)

Simple Image management for Laravel. Very usefull if you are developing a Laravel API for Mobile Applications, dimages can resample images depending on what the image will be used for and the devices density.

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

[](#installation)

Download and install laravel.

```
$ laravel new app1
$ cd app1
```

Dimages allows images to be downloaded by the public. However, uploading images can only be done through authentication, by way of the auth:api middleware. The easiest way to achieve api authentication is to use laravel/passport. Note: laravel/passport requires a database, so make sure you have one set up.

So download, install, and configure laravel passport:

```
$ composer require laravel/passport
```

This will install passport and all it's dependencies.

```
$ php artisan passport:install
```

You will get an output similar to:

```
Encryption keys generated successfully.
Personal access client created successfully.
Client ID: 1
Client secret: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Password grant client created successfully.
Client ID: 2
Client secret: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
```

This creates 2 grants for Signing in. The first one is a Personal access client, which we will ignore for now. The second one is a Password grand which is the one we will use to log in. So remember the second Client secret, we will use it as an API key of sorts to log into the api. Now, In the mean time, you need to create a user to log in with, lets create a seeder to add a user.

```
$ php artisan make:seeder UserSeeder
Seeder created successfully.
```

This creates the seeder class in database/seeds folder, lets add the code:

```
