回答編集履歴
1
test
CHANGED
@@ -1,33 +1,15 @@
|
|
1
1
|
効率の良し悪しは別として、私なら下記のように書くと思います。
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
```lang-<ここに言語を入力>
|
6
|
-
|
7
|
-
$reports = Report::whereBetween('created_at', array($from, $to))
|
3
|
+
$reports = Report::whereBetween('created_at', array($from, $to))
|
8
|
-
|
9
4
|
->orderBy('created_at', 'DESC')
|
10
|
-
|
11
5
|
->get();
|
12
6
|
|
13
|
-
|
14
|
-
|
15
7
|
foreach( $reports as $report ) {
|
16
|
-
|
17
|
-
|
8
|
+
$first = $report->created_at;
|
18
|
-
|
19
|
-
|
9
|
+
break;
|
20
|
-
|
21
10
|
}
|
22
|
-
|
23
11
|
$titles = $reports->lists('title');
|
24
12
|
|
25
|
-
|
26
|
-
|
27
13
|
echo $first;
|
28
|
-
|
29
14
|
dd($titles);
|
30
15
|
|
31
|
-
```
|
32
|
-
|
33
|
-
|