@old directive is similar to
@get and @post
directives. It is used to obtain the last value sent from a form's get or post request method.
This means that it can be used for either post or get
request.
<form method="post">
@csrf
<input type="text" name="username" value="@old.username" >
<input type="password" name="pass" value="@old.pass">
<button @btn('login')></button>
</form>
<form method="post">
@csrf
<input type="text" name="names[]" value="@old.names[0]" >
<input type="text" name="names[]" value="@old.names[1]">
<button @btn('save')></button>
</form>
name attribute is
an array, the @old directive makes it easier to obtain the
last value of the array by supplying the array key. The value will be added only when it exists.