nexxai
229
2
Laravel

Using Flysystem, how do I get uploaded files' Storage::url to return the correct CNAME

Posted 1 year ago by nexxai

I've set up the DNS CNAME just fine and it's working, but when I upload files (working fine), the url it returns is:

    https://s3.amazonaws.com/cname.domain.com/file.ext

rather than

    https://cname.domain.com/file.ext

I'm uploading the files like this:

    $storagelocation = Storage::put('uploads', request()->file('upload'));
    $url = Storage::url($storagelocation);

In my config/filesystems.php, I've tried adding

        'cname' => 'cname.domain.com',

        'cname' => 'https://cname.domain.com',

        'base_url' => 'https://cname.domain.com',

but nothing seems to work. Does anyone have any experience with this?

Please sign in or create an account to participate in this conversation.