I have a function in my controller. The problem is I must use two Requests at the same time but only one of them can be used in a controller.
- Illuminate\Support\Facades\Request
- Illuminate\Http\Request
Code:
public function func(Request $req) {
if (Request::isMethod('post')) {
$this->validate($req, [
'username' => 'required|string'
]);
}
}
What is the solution?