@props(['heading', 'back']) @php $backTitle = ''; if (isset($back)) { $parts = explode('.', $back); if (count($parts) > 1) { $backTitle = ucwords($parts[count($parts) - 2]); } else { $backTitle = ucwords($parts[0]); } } @endphp

{{ $heading }}

@if (isset($back)) Back to {{ $backTitle }} @endif