bramus / bramus/router

Can I mount a POST route?

Open
#177 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1.1k
Forks
236
PR merge metrics
No merged PRs in 30d

Description

The following code works:

`$router->post('/api/social/contact', 'SocialController@contact');`

But this code doesn't:

```
$router->mount('/api', function() use($router) {
$router->mount('/social', function() use($router) {
$router->post('/contact', 'SocialController@contact');
});
});
```
Note that there is no method specified in the `mount` statement.

Am I missing something?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the nested $router->mount('/api') and $router->mount('/social') calls with the inner $router->post('/contact', ...) route. Inspect how mount and post handle method and path prefixes, then verify that the mounted POST route dispatches to SocialController@contact without requiring a method on mount.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.