All Projects → matriphe → Laravel Imageupload

matriphe / Laravel Imageupload

Licence: mit
Upload image using Laravel's build in function and resize it automatically.

Projects that are alternatives of or similar to Laravel Imageupload

Laravel Imageup
Auto Image & file upload, resize and crop for Laravel eloquent model using Intervention image
Stars: ✭ 646 (+784.93%)
Mutual labels:  laravel, image, upload
Aetherupload Laravel
A Laravel package to upload large files 上传大文件的Laravel扩展包
Stars: ✭ 835 (+1043.84%)
Mutual labels:  laravel, upload
Laravel Medialibrary
Associate files with Eloquent models
Stars: ✭ 4,743 (+6397.26%)
Mutual labels:  laravel, upload
Laravel Image Optimizer
Optimize images in your Laravel app
Stars: ✭ 873 (+1095.89%)
Mutual labels:  laravel, image
File Upload With Preview
🖼 A simple file-upload utility that shows a preview of the uploaded image. Written in pure JavaScript. No dependencies. Works well with Bootstrap 4 or without a framework.
Stars: ✭ 352 (+382.19%)
Mutual labels:  image, upload
Bulletproof
PHP secure Image uploader, with a nice API
Stars: ✭ 352 (+382.19%)
Mutual labels:  image, upload
Transit
Easy file uploading and downloading for Laravel 5.
Stars: ✭ 5 (-93.15%)
Mutual labels:  laravel, upload
Kbframe
一款基于Laravel框架开发的现代化二次开发框架,是高性能,高效率,高质量的企业级开发框架,具有驱动领域,敏捷开发,轻易上手,高内聚低耦合,开箱即用等特点。
Stars: ✭ 47 (-35.62%)
Mutual labels:  laravel, upload
Laravel Guided Image
Simplified and ready image manipulation for Laravel through intervention image.
Stars: ✭ 32 (-56.16%)
Mutual labels:  laravel, upload
Upload Image To Smms By Automator
Drag your image to me, I will upload it to SM.MS automatically and backup info to iCloud. 只需拖拽图片即可轻松上传至 SM.MS 图床并且复制链接,所有图片和链接信息会被备份至 iCloud 方便后期检索。
Stars: ✭ 15 (-79.45%)
Mutual labels:  image, upload
Laravel Glide
Easily convert images with Glide
Stars: ✭ 333 (+356.16%)
Mutual labels:  laravel, image
Laravel Simple Uploader
Simple file uploader for Laravel 5.
Stars: ✭ 59 (-19.18%)
Mutual labels:  laravel, upload
Borgert Cms
Borgert is a CMS Open Source created with Laravel Framework 5.6
Stars: ✭ 298 (+308.22%)
Mutual labels:  laravel, image
Laravel Ueditor
UEditor integration for Laravel.
Stars: ✭ 392 (+436.99%)
Mutual labels:  laravel, upload
Image
PHP Image Manipulation
Stars: ✭ 12,298 (+16746.58%)
Mutual labels:  laravel, image
Laravel Proximage
🌐 Laravel Proximage is a handy package for proxying images.
Stars: ✭ 156 (+113.7%)
Mutual labels:  laravel, image
Laravel Filemanager
Media gallery with CKEditor, TinyMCE and Summernote support. Built on Laravel file system.
Stars: ✭ 1,688 (+2212.33%)
Mutual labels:  laravel, upload
Youtube
Upload a video to a single YouTube channel with Laravel 5.
Stars: ✭ 143 (+95.89%)
Mutual labels:  laravel, upload
Flickrsync
A command line tool to synchronise, upload, download, pictures between the local file system and Flickr. Image hash signature of the picture is used to uniquely identify the image.
Stars: ✭ 14 (-80.82%)
Mutual labels:  image, upload
Miniflix
Miniflix - A smaller version of Netflix powered by Cloudinary
Stars: ✭ 58 (-20.55%)
Mutual labels:  image, upload

Laravel Imageupload

Build Status Total Download Latest Stable Version

Upload image easily using Laravel's build in function and resize it automatically.



Version Compatibility

Laravel Imageupload Installation Command
4.2.x 4.x (obsolete) composer require "matriphe/imageupload:4.2.*"
5.0.x / 5.1.x / 5.2.x / 5.3.x / 5.4.x 5.x (stable) composer require "matriphe/imageupload:5.*"
5.0.x / 5.1.x / 5.2.x / 5.3.x / 5.4.x 6.0 composer require "matriphe/imageupload:6.0"
5.2.x / 5.3.x / 5.4.x / 5.5.x 6.1.x (latest) composer require "matriphe/imageupload:6.1.*"

