Last updated 4 years ago
To protect routes, keep the routes inside if statement as below
HEAD -/protected-route
HEAD
-/protected-route
You must have token to access protected routes.
To generate a token, see under
Authorization
string
Bearer Token
if($auth->routes()){ // Protect routes must be in this if statment $router->get("/protected-route",function(){ echo "You've just accessed the protected route"; }) }
{ "status":200, "message:"Succefully retrieved data", "data":[..] }