Last active
March 14, 2019 08:44
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
check out \Illuminate\Routing\UrlGenerator::signedRoute for more info on how this works.