How to get the Model id in custom Request class

use route() method on request to retrive the route parameter


if your route is like /users/{user_id} then $this->route('user_id'); will give you the parameter user_id value in request if you have bind custom parameter name in route model binding use that parametername in route() method

for ex. Route::model('user', App\User::class); then use $this->route('user'); to retrive the user model directly.

PS. $this means you should be in your Request class where you define rules() and messages() method.