There may be times when you want to check whether a URL in your Laravel application is a valid signed URL. Most of the time, this is something youโd need to do in your application code where you can reach for the
\Illuminate\Routing\Middleware\ValidateSignature
middleware class, or the$request->hasValidSignature()
method on theIlluminate\Http\Request
class.However, in the past, Iโve needed to write some tests to ensure that a signed URL is correctly generated and stored in the database. Admittedly, itโs not something I need to do often, but I thought it might be useful to share how to do this in case you find yourself in a similar situation.
In this Quickfire article, Iโm going to show you how to check whether a signed URL is valid in your tests.
If youโre not familiar with signed URLs, you might be interested in my existing article which explains what they are: How to Assert Redirects to Signed URLs in Laravel Tests
continue reading on ashallendesign-uk.medium.com
โ ๏ธ This post links to an external website. โ ๏ธ
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.