質問編集履歴
4
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -101,6 +101,37 @@
|
|
101
101
|
return redirect('/');
|
102
102
|
}
|
103
103
|
```
|
104
|
+
### 該当のソースコード
|
105
|
+
|
106
|
+
```php
|
107
|
+
<?php
|
108
|
+
|
109
|
+
namespace App;
|
110
|
+
|
111
|
+
use Illuminate\Database\Eloquent\Model;
|
112
|
+
|
113
|
+
class Management extends Model
|
114
|
+
{
|
115
|
+
protected $fillable = [
|
116
|
+
|
117
|
+
'opening_time','ending_time','break_time',
|
118
|
+
'holiday_time','holiday_night','holiday',
|
119
|
+
'adsence','late','leave_early','holiday_work',
|
120
|
+
'makeup_holiday','project','memo','user_id',
|
121
|
+
'month_id','calendar_id','created_at','updated_at','year'];
|
122
|
+
|
123
|
+
|
124
|
+
public function user(){
|
125
|
+
|
126
|
+
return $this->belongsTo(User::class);
|
127
|
+
}
|
128
|
+
|
129
|
+
public function month(){
|
130
|
+
|
131
|
+
return $this->belongsTo(Month::class);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
```
|
104
135
|
### 試したこと
|
105
136
|
dd()でデバッグして$requestには期待した値が入っていることを確認しています。
|
106
137
|
$update_culumnをdd()すると中はNULLになっていて空の状態でupdateが
|
3
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -36,11 +36,11 @@
|
|
36
36
|
@foreach($edit_list as $edit)
|
37
37
|
<tr>
|
38
38
|
<td>{{$edit->calendar_id}}</td>
|
39
|
-
<td><input class="form-control" type="time" step="900" name="opening_time[]" value="{{$edit->opening_time}}"></td>
|
39
|
+
<td><input class="form-control" type="time" step="900" name="opening_time[{{$edit->id}}]" value="{{$edit->opening_time}}"></td>
|
40
|
-
<td><input class="form-control" type="time" step="900" name="ending_time[]" value="{{$edit->ending_time}}"></td>
|
40
|
+
<td><input class="form-control" type="time" step="900" name="ending_time[{{$edit->id}}]" value="{{$edit->ending_time}}"></td>
|
41
|
-
<td><input class="form-control" type="time" step="900" name="break_time[]" value="{{$edit->break_time}}"></td>
|
41
|
+
<td><input class="form-control" type="time" step="900" name="break_time[{{$edit->id}}]" value="{{$edit->break_time}}"></td>
|
42
|
-
<td><input class="form-control" type="time" step="900" name="holiday_time[]" value="{{$edit->holiday_time}}"></td>
|
42
|
+
<td><input class="form-control" type="time" step="900" name="holiday_time[{{$edit->id}}]" value="{{$edit->holiday_time}}"></td>
|
43
|
-
<td><input class="form-control" type="time" step="900" name="holiday_night[]" value="{{$edit->holiday_night}}"></td>
|
43
|
+
<td><input class="form-control" type="time" step="900" name="holiday_night[{{$edit->id}}]" value="{{$edit->holiday_night}}"></td>
|
44
44
|
<td>
|
45
45
|
<input type="hidden" name="holiday[{{$edit->id}}]" value="0">
|
46
46
|
<input type="checkbox" name="holiday[{{$edit->id}}]" value="{{($edit->holiday)}}">
|
2
修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
laravelでupdateをして更新すると値がNULLになる
|
1
|
+
laravelでupdate()をして更新すると値がNULLになる
|
body
CHANGED
File without changes
|
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -109,4 +109,5 @@
|
|
109
109
|
php 7.3.6 laravel 5.8
|
110
110
|
|
111
111
|
初学者なため質問の意図や情報が足りない場合がありますので
|
112
|
-
遠慮なく仰っていただけると嬉しいです。
|
112
|
+
遠慮なく仰っていただけると嬉しいです。
|
113
|
+
申し訳ありませんがご教示願います...
|