No description
This commit introduces unit tests for the StorageServiceImpl class, covering file validation, existence checks, retrieval, storage, and removal operations. |
||
|---|---|---|
| .vscode | ||
| config | ||
| src | ||
| tests | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| CHANGELOG.md | ||
| composer.json | ||
| license.md | ||
| phpcs.xml | ||
| phpstan.neon | ||
| phpunit.xml | ||
| pint.json | ||
| README.md | ||
Storage Laravel
A clean Laravel service package to manage and sanitize external files.
Installation
composer require uwil/storage-laravel
Configuration
Publish the config file:
php artisan vendor:publish --provider="Uwil\Storage\StorageServiceProvider" --tag="config"
Usage
Inject Uwil\Storage\Contracts\StorageService into your controllers or jobs:
use Uwil\Storage\Contracts\StorageService;
public function upload(Request $request, StorageService $storage)
{
$request->validate(['file' => 'required|file']);
$storedPath = $storage->storeUploaded($request->file('file'));
}