Related tags:

Laravel Route Label

A tiny Laravel package that lets you attach human‑friendly labels to your routes and use them in views via a helper or a Blade directive.

  • Route macro: ->label('My Label') (supports string‑backed Enums)
  • Localizing the label You can also pass a translatable string ->label(__('MyLabel')) or key ->label(__('routes.home')) for a label
  • Helper: routeLabel('route.name') → label or route name fallback
  • Blade directive: @routeLink('route.name')<a href="/...">Label</a>
  • Extended Blade directive: @routeLink('route.name', ['class' => 'btn', 'wire:navigate' => true]) → enhanced <a> tag with custom attributes
  • Block Blade directives: @routeLinkStart('route.name', ['attributes']) ... @routeLinkEnd → for complex link content
  • Blade component: <x-route-link route="route.name" />

Requirements

  • PHP: 8.2, 8.3, 8.4
  • Laravel: 10.x, 11.x, 12.x (Illuminate Support/View/Routing)