<a href="{{ url('/home') }}">Home</a>
<a href="{{ route('logout') }}" onclick="event.preventDefault();document.getElementById('logout-form').submit();">Logout</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display:none">
@csrf
</form>
Having trouble submitting the form above as I continue to receive this error message:
(index):36 Uncaught TypeError: Cannot read properties of null (reading 'submit')
Any guidance on what might be wrong here would be greatly appreciated. Thanks!