4

Does anyone what is the tilde (~) character supposed to do in Laravel route definition (not in urls in general)? It might be Laravel 4.2 specific, not sure. Example:

Route::get('~/preview', ['as' => 'site.preview', // closure follows

I found this in a legacy code base I'm working with and cannot google it for the life of me.

guessimtoolate
  • 8,372
  • 2
  • 18
  • 26
  • Possible duplicate of [what is the use of "~" tilde in url?](https://stackoverflow.com/questions/6252471/what-is-the-use-of-tilde-in-url) – Bram Verstraten Jul 26 '19 at 10:04

1 Answers1

3

I did some research, including searching across the codebase for the Laravel 4.2 routing component. As far as I can tell, the example route you posted is just a normal route. The ~ is simply part of the route, and doesn't have any special meaning or functionality.

I also tested in Laravel 5.8, and the the example URL you posted matches & works correctly:

enter image description here

atymic
  • 3,093
  • 1
  • 13
  • 26