Tutorial by Examples

To obtain an instance of an HTTP Request, class Illuminate\Http\Request need to be type hint either in the constructor or the method of the controller. Example code: <?php namespace App\Http\Controllers; /* Here how we illuminate the request class in controller */ use Illuminate\Http\Re...
Sometimes we need to accept route params as well as access the HTTP Request params. We can still type hint the Requests class in laravel controller and achieve that as explained below E.g. We have a route that update a certain post like this (passing post id i route ) Route::put('post/{id}', 'Post...

Page 1 of 1