Im trying to access request in web.php file but cant find a function to call. Request is passed automatically to all controller functions but I want to perform action common for all routes so I wanted to do it in route/web.php file that is new route file in Laravel 5.3.
i tried
$request = Route::getCurrentRequest();
but it returns null.
You can use request()
global helper in web.php
dd(request());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With