menu

arrow_back How do I correct this error?

by
1 vote
Here's the mistake
Hi! How do you fix this error?
Route signingTo create a signed URL to access a given route, it must have a name:Route::get('invitations/{invitation}/{answer}', 'InvitationController') ->name('invitations');To generate a normal link to this route, you can use the helperhocte() we already discussed, as well as the URL facade: URL: :route('invitations', ['invitation' => 12345, 'answer' => 'yes']). For a signed link, add the signedRoute() method instead. And if you need a restricted signed route, a temporarySigned Route():Signed Routes// Generating a normal linkURL::route('invitations', ['invitation' => 12345, 'answer' => 'yes']);// Generating a signed linkURL: :signedRoute('invitations', ['invitation' => 12345, 'answer' => 'yes']);// Generating a signed link with limited validity (temporary)URL::temporarySignedRoute('invitations', now()->addHours(4), ['invitation' => 12345, 'answer' => 'yes']) ;
What did I do wrong? Thank you! p.s.: Quote from the book "Laravel. The Complete Guide. 2nd edition", v. 64

2 Comments

Moderator , OK, I'll put the link text
secret secretom Next time at least copy the text of the error into the question - the links are not always visible and understandable.

1 Answer

by
 
Best answer
0 votes
Add use.
// Прописан в алиасах
use URL;
// Или полный путь
use Illuminate\Support\Facades\URL;