| Defining routes with parameter | ---
| Bug? | no
| New Feature? | no
| Framework | Laravel
| Framework version | 8.54
| Package version | 3.0.0
| PHP version | 7.4.22
Actual Behaviour
Hey everyone, I am new to Dingo API and following documentation but I am struggling with creating routes with parameters. When I send a request to localhost/users it works as expected and response me all users in database. But when I try to send a request to show a specific user via id parameter, it returns 500 error with following message, also if I run a php artisan command it gives me the same error:
Illuminate\Routing\Exceptions\UrlGenerationException
Missing required parameter for [Route: users.show] [URI: api/users/{id}] [Missing parameter: id].
class UserController extends Controller
{
public function index()
{
return User::all();
}
public function show($id)
{
return User::where("id",$id)->first();
}
}
| Defining routes with parameter | --- | Bug? | no | New Feature? | no | Framework | Laravel | Framework version | 8.54 | Package version | 3.0.0 | PHP version | 7.4.22
Actual Behaviour
Hey everyone, I am new to Dingo API and following documentation but I am struggling with creating routes with parameters. When I send a request to localhost/users it works as expected and response me all users in database. But when I try to send a request to show a specific user via id parameter, it returns 500 error with following message, also if I run a php artisan command it gives me the same error: Illuminate\Routing\Exceptions\UrlGenerationException Missing required parameter for [Route: users.show] [URI: api/users/{id}] [Missing parameter: id].
Steps to Reproduce
api routes:
User Controller
How can I fix this? Thanks in advance.