You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
762 B

2 years ago
2 years ago
2 years ago
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Support\Facades\Storage;
  4. use Illuminate\Support\Facades\URL;
  5. use Illuminate\Support\ServiceProvider;
  6. class AppServiceProvider extends ServiceProvider
  7. {
  8. /**
  9. * Register any application services.
  10. *
  11. * @return void
  12. */
  13. public function register()
  14. {
  15. //
  16. }
  17. /**
  18. * Bootstrap any application services.
  19. *
  20. * @return void
  21. */
  22. public function boot()
  23. {
  24. Storage::disk('local')->buildTemporaryUrlsUsing(function ($path, $expiration, $options) {
  25. return URL::temporarySignedRoute(
  26. 'api.files.private',
  27. $expiration,
  28. array_merge($options, ['path' => $path])
  29. );
  30. });
  31. }
  32. }