Request param is string but model still return data #42484
Unanswered
simpsons310
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel version: 9.9.0
PHP version: 8.1.6
I have 1 route like this:
In the
RoomController:In my database, in
roomstable, I have a record hasid = 74When I try to call a
patchto routeroom/74, in the controller,$roomreturns a correctRoommodel object withid = 74. But when I type some string after74, it still returns theRoomobject withid = 74to$roomvariable. e.g.room/74wasdsaw.I also tried to
dd($request->all())and it returned74wasdsawI wonder if this is a bug or a laravel's feature. If it's a feature, what is the purpose to?
Beta Was this translation helpful? Give feedback.
All reactions