I ran into the same issue with **Laravel’s `temporaryUrl()` and MinIO** that you’re discussing here.
To solve it, I built a small package: [hosni/laravel-temporary-urls-minio](https://packagist.org/packages/hosni/laravel-temporary-urls-minio)
It works like this:
* Laravel still works with your internal `AWS_ENDPOINT` (e.g. `http://minio:9000`).
* But it uses (`MINIO_PUBLIC_URL`) which you have defined in your `filesystems.php` config file as `temporary_url` to sign URLs.
* The result is a valid, signed, **publicly accessible** temporary URL that works with `Storage::disk('minio')->temporaryUrl()` or even packages like [spatie/laravel-medialibrary](https://github.com/spatie/laravel-medialibrary).
Installation is one line:
```bash
composer require hosni/laravel-temporary-urls-minio
```
Then just add:
```php
'temporary_url' => env('MINIO_PUBLIC_URL'),
```
to your disk config. After that, everything **just works**, no need to duplicate the S3 driver or rely on `/etc/hosts` hacks.
Full README: [https://github.com/hosni/laravel-temporary-urls-minio](https://github.com/hosni/laravel-temporary-urls-minio)