The old version was following Laravel version. Now this package will use semantic version (semver) start from version 6.0.

Installation

Open composer.json and require this line below.

"matriphe/imageupload": "6.*"

Or you can simply run this command from your project directory.

composer require "matriphe/imageupload"

Laravel 5.0, 5.1, 5.2, 5.3, and 5.4

Open the config/app.php and add this line in providers section.

Matriphe\Imageupload\ImageuploadServiceProvider::class,

Still on config/app.php file, add this line in aliases section.

'Imageupload' => Matriphe\Imageupload\ImageuploadFacade::class,

Laravel 5.5

Nothing to do. It used Laravel auto package discovery feature.

Publish Configuration and Migration File

To control the configuration, you have to publish the configuration file.

php artisan vendor:publish --provider="Matriphe\Imageupload\ImageuploadServiceProvider"

After running this command, there will be config/imageupload.php config file and database/migrations/2017_07_24_024410_create_image_upload_table.php migration file.

Configuration

Please check the config/imageupload.php for more detail. You can use .env to config based on your environment.

If you want to publish the configuration file only, run this command.

php artisan vendor:publish --provider="Matriphe\Imageupload\ImageuploadServiceProvider" --tag=imageupload-config

Migration

By default, a migration file will create image_uploads table. Check the file and modify to fit your need.

If you want to publish the migration file only, run this command.

php artisan vendor:publish --provider="Matriphe\Imageupload\ImageuploadServiceProvider --tag=imageupload-migrations"

Model

You can create a model to extend the built-in model, by extending Matriphe\Imageupload\ImageuploadModel. Please check this file too and adjust to fit your need.

<?php

namespace App;

use Matriphe\Imageupload\ImageuploadModel;

class Image extends ImageuploadModel
{
    protected $table = 'images';
}

Try Upload Something!

After publishing the configuration file, you can set up a route, view, and start upload something.

The uploaded file will be saved in public/uploads directory. Of course, you can change this by publishing and modifying configuration file.

Make sure the directory to store uploaded files is writable and can be accessed by public.

Route Example

<?php
// routes.php
Route::any('matriphe/imageupload', function() 
{
    $data = [];

    if (Request::hasFile('file')) {
        $data['result'] = Imageupload::upload(Request::file('file'));
    }
    
    return view('form.blade.php')->with($data);
});

View

Add this in your views directory.

<!DOCTYPE html>
<html>
    <head>
        <title>Imageupload</title>
    </head>
    <body>
        <form action="{{ URL::current() }}" method="post" enctype="multipart/form-data">
            <input type="hidden" name="_token" value="{{ Session::token() }}">
            <pre>{{ (!empty($result) ? print_r($result, 1) : '') }}</pre>
            <div>
                <input type="file" name="file">
            </div>
            <div>
                <button type="submit">Upload!</button>
            </div>
        </form>
    </body>
</html>

Usage

Just use the Imageupload::upload(Request::file('file')) function and it will take care of cropping and renaming. Of course, you can modify on the fly by passing parameter Imageupload::upload($filesource, $newfilename, $path).

The return of the function is instance of Illuminate\Support\Collection. You can easily convert to array or JSON by using toArray() or toJson() method.

Set Output

To change the output on fly, use method ouput($output) before calling upload($request). The options is collection, json, db, and array (default). See the config file to set the default output.

The db option will automatically save output to database and return Matriphe\Imageupload\ImageuploadModel object.

Example

if (Request::hasFile('file')) {
    $result = Imageupload::upload(Request::file('file'));
}

if (Request::hasFile('file')) {
    $result = Imageupload::output('json')->upload(Request::file('file'));
}

Output Example

JSON

