Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select one of multiple domains #6

Open
sgatz opened this issue Jul 14, 2018 · 5 comments
Open

Select one of multiple domains #6

sgatz opened this issue Jul 14, 2018 · 5 comments

Comments

@sgatz
Copy link

sgatz commented Jul 14, 2018

Hi, I love this package, but I have a different need. I have multiple imgix domains used in different parts of my laravel app. I'd love to be able to pass the domain as a param something like: Imgix::createUrl('test.jpg', ['w' => 100, 'h' => 100], 'domain.imgix.net'); is there a simple way to do this or add this?

@nonoesp
Copy link

nonoesp commented Mar 3, 2020

Hey, @sgatz. You dynamically override the imgix.domain config parameter.

echo imgix('test.jpg', ['w' => 100, 'h' => 100]);

// Prints out (assuming your initial domain is domain.imgix.net):
// http://domain.imgix.net/test.jpg?w=100&h=100

// Dynamically override imgix.domain config parameter
config(['imgix.domain' => 'other.imgix.net']);

echo imgix('test.jpg', ['w' => 100, 'h' => 100]);

// Prints out (assuming your initial domain is domain.imgix.net):
// http://other.imgix.net/test.jpg?w=100&h=100

@nasyrov
Copy link
Owner

nasyrov commented Jun 21, 2020

Hi @sgatz @nonoesp ,

Would be nice if we can specify it as a parameter in the helper function like so

imgix('test.jpg', ['w' => 100, 'h' => 100, 'domain' => 'other.imgix.net']);

what are your thoughts?

@nonoesp
Copy link

nonoesp commented Jun 23, 2020

That'd be great.

Seems a bit odd to pass it as an imgix parameter though, inside of the array.

Maybe an optional third parameter?

imgix('test.jpg', ['w' => 100, 'h' => 100], 'other.imgix.net');

I know that's a bit less sustainable in the long run and maybe including it inside of the parameters gives us more flexibility.

So, maybe we can go with your proposal.

@nasyrov
Copy link
Owner

nasyrov commented Jun 23, 2020

Hi @nonoesp, sounds okay to me, could you please prep a PR for that?

@nonoesp
Copy link

nonoesp commented Jun 25, 2020

I'll add this to my backlog and see if I get the time. If anyone wants to give it a go. Feel free!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants