回答編集履歴

1

修正

2020/05/29 08:22

投稿

phper.k
phper.k

スコア3923

test CHANGED
@@ -24,13 +24,13 @@
24
24
 
25
25
  $shops = Shop::query()
26
26
 
27
- ->when($request->has('shopname'), function($query){
27
+ ->when($request->has('shopname'), function($query) use ($shopname) {
28
28
 
29
29
  $query->where('shopname', 'like', '%' . $shopname . '%');
30
30
 
31
31
  })
32
32
 
33
- ->when($request->has('address'), function($query){
33
+ ->when($request->has('address'), function($query) use ($address) {
34
34
 
35
35
  $query->where('address', 'like', '%' . $address . '%');
36
36