Package Data | |
---|---|
Maintainer Username: | noonic |
Maintainer Contact: | atul.12788@gmail.com (Atul Yadav) |
Package Create Date: | 2015-11-26 |
Package Last Update: | 2016-12-23 |
Home Page: | https://packagist.org/packages/noonic/image |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-11 15:22:42 |
Package Statistics | |
---|---|
Total Downloads: | 432 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 11 |
Total Watchers: | 2 |
Total Forks: | 4 |
Total Open Issues: | 0 |
1. Add the package to your application
/composer.json
{
"require": {
"noonic/image": "dev-master"
}
}
2. Add Provider and Facade
/config/app.php
'providers' => [
...
Noonic\Image\ImageServiceProvider::class,
];
'aliases' => [
...
'Image' => Noonic\Image\ImageHelperFacade::class,
];
3 Publish package files:
php artisan vendor:publish
4. Make output directory writable:
chmod 777 -R /public/images/uploads/
5. Include JavaScript Helper file
/resources/views/app.blade.php
<script type="text/javascript" src="{{ URL::asset('js/noonic.image.js') }}"></script>
Create input for uploading new image
{!! Form::open() !!}
@include('noonic_image::_input', [
'name' => 'photo',
'folder' => 'photos',
'data' => '',
'required' => true
])
{!! Form::close() !!}
Access uploaded image
<img src="{{ Image::getImageUrl($imagePathFromDatabase, 's') }}" />
You can pass t
(thumbnail), s
(small), m
(medium) or l
(large) as second parameter to obtain required size.
'sizes' => [
'16:9' => [
't' => [192, 108],
's' => [400, 225],
'm' => [800, 450],
'l' => [1024, 576]
],
'4:3' => [
't' => [200, 150],
's' => [400, 300],
'm' => [800, 600],
'l' => [1024, 768]
],
'1:1' => [
't' => [200, 200],
's' => [400, 400],
'm' => [800, 800],
'l' => [1024, 1024]
]
]
Copyright (c) 2015 Noonic Lab http://github.com/noonic
The MIT License (http://www.opensource.org/licenses/mit-license.php)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.