Skip to content

Commit 75407c1

Browse files
committed
File instuction added
1 parent 8c44217 commit 75407c1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/usage.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,16 @@ For api controller:
114114
php artisan crud:api-controller Api\\PostsController --crud-name=posts --model-name=Post
115115
```
116116

117+
### File Upload
118+
If you want to add file on a CRUD just mention the field type as `file` eg. ```--fields='avatar#file;```
119+
120+
All the files will upload to `storage\app\public\uploads` directory. So you should symbolic the storage dir to public access.
121+
```
122+
php artisan storage:link
123+
```
124+
Get your uploaded file as:
125+
```php
126+
$file = Storage::disk('public')->get('uploads\filename.jpg');
127+
```
128+
117129
[← Back to index](README.md)

0 commit comments

Comments
 (0)