1

In Laravel Spark, settings pages have URLs that look like this

http://app.dev/settings#/security

Is there a way, via Laravel's PHP code (from a controller action) to redirect to these URLs that doesn't involve manually adding the # portion to the URL via string concatenation?

In other works, I know I can do this

    return redirect(
        route('settings') . '#/security'
    );   

but it feels sort of gross. I guess another way of asking this question is, is there a built-in way to generate route based URLs in laravel that include the # portion of a URL.

zero323
  • 322,348
  • 103
  • 959
  • 935
Alana Storm
  • 164,128
  • 91
  • 395
  • 599
  • I'm not aware of a `withAnchor` helper function or anything. The way you're doing it seems appropriate and reasonable. – ceejayoz Apr 24 '17 at 19:45
  • There is absolutely nothing 'gross' about the string concatenation method you have shown. – Joe Apr 24 '17 at 22:02
  • 1
    @Joe Gross is, perhaps, a bit of hyperbole and a question of taste. However, it's more colorful than saying my particular set of experiences has led be towards relying on built in URL generation wherever possible, and than building URLs myself (no matter how trivial) often leads to later problems. – Alana Storm Apr 24 '17 at 22:15

0 Answers0