发布于 2015-12-30 07:53:34 | 629 次阅读 | 评论: 0 | 来源: PHPERZ

这里有新鲜出炉的Laravel 5.0官方中文教程,程序狗速度看过来!

Laravel PHP Web开发框架

Laravel是一套简洁、优雅的PHP Web开发框架(PHP Web Framework)。它可以让你从面条一样杂乱的代码中解脱出来;它可以帮你构建一个完美的网络APP,而且每行代码都可以简洁、富于表达力。


  1. 通过 composer 安装 composer intervention/image

  2. 修改 config/app.php 文件,添加 $providers$aliases
    'Intervention\Image\ImageServiceProvider'

'Image' => 'Intervention\Image\Facades\Image'

  1. By default Intervention Image uses PHP's GD library extension to process all images. If you want to switch to Imagick, you can pull a configuration file into your application by running on of the following artisan command.

Publish configuration in Laravel 5

$ php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"

Handling image uploads in Laravel

In a Laravel application it is also possible to pass an uploaded file directly to the make method.

Creating Image from File Upload in Laravel

// resizing an uploaded file
Image::make(Input::file('photo'))->resize(300, 200)->save('foo.jpg');

参考资料

ORM-based file upload package for php. http://codesleeve.com https://github.com/CodeSleeve/stapler



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务