You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -561,6 +571,45 @@ As you can see in the example above, the `store` callback is returning an array
561
571
pairs are mapped onto your model's instance before it is saved to the database, allowing you to update one or many of the
562
572
model's database columns after your file is stored.
563
573
574
+
### Customizing File Display
575
+
576
+
By default, Restify will display the file's stored path name. However, you may customize this behavior.
577
+
578
+
#### Displaying temporary url
579
+
580
+
For disks such as S3, you may instruct Restify to display a temporary URL to the file instead of the stored path name:
581
+
582
+
```php
583
+
field('path')
584
+
->file()
585
+
->path("documents/".Auth::id())
586
+
->resolveUsingTemporaryUrl()
587
+
->disk('s3'),
588
+
589
+
```
590
+
591
+
The `resolveUsingTemporaryUrl` accepts 3 arguments:
592
+
593
+
594
+
-`$resolveTemporaryUrl` - a boolean to determine if the temporary url should be resolved. Defaults to `true`.
595
+
596
+
-`$expiration` - A CarbonInterface to determine the time before the URL expires. Defaults to 5 minutes.
597
+
598
+
-`$options` - An array of options to pass to the `temporaryUrl` method of the `Illuminate\Contracts\Filesystem\Filesystem` implementation. Defaults to an empty array.
599
+
600
+
#### Displaying full url
601
+
602
+
For disks such as `public`, you may instruct Restify to display a full URL to the file instead of the stored path name:
603
+
604
+
```php
605
+
field('path')
606
+
->file()
607
+
->path("documents/".Auth::id())
608
+
->resolveUsingFullUrl()
609
+
->disk('public'),
610
+
611
+
```
612
+
564
613
#### Storeables
565
614
566
615
Of course, performing all of your file storage logic within a Closure can cause your resource to become bloated. For
0 commit comments