1

I have a URL www.mydomain.com/jobs?applications=2|4|6

I am trying to get the values to work with my Input::get but failing. I have tried using array but this doesn't work. Can anyone advise? I'm unfamiliar with using Laravel with this structure of querystring.

$applicationIDs = Input::get('applications');

$applications = Job::with('users');

if(!empty($applicationIDs)){
     $applications->whereIn('id', $applicationIDs);
}

$applications = $applications->get();

1 Answer 1

1

Your applications parameter is just a string. Use explode to turn it into an array of ids:

$applicationIDs = explode('|', Input::get('applications'));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.