PHP code example of kriss / webman-filesystem
1. Go to this page and download the library: Download kriss/webman-filesystem 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/ */
kriss / webman-filesystem example snippets
bash
php webman storage:link
bash
namespace app\controller;
use support\Request;
use WebmanTech\Polyfill\LaravelRequest;
use WebmanTech\Polyfill\LaravelUploadedFile;
class UserAvatarController
{
public function update(Request $request)
{
$path = LaravelRequest::wrapper($request)->file('file')->store('avatars');
// 或者
$path = LaravelUploadedFile::wrapper($request->file('avatar'))->store('avatars');
return response($path);
}
}