Skip to content

Commit

Permalink
feat: restore uploadAs
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Aug 24, 2024
1 parent 2be5cbb commit 1882a7c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,22 @@ public static function upload(string $key, string $destination, array $config =
return $fileSystem->uploadInfo($uploadedFile);
}

/**
* Store a file from the request with a given name
*
* @param string $key The name of the file input the request.
* @param string $destination The directory where the file should be stored.
* @param string $name The name to store the file as.
* @param array $config Optional configurations: max_file_size, file_type, extensions
*/
public static function uploadAs(string $key, string $destination, string $name, array $config = [])
{
$config['name'] = $name;
$config['rename'] = true;

return static::upload($key, $destination, $config);
}

/**
* Get Content Type
* @return string|null
Expand Down

0 comments on commit 1882a7c

Please sign in to comment.