ArtisanPack UI
DocsHooksBlade Directives

Blade Directives

Hooks v1.3.0

You can trigger actions and apply filters directly within Blade views using two directives: and . See also: Actions, Filters, and Facades. Calls . Echoes...

You can trigger actions and apply filters directly within Blade views using two directives: @action and @filter.

See also: Actions, Filters, and Facades.

@action

Calls doAction('hook', $args...).

{{-- Trigger an action --}}
@action('view.rendering', $post)

@filter

Echoes the result of applyFilters('hook', $value, $args...).

{{-- Apply a filter and echo the result --}}
@filter('title.display', $post->title)

Tips

  • Use actions for side-effects (e.g., logging, dispatching jobs).
  • Use filters when you want to transform values for display.

Continue to Testing →

Stay in the Loop

Monthly tips, tutorials and package updates — plus a free Quick Start cheat sheet.

Subscribe
Edit this page on GitHub