The first difference is different route paths for API and WEB. Hence, API endpoints don't match the generated paths.
If I fix the route in routes/api.php then UpdateUserRoleRequest fails since I am using a unique attribute in my model. Below line is generated code but it fails because $this->route("user_role") doesn't match any route.
My JSON file is UserRole.json
I did run
php artisan infyom:api_scaffold --fieldsFile=UserRole.json UserRole
routes/api.php
Route::resource('user_roles', 'UserRoleAPIController');
routes/web.php
Route::resource('userRoles', 'UserRoleController');
The first difference is different route paths for API and WEB. Hence, API endpoints don't match the generated paths.
If I fix the route in
routes/api.php
thenUpdateUserRoleRequest
fails since I am using a unique attribute in my model. Below line is generated code but it fails because$this->route("user_role")
doesn't match any route.$rules['slug'] = $rules['slug'].",".$this->route("user_role");
Am I missing something about naming in the documentation?
Also, I tried like below and still the same.
php artisan infyom:api_scaffold --fieldsFile=User_Role.json User_Role