{  
    "original_filename":"IMG_20170619_195131.jpg",
    "original_filepath":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images\/IMG_20170619_195131.jpg",
    "original_filedir":"uploads\/images\/IMG_20170619_195131.jpg",
    "original_extension":"jpg",
    "original_mime":"image\/jpeg",
    "original_filesize":1379716,
    "original_width":2592,
    "original_height":4608,
    "exif":{  
        "FileName":"phpPfn2JP",
        "FileDateTime":1500894790,
        "FileSize":1379716,
        "FileType":2,
        "MimeType":"image\/jpeg",
        "SectionsFound":"ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP",
        "COMPUTED":{  
            "html":"width=\"2592\" height=\"4608\"",
            "Height":4608,
            "Width":2592,
            "IsColor":1,
            "ByteOrderMotorola":1,
            "ApertureFNumber":"f\/2.0",
            "Thumbnail.FileType":2,
            "Thumbnail.MimeType":"image\/jpeg"
        },
        "Make":"Xiaomi",
        "Model":"Redmi Note3",
        "XResolution":"72\/1",
        "YResolution":"72\/1",
        "ResolutionUnit":2,
        "Software":"kenzo-user 6.0.1 MMB29M 7.6.7 release-keys",
        "DateTime":"2017:06:19 19:51:31",
        "YCbCrPositioning":1,
        "Exif_IFD_Pointer":234,
        "GPS_IFD_Pointer":718,
        "THUMBNAIL":{  
            "Compression":6,
            "XResolution":"72\/1",
            "YResolution":"72\/1",
            "ResolutionUnit":2,
            "JPEGInterchangeFormat":898,
            "JPEGInterchangeFormatLength":15696
        },
        "ExposureTime":"1\/33",
        "FNumber":"200\/100",
        "ExposureProgram":0,
        "ISOSpeedRatings":854,
        "ExifVersion":"0220",
        "DateTimeOriginal":"2017:06:19 19:51:31",
        "DateTimeDigitized":"2017:06:19 19:51:31",
        "ComponentsConfiguration":"\u0001\u0002\u0003\u0000",
        "ShutterSpeedValue":"5058\/1000",
        "ApertureValue":"200\/100",
        "BrightnessValue":"300\/100",
        "MeteringMode":1,
        "Flash":16,
        "FocalLength":"357\/100",
        "SubSecTime":"123298",
        "SubSecTimeOriginal":"123298",
        "SubSecTimeDigitized":"123298",
        "FlashPixVersion":"0100",
        "ColorSpace":1,
        "ExifImageWidth":2592,
        "ExifImageLength":4608,
        "InteroperabilityOffset":687,
        "SensingMethod":2,
        "SceneType":"\u0001",
        "ExposureMode":0,
        "WhiteBalance":0,
        "FocalLengthIn35mmFilm":4,
        "SceneCaptureType":0,
        "GPSAltitudeRef":"200\/100",
        "GPSTimeStamp":[  
            "12\/1",
            "51\/1",
            "30\/1"
        ],
        "GPSDateStamp":"2017:06:19",
        "InterOperabilityIndex":"R98",
        "InterOperabilityVersion":"0100"
    },
    "path":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images",
    "dir":"uploads\/images",
    "filename":"IMG_20170619_195131.jpg",
    "basename":"IMG_20170619_195131",
    "dimensions":{  
        "square50":{  
            "path":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images",
            "dir":"uploads\/images\/IMG_20170619_195131_square50.jpg",
            "filename":"IMG_20170619_195131_square50.jpg",
            "filepath":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images\/IMG_20170619_195131_square50.jpg",
            "filedir":"uploads\/images\/IMG_20170619_195131_square50.jpg",
            "width":50,
            "height":50,
            "filesize":1379716,
            "is_squared":true
        },
        "square100":{  
            "path":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images",
            "dir":"uploads\/images\/IMG_20170619_195131_square100.jpg",
            "filename":"IMG_20170619_195131_square100.jpg",
            "filepath":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images\/IMG_20170619_195131_square100.jpg",
            "filedir":"uploads\/images\/IMG_20170619_195131_square100.jpg",
            "width":100,
            "height":100,
            "filesize":1379716,
            "is_squared":true
        },
        "square200":{  
            "path":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images",
            "dir":"uploads\/images\/IMG_20170619_195131_square200.jpg",
            "filename":"IMG_20170619_195131_square200.jpg",
            "filepath":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images\/IMG_20170619_195131_square200.jpg",
            "filedir":"uploads\/images\/IMG_20170619_195131_square200.jpg",
            "width":200,
            "height":200,
            "filesize":1379716,
            "is_squared":true
        },
        "square400":{  
            "path":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images",
            "dir":"uploads\/images\/IMG_20170619_195131_square400.jpg",
            "filename":"IMG_20170619_195131_square400.jpg",
            "filepath":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images\/IMG_20170619_195131_square400.jpg",
            "filedir":"uploads\/images\/IMG_20170619_195131_square400.jpg",
            "width":400,
            "height":400,
            "filesize":1379716,
            "is_squared":true
        },
        "size50":{  
            "path":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images",
            "dir":"uploads\/images\/IMG_20170619_195131_size50.jpg",
            "filename":"IMG_20170619_195131_size50.jpg",
            "filepath":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images\/IMG_20170619_195131_size50.jpg",
            "filedir":"uploads\/images\/IMG_20170619_195131_size50.jpg",
            "width":28,
            "height":50,
            "filesize":1379716,
            "is_squared":false
        },
        "size100":{  
            "path":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images",
            "dir":"uploads\/images\/IMG_20170619_195131_size100.jpg",
            "filename":"IMG_20170619_195131_size100.jpg",
            "filepath":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images\/IMG_20170619_195131_size100.jpg",
            "filedir":"uploads\/images\/IMG_20170619_195131_size100.jpg",
            "width":56,
            "height":100,
            "filesize":1379716,
            "is_squared":false
        },
        "size200":{  
            "path":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images",
            "dir":"uploads\/images\/IMG_20170619_195131_size200.jpg",
            "filename":"IMG_20170619_195131_size200.jpg",
            "filepath":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images\/IMG_20170619_195131_size200.jpg",
            "filedir":"uploads\/images\/IMG_20170619_195131_size200.jpg",
            "width":112,
            "height":200,
            "filesize":1379716,
            "is_squared":false
        },
        "size400":{  
            "path":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images",
            "dir":"uploads\/images\/IMG_20170619_195131_size400.jpg",
            "filename":"IMG_20170619_195131_size400.jpg",
            "filepath":"\/Volumes\/data\/Development\/php\/laravel\/51\/public\/uploads\/images\/IMG_20170619_195131_size400.jpg",
            "filedir":"uploads\/images\/IMG_20170619_195131_size400.jpg",
            "width":225,
            "height":400,
            "filesize":1379716,
            "is_squared":false
        }
    }
}

