Skip to main content

Navigation

Back Link code

Copy the implementation or inspect every file that belongs to this component unit.

resources/views/components/ui/back-link.blade.php

@props([
    'href' => '#',
    'label' => 'Back',
])

@php
    /*
    | Compact back-navigation link with a leading arrow icon.
    |
    | Usage:
    |   <x-ui.back-link :href="route('posts.index')" label="All posts" />
    */
@endphp

<a
    href="{{ $href }}"
    {{ $attributes->merge(['class' => 'inline-flex items-center gap-1.5 text-sm font-medium text-gray-500 transition hover:text-gray-900 dark:text-gray-400 dark:hover:text-white']) }}
>
    <x-ui.icon name="arrow-left" weight="bold" size="sm" />
    {{ $label }}
</a>