File tree 3 files changed +3
-3
lines changed
resources/assets/js/components/blog
3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public function index()
38
38
$ posts = [];
39
39
40
40
//transform
41
- foreach (Post::all () as $ key => $ value ) {
41
+ foreach (Post::orderBy ( ' created_at ' , ' desc ' )-> get () as $ key => $ value ) {
42
42
$ posts [$ key ]['id ' ] = $ value ['id ' ];
43
43
$ posts [$ key ]['title ' ] = $ value ['title ' ];
44
44
$ posts [$ key ]['date ' ] = Carbon::parse ($ value ['created_at ' ])->toDateString ();
Original file line number Diff line number Diff line change 28
28
29
29
<footer class =" footer" >
30
30
Copyright © {{ (new Date()).getFullYear() }} |
31
- Powered by <a href =" " target =" _blank" >z-blog</a >
31
+ Powered by <a href =" https://github.com/zhaohehe/z-blog " target =" _blank" >z-blog</a >
32
32
</footer >
33
33
</div >
34
34
</template >
Original file line number Diff line number Diff line change 21
21
22
22
<footer class =" footer" >
23
23
Copyright © {{ (new Date()).getFullYear() }} |
24
- Powered by <a href =" " target =" _blank" >z-blog</a >
24
+ Powered by <a href =" https://github.com/zhaohehe/z-blog " target =" _blank" >z-blog</a >
25
25
</footer >
26
26
</div >
27
27
</template >
You can’t perform that action at this time.
0 commit comments