hareku / laravel-profile-image
Laravel 5 profile image system
Installs: 78
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/hareku/laravel-profile-image
Requires
- php: >=7.1
- illuminate/cache: >=5.4
- illuminate/config: >=5.4
- illuminate/database: >=5.4
- illuminate/filesystem: >=5.4
- illuminate/http: >=5.4
- illuminate/support: >=5.4
- intervention/image: ^2.4
Requires (Dev)
- phpunit/phpunit: ~5.7
This package is not auto-updated.
Last update: 2020-11-14 07:28:54 UTC
README
This package helps you to add profile image system to your project.
It works if the driver supported by FileSystem. (AWS S3, Rackspace, Public disc)
Caution
- Support Laravel 5.4~
- Required php >=7.1
Installation
Run composer require hareku/laravel-profile-image
Include the service provider within config/app.php
.
'providers' => [ Hareku\LaravelProfileImage\ProfileImageServiceProvider::class, ];
Publish the config file. (config/profile-image.php)
$ php artisan vendor:publish --provider="Hareku\LaravelProfileImage\ProfileImageServiceProvider"
Usage
Example config
<?php use App\User; return [ User::class => [ 'extension' => 'jpg', 'directory' => 'user-profile-images', 'default_image_name' => 'default.jpg', 'types' => [ 'original' => [ 'directory' => 'original', 'size' => null, ], 'bigger' => [ 'directory' => 'bigger', 'size' => 73, ], 'normal' => [ 'directory' => 'normal', 'size' => 48, ], 'mini' => [ 'directory' => 'mini', 'size' => 24, ], ], ], ];
Example Contnroller
Example is here. UserProfileImageController
Get user profile image URL list
$this->profileImage->urlSet(get_class($user), $user->id); [ 'original' => '/storage/user-profile-images/original/1.jpg', 'bigger' => '/storage/user-profile-images/bigger/1.jpg', 'normal' => '/storage/user-profile-images/normal/1.jpg', 'mini' => '/storage/user-profile-images/mini/1.jpg', ]
License
MIT
Author
hareku (hareku908@gmail.com)