Skip to content

Commit

Permalink
Merge pull request #566 from bjhijmans/master
Browse files Browse the repository at this point in the history
Show boolean examples properly
  • Loading branch information
shalvah authored Nov 23, 2022
2 parents 6c17082 + 94f278d commit 1befaff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions resources/views/components/field-details.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@
@endif
<br>
@php
if($example !== null && $example !== '' && !is_array($example)) {
$exampleAsString = $example === false ? "false" : $example;
$description .= " Example: `$example`";
if($example !== null && $example !== '' && !is_array($example)) {
$exampleAsString = $example;
if (is_bool($example)) {
$exampleAsString = $example ? "true" : "false";
}
$description .= " Example: `$exampleAsString`";
}
@endphp
{!! Parsedown::instance()->text(trim($description)) !!}

0 comments on commit 1befaff

Please sign in to comment.