softpampa/laravel-uploadcare
最新稳定版本:1.2.0
Composer 安装命令:
composer require softpampa/laravel-uploadcare
包简介
Laravel Service for Uploadcare
关键字:
README 文档
README
This is a simple Laravel service provider for Uploadcare's official PHP library.
Installation
First, add this to your composer.json file
"require": { "softpampa/laravel-uploadcare": "~1.2" }
Then, create app/config/uploadcare.php with the following
<?php return array( 'public_key' => 'YOUR_UPLOADCARE_PUBLIC_KEY_HERE', 'private_key' => 'YOUR_UPLOADCARE_PRIVATE_KEY_HERE', );
Finally, add the service provider and alias in your app/config/app.php
'providers' => array( ... 'Softpampa\LaravelUploadcare\LaravelUploadcareServiceProvider', ); 'aliases' => array( ... 'Uploadcare' => 'Softpampa\LaravelUploadcare\Facades\Uploadcare', );
And you should be good to go.
Example
This Service extends Uploadcare's API class so you can use any of its methods.
It also provides the form macro Form::uploadcare($field_name, $value = null, $options = array()).
app/routes.php
Route::get('/demo', function(){ return View::make('demo/demo'); }); Route::post('/demo', function(){ echo Uploadcare::getFile(Input::get('image'))->getUrl(); });
app/views/demo/demo.blade.php
<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
License
统计信息
- 总下载量: 1.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-20