Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axe-me/laravel-graphql-upload
GraphQL Upload middleware for Laravel and Lumen
https://github.com/axe-me/laravel-graphql-upload
Last synced: 28 days ago
JSON representation
GraphQL Upload middleware for Laravel and Lumen
- Host: GitHub
- URL: https://github.com/axe-me/laravel-graphql-upload
- Owner: axe-me
- License: mit
- Created: 2018-09-22T06:07:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-24T15:48:35.000Z (over 6 years ago)
- Last Synced: 2024-11-29T08:45:03.143Z (about 1 month ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-graphql-upload
GraphQL Upload middleware for Laravel and LumenThis package is ported from https://github.com/Ecodev/graphql-upload
## Install
```bash
composer require axe/laravel-graphql-upload
```## Usage
> example use with _Folklore\GraphQL_### in the config/graphql file, use the middleware
```php
'middleware' => [
Axe\LaravelGraphQLUpload\GraphqlUploadMiddleware::class
]
```### in your mutation:
```php
['name' => 'file', 'type' => UploadType::type()],
];
}public function rules()
{
return [
'file' => 'required|file|mimes:csv,txt',
];
}public function resolve($root, $args)
{
$file = $args['file'];// call some function
$path = $file->getRealPath();// ... your logic here
}
}
```