File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
resources/views/admin/post Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public function up()
20
20
$ table ->text ('content ' );
21
21
$ table ->string ('image ' );
22
22
$ table ->boolean ('status ' );
23
- $ table ->integer ('views ' );
23
+ $ table ->integer ('views ' )-> nullable () ;
24
24
$ table ->foreignId ('cat_id ' )->constrained ('categories ' )->onDelete ('cascade ' );
25
25
$ table ->foreignId ('user_id ' )->constrained ('users ' )->onDelete ('cascade ' );
26
26
$ table ->timestamps ();
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ class="py-4 px-6 bg-grey-lightest font-bold uppercase text-sm text-grey-dark bor
28
28
<th
29
29
class =" py-4 px-6 bg-grey-lightest font-bold uppercase text-sm text-grey-dark border-b border-grey-light" >
30
30
Tags</th >
31
+ <th
32
+ class =" py-4 px-6 bg-grey-lightest font-bold uppercase text-sm text-grey-dark border-b border-grey-light" >
33
+ Views</th >
31
34
<th
32
35
class =" py-4 px-6 bg-grey-lightest font-bold uppercase text-sm text-grey-dark border-b border-grey-light" >
33
36
Added by</th >
@@ -56,6 +59,13 @@ class="text-xs font-normal leading-none max-w-full flex-initial">
56
59
@endforelse
57
60
</div >
58
61
</td >
62
+ <td class =" py-4 px-6 border-b border-grey-light" >
63
+ @if (isset ($post -> views ) )
64
+ {{ $post -> views } }
65
+ @else
66
+ 0
67
+ @endif
68
+ </td >
59
69
<td class =" py-4 px-6 border-b border-grey-light" >{{ $post -> user -> name } } </td >
60
70
<td class =" py-4 px-6 border-b border-grey-light" >
61
71
@can (' update' , $post )
You can’t perform that action at this time.
0 commit comments