Skip to content

Commit

Permalink
File instuction added
Browse files Browse the repository at this point in the history
  • Loading branch information
sohelamin committed Aug 4, 2018
1 parent 8c44217 commit 75407c1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,16 @@ For api controller:
php artisan crud:api-controller Api\\PostsController --crud-name=posts --model-name=Post
```

### File Upload
If you want to add file on a CRUD just mention the field type as `file` eg. ```--fields='avatar#file;```

All the files will upload to `storage\app\public\uploads` directory. So you should symbolic the storage dir to public access.
```
php artisan storage:link
```
Get your uploaded file as:
```php
$file = Storage::disk('public')->get('uploads\filename.jpg');
```

[← Back to index](README.md)

0 comments on commit 75407c1

Please sign in to comment.