2017 © Pedro Peláez
 

library laravel-uploadcare

Laravel Serviceprovider for Uploadcare

image

inwave/laravel-uploadcare

Laravel Serviceprovider for Uploadcare

  • Tuesday, November 28, 2017
  • by InWave
  • Repository
  • 1 Watchers
  • 2 Stars
  • 7,878 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 12 Versions
  • 3 % Grown

The README.md

Uploadcare for Laravel

This is a simple Laravel service provider for Uploadcare's official PHP library. It is a fork from altitude/laravel-uploadcare and the pull request from dimaninc to make it compatible with Laravel 5. This package is now maintained by me., (*1)

Installation after laravel 5.5

  1. install package by composer:
composer require inwave/laravel-uploadcare

This package will auto discover itself, therefore there is no need to add files to the app.php. Further more it will also autodiscover it's dependencies., (*2)

  1. Publish the config file:
php artisan vendor:publish
  1. Add the required config variables in the .env file:
UPLOADCARE_PUBLIC_KEY=
UPLOADCARE_PRIVATE_KEY=

Installation pre laravel 5.5

First, add this to your composer.json file, (*3)

"require": {
    "laravelcollective/html": "5.1.*",
    "inwave/laravel-uploadcare": "~1.3"
}

Then, create config/uploadcare.php with the following, (*4)

<?php

return array(
    'public_key'  => 'YOUR_UPLO ADCARE_PUBLIC_KEY_HERE',
    'private_key' => 'YOUR_UPLOADCARE_PRIVATE_KEY_HERE',
);

Best practice would be to put the keys in your .ENV file., (*5)

Finally, add the service provider and alias in your config/app.php, (*6)

'providers' => array(
    ...

    Illuminate\Html\HtmlServiceProvider::class,
    Inwave\LaravelUploadcare\LaravelUploadcareServiceProvider::class,
);

'aliases' => array(
    ...

    'Form' => Illuminate\Html\FormFacade::class,
    'HTML' => Illuminate\Html\HtmlFacade::class,
    'Uploadcare' => Inwave\LaravelUploadcare\Facades\Uploadcare::class,
);

And you should be good to go., (*7)

Example

This Service extends Uploadcare's API class so you can use any of its methods., (*8)

It also provides the form macro Form::uploadcare($field_name, $value = null, $options = array())., (*9)

app/Http/routes.php, (*10)


Route::get('/demo', function(){ return View::make('demo/demo'); }); Route::post('/demo', function(){ echo Uploadcare::getFile(Input::get('image'))->getUrl(); });

resources/views/demo/demo.blade.php, (*11)

<html>
<head>
    <title>Uploadcare Demo</title>
</head>
<body>
    <form method="POST" action="/demo">
        {!! Form::uploadcare('image', null, array('data-crop' => '3:4')) !!}
        <input type="submit">
    </form>
    {!! Uploadcare::scriptTag() !!}
</body>
</html>

For more information, please check the offical documentation, (*12)

License

MIT license, (*13)

The Versions

28/11 2017
28/11 2017
20/08 2017

v1.6.1-beta

1.6.1.0-beta https://github.com/InWave/laravel-uploadcare.git

Laravel Serviceprovider for Uploadcare

  Sources   Download

MIT

The Requires

 

laravel uploadcare

05/08 2017

1.6-beta

1.6.0.0-beta https://github.com/InWave/laravel-uploadcare.git

Laravel Serviceprovider for Uploadcare

  Sources   Download

MIT

The Requires

 

laravel uploadcare

28/01 2016
25/01 2016

1.4.x-dev

1.4.9999999.9999999-dev https://github.com/InWave/laravel-uploadcare.git

Laravel Serviceprovider for Uploadcare

  Sources   Download

MIT

The Requires

 

laravel uploadcare

25/01 2016

1.3.x-dev

1.3.9999999.9999999-dev https://github.com/InWave/laravel-uploadcare.git

Laravel Service for Uploadcare

  Sources   Download

MIT

The Requires

 

laravel uploadcare

24/09 2015

dev-lara-v5

dev-lara-v5 http://github.com/altitude/laravel-uploadcare

Laravel Service for Uploadcare

  Sources   Download

MIT

The Requires

 

laravel uploadcare

03/09 2014

1.2.0

1.2.0.0 http://github.com/altitude/laravel-uploadcare

Laravel Service for Uploadcare

  Sources   Download

MIT

The Requires

 

laravel uploadcare

01/09 2014

1.1.0

1.1.0.0 http://github.com/altitude/laravel-uploadcare

Laravel Service for Uploadcare

  Sources   Download

MIT

The Requires

 

laravel uploadcare

27/08 2014

1.0.0

1.0.0.0 http://github.com/altitude/laravel-uploadcare

Laravel Service for Uploadcare

  Sources   Download

MIT

The Requires

 

laravel uploadcare