Hi developers, as all of us know that whenever we work on any restful backend. We have to deal with the path variables for example
/user/{username}
We have created this endpoint to provide the user data to client after getting the username value from the client.
This endpoint provides the user data to the client. It takes one path variable username and then fetches the data from database and returns to the client.
In Trishul API, you can get this path variable from the $request object.
$username = $request->path()->get('username');
That's it. You will get the $username from the path variable and pass it to your logic.