add anywhere csrf protection

This commit is contained in:
root
2026-01-12 18:31:04 +03:00
parent c55264cf42
commit 24ea8deeec
5 changed files with 102 additions and 8 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
{# app/Views/macros/forms.twig #}
{% macro form_open(action, attributes = '') %}
<form action="{{ action }}" method="post" {{ attributes|raw }}>
{# Выводим глобальную переменную csrf_token #}
{# Добавляем data-ajax="true" для автоматической CSRF защиты #}
<form action="{{ action }}" method="post" data-ajax="true" {{ attributes|raw }}>
{{ csrf_field()|raw }}
{% endmacro %}