31 lines
641 B
Markdown
31 lines
641 B
Markdown
# Storage Laravel
|
|
|
|
A clean Laravel service package to manage and sanitize external files.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
composer require uwil/storage-laravel
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Publish the config file:
|
|
```bash
|
|
php artisan vendor:publish --provider="Uwil\Storage\StorageServiceProvider" --tag="config"
|
|
```
|
|
|
|
## Usage
|
|
|
|
Inject `Uwil\Storage\Contracts\StorageService` into your controllers or jobs:
|
|
|
|
```php
|
|
use Uwil\Storage\Contracts\StorageService;
|
|
|
|
public function upload(Request $request, StorageService $storage)
|
|
{
|
|
$request->validate(['file' => 'required|file']);
|
|
|
|
$storedPath = $storage->storeUploaded($request->file('file'));
|
|
}
|
|
```
|