Skip to content

Commit

Permalink
Merge pull request #26 from forxer/develop
Browse files Browse the repository at this point in the history
Forms : @csrf and @method only when needed
  • Loading branch information
lgtaxn authored Oct 2, 2024
2 parents 66630e1 + 82d3eac commit ecfa8d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

0.20.1 (2024-10-02)
-------------------

- Forms : `@csrf` and `@method` only when needed


0.20.0 (2024-10-01)
-------------------

Expand Down
8 changes: 6 additions & 2 deletions resources/views/bootstrap-4/components/forms/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
@if ($novalidate === true) novalidate @endif
{{ $attributes }}
>
@csrf
@method($method)
@if ($method !== 'GET')
@csrf
@if ($method !== 'POST')
@method($method)
@endif
@endif
{!! $slot !!}
</form>
8 changes: 6 additions & 2 deletions resources/views/bootstrap-5/components/forms/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
@if ($novalidate === true) novalidate @endif
{{ $attributes }}
>
@csrf
@method($method)
@if ($method !== 'GET')
@csrf
@if ($method !== 'POST')
@method($method)
@endif
@endif
{!! $slot !!}
</form>

0 comments on commit ecfa8d9

Please sign in to comment.