Array

Array
(
    [original_filename] => IMG_20170619_195131.jpg
    [original_filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131.jpg
    [original_filedir] => uploads/images/IMG_20170619_195131.jpg
    [original_extension] => jpg
    [original_mime] => image/jpeg
    [original_filesize] => 1379716
    [original_width] => 2592
    [original_height] => 4608
    [exif] => Array
        (
            [FileName] => phpPfn2JP
            [FileDateTime] => 1500894790
            [FileSize] => 1379716
            [FileType] => 2
            [MimeType] => image/jpeg
            [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP
            [COMPUTED] => Array
                (
                    [html] => width="2592" height="4608"
                    [Height] => 4608
                    [Width] => 2592
                    [IsColor] => 1
                    [ByteOrderMotorola] => 1
                    [ApertureFNumber] => f/2.0
                    [Thumbnail.FileType] => 2
                    [Thumbnail.MimeType] => image/jpeg
                )

            [Make] => Xiaomi
            [Model] => Redmi Note3
            [XResolution] => 72/1
            [YResolution] => 72/1
            [ResolutionUnit] => 2
            [Software] => kenzo-user 6.0.1 MMB29M 7.6.7 release-keys
            [DateTime] => 2017:06:19 19:51:31
            [YCbCrPositioning] => 1
            [Exif_IFD_Pointer] => 234
            [GPS_IFD_Pointer] => 718
            [THUMBNAIL] => Array
                (
                    [Compression] => 6
                    [XResolution] => 72/1
                    [YResolution] => 72/1
                    [ResolutionUnit] => 2
                    [JPEGInterchangeFormat] => 898
                    [JPEGInterchangeFormatLength] => 15696
                )

            [ExposureTime] => 1/33
            [FNumber] => 200/100
            [ExposureProgram] => 0
            [ISOSpeedRatings] => 854
            [ExifVersion] => 0220
            [DateTimeOriginal] => 2017:06:19 19:51:31
            [DateTimeDigitized] => 2017:06:19 19:51:31
            [ComponentsConfiguration] => 
            [ShutterSpeedValue] => 5058/1000
            [ApertureValue] => 200/100
            [BrightnessValue] => 300/100
            [MeteringMode] => 1
            [Flash] => 16
            [FocalLength] => 357/100
            [SubSecTime] => 123298
            [SubSecTimeOriginal] => 123298
            [SubSecTimeDigitized] => 123298
            [FlashPixVersion] => 0100
            [ColorSpace] => 1
            [ExifImageWidth] => 2592
            [ExifImageLength] => 4608
            [InteroperabilityOffset] => 687
            [SensingMethod] => 2
            [SceneType] => 
            [ExposureMode] => 0
            [WhiteBalance] => 0
            [FocalLengthIn35mmFilm] => 4
            [SceneCaptureType] => 0
            [GPSAltitudeRef] => 200/100
            [GPSTimeStamp] => Array
                (
                    [0] => 12/1
                    [1] => 51/1
                    [2] => 30/1
                )

            [GPSDateStamp] => 2017:06:19
            [InterOperabilityIndex] => R98
            [InterOperabilityVersion] => 0100
        )

    [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
    [dir] => uploads/images
    [filename] => IMG_20170619_195131.jpg
    [basename] => IMG_20170619_195131
    [dimensions] => Array
        (
            [square50] => Array
                (
                    [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                    [dir] => uploads/images/IMG_20170619_195131_square50.jpg
                    [filename] => IMG_20170619_195131_square50.jpg
                    [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_square50.jpg
                    [filedir] => uploads/images/IMG_20170619_195131_square50.jpg
                    [width] => 50
                    [height] => 50
                    [filesize] => 1379716
                    [is_squared] => 1
                )

            [square100] => Array
                (
                    [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                    [dir] => uploads/images/IMG_20170619_195131_square100.jpg
                    [filename] => IMG_20170619_195131_square100.jpg
                    [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_square100.jpg
                    [filedir] => uploads/images/IMG_20170619_195131_square100.jpg
                    [width] => 100
                    [height] => 100
                    [filesize] => 1379716
                    [is_squared] => 1
                )

            [square200] => Array
                (
                    [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                    [dir] => uploads/images/IMG_20170619_195131_square200.jpg
                    [filename] => IMG_20170619_195131_square200.jpg
                    [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_square200.jpg
                    [filedir] => uploads/images/IMG_20170619_195131_square200.jpg
                    [width] => 200
                    [height] => 200
                    [filesize] => 1379716
                    [is_squared] => 1
                )

            [square400] => Array
                (
                    [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                    [dir] => uploads/images/IMG_20170619_195131_square400.jpg
                    [filename] => IMG_20170619_195131_square400.jpg
                    [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_square400.jpg
                    [filedir] => uploads/images/IMG_20170619_195131_square400.jpg
                    [width] => 400
                    [height] => 400
                    [filesize] => 1379716
                    [is_squared] => 1
                )

            [size50] => Array
                (
                    [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                    [dir] => uploads/images/IMG_20170619_195131_size50.jpg
                    [filename] => IMG_20170619_195131_size50.jpg
                    [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_size50.jpg
                    [filedir] => uploads/images/IMG_20170619_195131_size50.jpg
                    [width] => 28
                    [height] => 50
                    [filesize] => 1379716
                    [is_squared] => 
                )

            [size100] => Array
                (
                    [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                    [dir] => uploads/images/IMG_20170619_195131_size100.jpg
                    [filename] => IMG_20170619_195131_size100.jpg
                    [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_size100.jpg
                    [filedir] => uploads/images/IMG_20170619_195131_size100.jpg
                    [width] => 56
                    [height] => 100
                    [filesize] => 1379716
                    [is_squared] => 
                )

            [size200] => Array
                (
                    [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                    [dir] => uploads/images/IMG_20170619_195131_size200.jpg
                    [filename] => IMG_20170619_195131_size200.jpg
                    [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_size200.jpg
                    [filedir] => uploads/images/IMG_20170619_195131_size200.jpg
                    [width] => 112
                    [height] => 200
                    [filesize] => 1379716
                    [is_squared] => 
                )

            [size400] => Array
                (
                    [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                    [dir] => uploads/images/IMG_20170619_195131_size400.jpg
                    [filename] => IMG_20170619_195131_size400.jpg
                    [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_size400.jpg
                    [filedir] => uploads/images/IMG_20170619_195131_size400.jpg
                    [width] => 225
                    [height] => 400
                    [filesize] => 1379716
                    [is_squared] => 
                )

        )

)

Collection

Illuminate\Support\Collection Object
(
    [items:protected] => Array
        (
            [original_filename] => IMG_20170619_195131.jpg
            [original_filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131.jpg
            [original_filedir] => uploads/images/IMG_20170619_195131.jpg
            [original_extension] => jpg
            [original_mime] => image/jpeg
            [original_filesize] => 1379716
            [original_width] => 2592
            [original_height] => 4608
            [exif] => Array
                (
                    [FileName] => phpGacSlt
                    [FileDateTime] => 1500895792
                    [FileSize] => 1379716
                    [FileType] => 2
                    [MimeType] => image/jpeg
                    [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP
                    [COMPUTED] => Array
                        (
                            [html] => width="2592" height="4608"
                            [Height] => 4608
                            [Width] => 2592
                            [IsColor] => 1
                            [ByteOrderMotorola] => 1
                            [ApertureFNumber] => f/2.0
                            [Thumbnail.FileType] => 2
                            [Thumbnail.MimeType] => image/jpeg
                        )

                    [Make] => Xiaomi
                    [Model] => Redmi Note3
                    [XResolution] => 72/1
                    [YResolution] => 72/1
                    [ResolutionUnit] => 2
                    [Software] => kenzo-user 6.0.1 MMB29M 7.6.7 release-keys
                    [DateTime] => 2017:06:19 19:51:31
                    [YCbCrPositioning] => 1
                    [Exif_IFD_Pointer] => 234
                    [GPS_IFD_Pointer] => 718
                    [THUMBNAIL] => Array
                        (
                            [Compression] => 6
                            [XResolution] => 72/1
                            [YResolution] => 72/1
                            [ResolutionUnit] => 2
                            [JPEGInterchangeFormat] => 898
                            [JPEGInterchangeFormatLength] => 15696
                        )

                    [ExposureTime] => 1/33
                    [FNumber] => 200/100
                    [ExposureProgram] => 0
                    [ISOSpeedRatings] => 854
                    [ExifVersion] => 0220
                    [DateTimeOriginal] => 2017:06:19 19:51:31
                    [DateTimeDigitized] => 2017:06:19 19:51:31
                    [ComponentsConfiguration] => 
                    [ShutterSpeedValue] => 5058/1000
                    [ApertureValue] => 200/100
                    [BrightnessValue] => 300/100
                    [MeteringMode] => 1
                    [Flash] => 16
                    [FocalLength] => 357/100
                    [SubSecTime] => 123298
                    [SubSecTimeOriginal] => 123298
                    [SubSecTimeDigitized] => 123298
                    [FlashPixVersion] => 0100
                    [ColorSpace] => 1
                    [ExifImageWidth] => 2592
                    [ExifImageLength] => 4608
                    [InteroperabilityOffset] => 687
                    [SensingMethod] => 2
                    [SceneType] => 
                    [ExposureMode] => 0
                    [WhiteBalance] => 0
                    [FocalLengthIn35mmFilm] => 4
                    [SceneCaptureType] => 0
                    [GPSAltitudeRef] => 200/100
                    [GPSTimeStamp] => Array
                        (
                            [0] => 12/1
                            [1] => 51/1
                            [2] => 30/1
                        )

                    [GPSDateStamp] => 2017:06:19
                    [InterOperabilityIndex] => R98
                    [InterOperabilityVersion] => 0100
                )

            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
            [dir] => uploads/images
            [filename] => IMG_20170619_195131.jpg
            [basename] => IMG_20170619_195131
            [dimensions] => Array
                (
                    [square50] => Array
                        (
                            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                            [dir] => uploads/images/IMG_20170619_195131_square50.jpg
                            [filename] => IMG_20170619_195131_square50.jpg
                            [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_square50.jpg
                            [filedir] => uploads/images/IMG_20170619_195131_square50.jpg
                            [width] => 50
                            [height] => 50
                            [filesize] => 1379716
                            [is_squared] => 1
                        )

                    [square100] => Array
                        (
                            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                            [dir] => uploads/images/IMG_20170619_195131_square100.jpg
                            [filename] => IMG_20170619_195131_square100.jpg
                            [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_square100.jpg
                            [filedir] => uploads/images/IMG_20170619_195131_square100.jpg
                            [width] => 100
                            [height] => 100
                            [filesize] => 1379716
                            [is_squared] => 1
                        )

                    [square200] => Array
                        (
                            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                            [dir] => uploads/images/IMG_20170619_195131_square200.jpg
                            [filename] => IMG_20170619_195131_square200.jpg
                            [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_square200.jpg
                            [filedir] => uploads/images/IMG_20170619_195131_square200.jpg
                            [width] => 200
                            [height] => 200
                            [filesize] => 1379716
                            [is_squared] => 1
                        )

                    [square400] => Array
                        (
                            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                            [dir] => uploads/images/IMG_20170619_195131_square400.jpg
                            [filename] => IMG_20170619_195131_square400.jpg
                            [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_square400.jpg
                            [filedir] => uploads/images/IMG_20170619_195131_square400.jpg
                            [width] => 400
                            [height] => 400
                            [filesize] => 1379716
                            [is_squared] => 1
                        )

                    [size50] => Array
                        (
                            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                            [dir] => uploads/images/IMG_20170619_195131_size50.jpg
                            [filename] => IMG_20170619_195131_size50.jpg
                            [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_size50.jpg
                            [filedir] => uploads/images/IMG_20170619_195131_size50.jpg
                            [width] => 28
                            [height] => 50
                            [filesize] => 1379716
                            [is_squared] => 
                        )

                    [size100] => Array
                        (
                            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                            [dir] => uploads/images/IMG_20170619_195131_size100.jpg
                            [filename] => IMG_20170619_195131_size100.jpg
                            [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_size100.jpg
                            [filedir] => uploads/images/IMG_20170619_195131_size100.jpg
                            [width] => 56
                            [height] => 100
                            [filesize] => 1379716
                            [is_squared] => 
                        )

                    [size200] => Array
                        (
                            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                            [dir] => uploads/images/IMG_20170619_195131_size200.jpg
                            [filename] => IMG_20170619_195131_size200.jpg
                            [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_size200.jpg
                            [filedir] => uploads/images/IMG_20170619_195131_size200.jpg
                            [width] => 112
                            [height] => 200
                            [filesize] => 1379716
                            [is_squared] => 
                        )

                    [size400] => Array
                        (
                            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
                            [dir] => uploads/images/IMG_20170619_195131_size400.jpg
                            [filename] => IMG_20170619_195131_size400.jpg
                            [filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131_size400.jpg
                            [filedir] => uploads/images/IMG_20170619_195131_size400.jpg
                            [width] => 225
                            [height] => 400
                            [filesize] => 1379716
                            [is_squared] => 
                        )

                )

        )

)

ImageuploadModel

Matriphe\Imageupload\ImageuploadModel Object
(
    [thumbnailKeys:protected] => Array
        (
            [0] => path
            [1] => dir
            [2] => filename
            [3] => filepath
            [4] => filedir
            [5] => width
            [6] => height
            [7] => filesize
        )

    [fillable:protected] => Array
        (
            [0] => original_filename
            [1] => original_filepath
            [2] => original_filedir
            [3] => original_extension
            [4] => original_mime
            [5] => original_filesize
            [6] => original_width
            [7] => original_height
            [8] => path
            [9] => dir
            [10] => filename
            [11] => basename
            [12] => exif
        )

    [connection:protected] => 
    [table:protected] => image_uploads
    [primaryKey:protected] => id
    [perPage:protected] => 15
    [incrementing] => 1
    [timestamps] => 1
    [attributes:protected] => Array
        (
            [original_filename] => IMG_20170619_195131.jpg
            [original_filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131.jpg
            [original_filedir] => uploads/images/IMG_20170619_195131.jpg
            [original_extension] => jpg
            [original_mime] => image/jpeg
            [original_filesize] => 1379716
            [original_width] => 2592
            [original_height] => 4608
            [exif] => {"FileName":"php19qj3X","FileDateTime":1500906046,"FileSize":1379716,"FileType":2,"MimeType":"image\/jpeg","SectionsFound":"ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP","COMPUTED":{"html":"width=\"2592\" height=\"4608\"","Height":4608,"Width":2592,"IsColor":1,"ByteOrderMotorola":1,"ApertureFNumber":"f\/2.0","Thumbnail.FileType":2,"Thumbnail.MimeType":"image\/jpeg"},"Make":"Xiaomi","Model":"Redmi Note3","XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"Software":"kenzo-user 6.0.1 MMB29M 7.6.7 release-keys","DateTime":"2017:06:19 19:51:31","YCbCrPositioning":1,"Exif_IFD_Pointer":234,"GPS_IFD_Pointer":718,"THUMBNAIL":{"Compression":6,"XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"JPEGInterchangeFormat":898,"JPEGInterchangeFormatLength":15696},"ExposureTime":"1\/33","FNumber":"200\/100","ExposureProgram":0,"ISOSpeedRatings":854,"ExifVersion":"0220","DateTimeOriginal":"2017:06:19 19:51:31","DateTimeDigitized":"2017:06:19 19:51:31","ComponentsConfiguration":"\u0001\u0002\u0003\u0000","ShutterSpeedValue":"5058\/1000","ApertureValue":"200\/100","BrightnessValue":"300\/100","MeteringMode":1,"Flash":16,"FocalLength":"357\/100","SubSecTime":"123298","SubSecTimeOriginal":"123298","SubSecTimeDigitized":"123298","FlashPixVersion":"0100","ColorSpace":1,"ExifImageWidth":2592,"ExifImageLength":4608,"InteroperabilityOffset":687,"SensingMethod":2,"SceneType":"\u0001","ExposureMode":0,"WhiteBalance":0,"FocalLengthIn35mmFilm":4,"SceneCaptureType":0,"GPSAltitudeRef":"200\/100","GPSTimeStamp":["12\/1","51\/1","30\/1"],"GPSDateStamp":"2017:06:19","InterOperabilityIndex":"R98","InterOperabilityVersion":"0100"}
            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
            [dir] => uploads/images
            [filename] => IMG_20170619_195131.jpg
            [basename] => IMG_20170619_195131
            [updated_at] => 2017-07-24 21:20:53
            [created_at] => 2017-07-24 21:20:53
            [id] => 1
        )

    [original:protected] => Array
        (
            [original_filename] => IMG_20170619_195131.jpg
            [original_filepath] => /Volumes/data/Development/php/laravel/51/public/uploads/images/IMG_20170619_195131.jpg
            [original_filedir] => uploads/images/IMG_20170619_195131.jpg
            [original_extension] => jpg
            [original_mime] => image/jpeg
            [original_filesize] => 1379716
            [original_width] => 2592
            [original_height] => 4608
            [exif] => {"FileName":"php19qj3X","FileDateTime":1500906046,"FileSize":1379716,"FileType":2,"MimeType":"image\/jpeg","SectionsFound":"ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP","COMPUTED":{"html":"width=\"2592\" height=\"4608\"","Height":4608,"Width":2592,"IsColor":1,"ByteOrderMotorola":1,"ApertureFNumber":"f\/2.0","Thumbnail.FileType":2,"Thumbnail.MimeType":"image\/jpeg"},"Make":"Xiaomi","Model":"Redmi Note3","XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"Software":"kenzo-user 6.0.1 MMB29M 7.6.7 release-keys","DateTime":"2017:06:19 19:51:31","YCbCrPositioning":1,"Exif_IFD_Pointer":234,"GPS_IFD_Pointer":718,"THUMBNAIL":{"Compression":6,"XResolution":"72\/1","YResolution":"72\/1","ResolutionUnit":2,"JPEGInterchangeFormat":898,"JPEGInterchangeFormatLength":15696},"ExposureTime":"1\/33","FNumber":"200\/100","ExposureProgram":0,"ISOSpeedRatings":854,"ExifVersion":"0220","DateTimeOriginal":"2017:06:19 19:51:31","DateTimeDigitized":"2017:06:19 19:51:31","ComponentsConfiguration":"\u0001\u0002\u0003\u0000","ShutterSpeedValue":"5058\/1000","ApertureValue":"200\/100","BrightnessValue":"300\/100","MeteringMode":1,"Flash":16,"FocalLength":"357\/100","SubSecTime":"123298","SubSecTimeOriginal":"123298","SubSecTimeDigitized":"123298","FlashPixVersion":"0100","ColorSpace":1,"ExifImageWidth":2592,"ExifImageLength":4608,"InteroperabilityOffset":687,"SensingMethod":2,"SceneType":"\u0001","ExposureMode":0,"WhiteBalance":0,"FocalLengthIn35mmFilm":4,"SceneCaptureType":0,"GPSAltitudeRef":"200\/100","GPSTimeStamp":["12\/1","51\/1","30\/1"],"GPSDateStamp":"2017:06:19","InterOperabilityIndex":"R98","InterOperabilityVersion":"0100"}
            [path] => /Volumes/data/Development/php/laravel/51/public/uploads/images
            [dir] => uploads/images
            [filename] => IMG_20170619_195131.jpg
            [basename] => IMG_20170619_195131
            [updated_at] => 2017-07-24 21:20:53
            [created_at] => 2017-07-24 21:20:53
            [id] => 1
        )

    [relations:protected] => Array
        (
        )

    [hidden:protected] => Array
        (
        )

    [visible:protected] => Array
        (
        )

    [appends:protected] => Array
        (
        )

    [guarded:protected] => Array
        (
            [0] => *
        )

    [dates:protected] => Array
        (
        )

    [dateFormat:protected] => 
    [casts:protected] => Array
        (
        )

    [touches:protected] => Array
        (
        )

    [observables:protected] => Array
        (
        )

    [with:protected] => Array
        (
        )

    [morphClass:protected] => 
    [exists] => 1
    [wasRecentlyCreated] => 1
)

Changelog

Version 6.1

  • Support output type json, array, collection, and db
  • Add support to change output type using output() method
  • Remove support for Laravel 5.0 and 5.1

Version 6.0

Version 5.x and 4.2.x

  • Last version that follow Laravel versioning
  • Last version that use Imagine library

Next Feature

  • Utilize Laravel's filesystem to store uploaded file.
  • Add Lumen support

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].