-
Notifications
You must be signed in to change notification settings - Fork 0
blade directives
Jacob Martella edited this page Oct 16, 2025
·
1 revision
You can trigger actions and apply filters directly within Blade views using two directives: @action and @filter.
See also: Actions, Filters, and Facades.
Calls doAction('hook', $args...).
{{-- Trigger an action --}}
@action('view.rendering', $post)Echoes the result of applyFilters('hook', $value, $args...).
{{-- Apply a filter and echo the result --}}
@filter('title.display', $post->title)- Use actions for side-effects (e.g., logging, dispatching jobs).
- Use filters when you want to transform values for display.
Continue to Testing →