W
W
WebDev2016-08-19 18:57:28
Laravel
WebDev, 2016-08-19 18:57:28

How does laravel get #(hash)?

Added to the Laravel project in Exception\Handpler an entry of the path that the user went to

\Illuminate\Support\Facades\Log::info('Path - ' . request()->path());

On the SPA client, pages are loaded by Ajax, in url page addresses via hash tags.
I look in the logs on the site and see entries like 'Path = #products' and so on.
If I echo request()->path() in the controller, I get the address without the hash.
Where did the hash come from in the logs? It's not in $_SERVER, is it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Sharihin, 2016-08-19
@Pinsky

No way. This is a pointer for the browser, it is not passed to the server

A
Alexander Aksentiev, 2016-08-19
@Sanasol

So SPA somehow transmits an additional hash.

V
Vyacheslav Plisko, 2016-08-22
@AmdY

You have Ajax requests for normal urls, and the hash is used only for the clean code, apparently someone on the server is mapping for debugging convenience. On the server, it is naturally not transmitted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question