diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bf50ed..4022c7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +0.20.1 (2024-10-02) +------------------- + +- Forms : `@csrf` and `@method` only when needed + + 0.20.0 (2024-10-01) ------------------- diff --git a/resources/views/bootstrap-4/components/forms/form.blade.php b/resources/views/bootstrap-4/components/forms/form.blade.php index a51e204..c1a388b 100644 --- a/resources/views/bootstrap-4/components/forms/form.blade.php +++ b/resources/views/bootstrap-4/components/forms/form.blade.php @@ -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 !!} \ No newline at end of file diff --git a/resources/views/bootstrap-5/components/forms/form.blade.php b/resources/views/bootstrap-5/components/forms/form.blade.php index a51e204..c1a388b 100644 --- a/resources/views/bootstrap-5/components/forms/form.blade.php +++ b/resources/views/bootstrap-5/components/forms/form.blade.php @@ -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 !!} \ No newline at end of file