Tetravalence's avatar

Defining Middleware

Hello! I'm new to Laravel, sorry for this silly question but I don't understand how/where $request object defines the age public property in "Defining Middleware" guide to Laravel 5.6

0 likes
2 replies
bobbybouwmann's avatar
Level 88

The age property comes from the request itself. So for example when you have a form and you post an input with the name age you can retrieve it from the request.

It's basically the same as $request->get('age'), however Laravel uses a magic getter to retrieve the input.

1 like

Please or to participate in this conversation.