1

Is there an easier way to get and URL parameters similar to that when appending pagination?

<a href="url('user/report', $parameters = Input::all(), $secure = null);">Link</a>

Instead of going @if(Input::has('param1') Input::get('param1') @endif

Thanks

2 Answers 2

3

You can always default to something if the parameter is missing

{{ Input::get('param1', 'default value') }}
Sign up to request clarification or add additional context in comments.

Comments

0

I actually couldn't find a solution to this after researching (I'm sure there is a way, but couldn't find it) so I just decided to create a quick function, a little arbitrary, but works...

$url = '?';

foreach(Input::all() as $input => $value)
    $url .= $input . '=' . $value . '&';

<a href="{{ $url }}param2={{ $var }}">Link</a>

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.