Example of free-pic free drawing bed for composer package
This article mainly introduces the composer package of free-pic free bed example, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Free-pic free drawing bed
Experience demo (http://free-pic.hzz.cool/upload.html)
Github address (https://github.com/hezhizheng/free-pic)
Packagist address (https://packagist.org/packages/hzz/free-pic)
Feature
(3) No image bed (no storage limit | No upload credential | No homology cross-domain detection)
Support for the use of agents, easy to use, easy to extend
Supports "gif", "jpeg", "jpg" and "png" image formats
Support drawing bed
Https://sm.ms/
Https://imgkr.com/
Https://imgbb.com/upload
... Find the other three non-drawing beds and expand them again.
Use
Download and install
Composer require "hzz/free-pic @ dev"
Upload pictures to the local area
.. use Hzz\ File;// upload an image locally, or you can use other upload classes. The absolute path to get the image is $fileEntity = File::singleton (). / / $field_name the field name of the uploaded image defaults to file// $dir. Default is'$filepath = $fileEntity- > upload ($field_name,$dir).
Upload pictures to a third-party picture bed
/ / implement classes through different initialization types / / support parameter types (img_kr, sm, img_bb) $serve = FreePic::create ('img_kr'); / / $serve- > proxy =' http://127.0.0.1:58591'; / / set proxies on demand. Sm.ms may require fq$url = $serve- > upload ($filepath) in mobile networks.
Delete a local picture
$fileEntity- > delete ($filepath); Thank you for reading this article carefully. I hope the article "the example of free free-pic drawing bed of composer package" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and follow the industry information channel. More related knowledge is waiting for you to learn!