Skip to content

Commit e03fee1

Browse files
authored
Merge pull request #110 from itskawsar/item-description
Item description
2 parents efc7c27 + b3e49e7 commit e03fee1

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed
18.7 KB
Binary file not shown.

resources/views/templates/default.blade.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@
123123
.border-0 {
124124
border: none !important;
125125
}
126+
.description {
127+
margin-top: 0.25rem;
128+
margin-bottom: 0;
129+
color: #999;
130+
}
126131
</style>
127132
</head>
128133

@@ -264,7 +269,12 @@
264269
{{-- Items --}}
265270
@foreach($invoice->items as $item)
266271
<tr>
267-
<td class="pl-0">{{ $item->title }}</td>
272+
<td class="pl-0">
273+
{{ $item->title }}
274+
@if($item->description)
275+
<p class="description">{{ $item->description }}</p>
276+
@endif
277+
</td>
268278
@if($invoice->hasItemUnits)
269279
<td class="text-center">{{ $item->units }}</td>
270280
@endif

src/Classes/InvoiceItem.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class InvoiceItem
1616
*/
1717
public $title;
1818

19+
/**
20+
* @var string|bool
21+
*/
22+
public $description = false;
23+
1924
/**
2025
* @var string
2126
*/
@@ -77,6 +82,17 @@ public function title(string $title)
7782
return $this;
7883
}
7984

85+
/**
86+
* @param string $description
87+
* @return $this
88+
*/
89+
public function description(string $description)
90+
{
91+
$this->description = $description;
92+
93+
return $this;
94+
}
95+
8096
/**
8197
* @param string $units
8298
* @return $this

0 commit comments

Comments
 (0)