1// https://laravel.com/docs/8.x/requests
2// Determines if a value is present on the request
3if($request->has('name')) {
4 // logic ...
5}
6// Determine if a value is present on the request and is not empty
7if($request->filled('name')) {
8 // Not empty
9 // Logic ..
10}
11// OR
12if(!empty($request->input('user_id'))) {
13 // Not empty
14 // Logic ..
15}
16
17// Check if All Request Input empty / not
18if(count($request->all()) > 0) {
19 // all request input not empty.
20 // Logic ....
21} else {
22 // all request inputs empty.
23 // Logic
24}
25