If ($request->has('name')) {
//
}
If ($request->has(['name', 'email'])) {
//
}
If ($request->filled('name')) {
//
}
-
You should use the has method to determine if a value is present on the request.
-
If you would like to determine if a value is present on the request and is not empty, you may use the filled method:.
-
When given an array, the has method will determine if all of the specified values are presen.