tuta/mytuta

Tools Tutacare

v1.1.5 2016-05-28 21:54 UTC

This package is not auto-updated.

Last update: 2024-11-15 20:02:48 UTC


README

Just tools

Install:

"require": {
        "laravel/framework": "5.2.*",
        ...
        "tuta/mytuta": "1.1.*"
    },
composer update
'providers' => array(
        ...
        Tuta\Mytuta\MytutaServiceProvider::class,
    ),
'alias' => array(
        ...
        'Mytuta' => Tuta\Mytuta\Facades\MytutaFacade::class,
    ),

#requires

'providers' => array(
        ...
        Intervention\Image\ImageServiceProvider::class,
    ),

Upload File

$upload = (Mytuta::Uploadfile($request->file('file'),'yourfolder'));

return:
$upload['name'] //mengambil nama file
$upload['size'] //mengambil data ukuran file
$upload['mime'] //mengambil mime type dari file yang di upload

#Upload Image

$upload = Mytuta::uploadImage($request->file($image), $path, $width, $height);

return:
$upload = Image Name

#Upload Image For Edit

$upload = Mytuta::uploadImageEdit($request->file($image), $path, $image_edit, $width, $height);

//$image_edit is name of image to delete

return:
$upload = Image Name

Read File & Image

Route::get('your-url/{file}', function($file = null)
{
    return Mytuta::readFile($file,'yourfolder');
});