{{-- resources/views/components/printable-table.blade.php --}} @props([ 'data' => [], 'headers' => [], 'title' => 'Data Report', 'showActions' => true, 'actionButtons' => null, 'organization' => 'Organization Name' ])
@if($showActions)
@endif
@if (count($data) > 0) @foreach($headers as $header) @endforeach @if($showActions && $actionButtons) @endif @foreach ($data as $index => $row) @foreach($row as $key => $value) @if(!in_array($key, ['actions'])) @endif @endforeach @if($showActions && $actionButtons) @endif @endforeach
{{ $header }} Actions
@if(is_array($value)) {{ implode(', ', $value) }} @elseif($value instanceof \Carbon\Carbon) {{ $value->format('d/m/Y') }} @elseif(is_bool($value)) {{ $value ? 'Yes' : 'No' }} @else {{ Str::limit($value, 60) }} @endif
{!! $actionButtons($row, $index) !!}
@else

No data found.

@endif