use Illuminate\Http\Request; $request = Request::capture(); $method = $request->method(); echo $method; // Will output GET, POST, PUT, DELETE, etc.
use Illuminate\Http\Request; $request = Request::capture(); $name = $request->input('name'); echo $name; // Will output the value of the 'name' parameter
use Illuminate\Http\Request; $request = Request::capture(); $uri = $request->path(); echo $uri; // Will output the path component of the requested URLThis example shows how to retrieve the path component of the requested URL (i.e., the part after the domain name) using the path() method. In conclusion, the illuminate/http Request class provides an easy and powerful way to handle HTTP requests in PHP. This class is part of the Illuminate package library which is used by the Laravel framework.