I came across a Laravel tutorial. It’s about authentication system and creating login interface.
There is some strange code that I don’t understand.
There is a login form submitting a post request to server to authenticate. Based on input data, it may fail with errors (Like invalid email or …). There is a field under the form to show those errors:
@if ($errors->any())
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
@endif
PHP directives execute on server side (?), so how it shows errors after submitting the form? Page is already loaded. So how it works?