1. Go to this page and download the library: Download tamedevelopers/file 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/ */
->save(function($response){
$userAvatar;
$response->unlink("public/images/{$userAvatar}", "avatar.svg");
<!-- the above will only unlink when value is not avatar.svg -->
});
File::name('banner')
->folder('upload/banner')
->validate(function($response){
// perform any other needed task in here
echo $response->getMessage();
return;
});
File::name('banner')
->folder('upload/banner')
->save(function($response){
// perform any other needed task in here
});