Enhance TestEmailController and view to include CSRF token and improve form security

This commit is contained in:
Frank John Begornia
2026-02-26 23:12:00 +08:00
parent ee91fe18c6
commit 005b64233b
2 changed files with 3 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ class TestEmailController extends Controller
public function show()
{
return view('test-email');
return view('test-email', ['token' => csrf_token()]);
}
public function send(Request $request)

View File

@@ -29,7 +29,8 @@
</div>
<form method="POST" action="{{ url('test-email/send') }}">
{!! csrf_field() !!}
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" name="token" value="{{ $token }}">
<div class="form-group{{ $errors->has('recipient') ? ' has-error' : '' }}">
<label for="recipient">Recipient Email</label>
<input type="email"