Skip to content

v2.0.6

Compare
Choose a tag to compare
@gigili gigili released this 01 Oct 12:24
· 73 commits to main since this release

Add new method wrappers:

  • Add a wrapper for adding get endpoint
  • Add a wrapper for adding post endpoint
  • Add a wrapper for adding put endpoint
  • Add a wrapper for adding patch endpoint
  • Add a wrapper for adding delete endpoint

Sample:

$routes
    ->prefix("/test")
    ->middleware(['decode_token'])
    ->route("/t0", function(Request $request){})
    ->get("/t1", function (){})
    ->post("/t2", function (){})
    ->put("/t3", function (){})
    ->patch("/t4", function (){})
    ->delete("/t5", function (){})
    ->save();

Which is equivalent to doing:

$routes
    ->prefix("/test")
    ->middleware(['decode_token'])
    ->route("/t0", function(Request $request){})
    ->route("/t1", function (){}, [Routes::GET])
    ->route("/t2", function (){}, [Routes::POST])
    ->route("/t3", function (){}, [Routes::PATCH])
    ->route("/t4", function (){}, [Routes::PUT])
    ->route("/t5", function (){}, [Routes::DELETE])
    ->save();