Skip to content

Instantly share code, notes, and snippets.

@leecrosdale
Last active March 14, 2019 08:44
Show Gist options
  • Save leecrosdale/6016c23cde758f9b1e32cd73facc845c to your computer and use it in GitHub Desktop.
Save leecrosdale/6016c23cde758f9b1e32cd73facc845c to your computer and use it in GitHub Desktop.
Use this to check whether your nginx/apache environment is set up correctly when using Laravel signed routes.
Route::get('url', function() {
$signature = \Illuminate\Support\Facades\URL::signedRoute('signedUrl');
return redirect($signature);
})->name('url');
Route::get('signedUrl', function() {
echo "If this function returns != 1, your environment isn't setup properly, check Nginx / Apache config <br/> ";
echo request()->hasValidSignature();
})->name('signedUrl');
@leecrosdale
Copy link
Author

check out \Illuminate\Routing\UrlGenerator::signedRoute for more info on how this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment