PHP code example of houdunwang / laravel-upload
1. Go to this page and download the library: Download houdunwang/laravel-upload library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
houdunwang / laravel-upload example snippets
php artisan vendor:publish"
return [
//上传事件监听器,比如使用 文件或阿里云OSS处理上传
'listener' => function () {
return \Houdunwang\LaravelUpload\Listeners\FileListener::class;
},
];
namespace App\Http\Controllers;
use Houdunwang\LaravelUpload\Events\UploadEvent;
use Illuminate\Http\Request;
class VueFormController extends Controller
{
public function upload(Request $request){
$event = new UploadEvent($request->file('file'));
event($event);
##上传成功的文件y
dd($event->getFile());
}
}