Skip to main content
This endpoint requires an active authenticated session. Unauthenticated requests are redirected to the login page.

Endpoint

Description

Validates the request, looks up a user by the provided email address, and creates a new task assigned to that user. On success, the server returns an HTTP 302 redirect back to the previous page. On failure (user not found or validation error), the server redirects back with errors in the session.
The user field must be the email address of a user who already exists in the database. The endpoint does not create new users. If no matching user is found, the request is redirected back with a user: User not found. validation error.

Request body

string
required
The title of the task. Maximum 255 characters.
string
required
A detailed description of the task. Maximum 500 characters.
string
required
The email address of the user to assign the task to. Must be a valid email format and must match an existing user record.

Response

This endpoint does not return a JSON body on success. It returns an HTTP 302 redirect to the previous URL (Laravel redirect()->back()). The Vue.js frontend does not rely on the redirect body — instead, the component calls fetchTasks after submission to refresh the task list. On failure, the redirect includes session error data which Laravel flashes to the session:
Validation failures follow the standard Laravel 422 format when called via an AJAX client that sets the Accept: application/json header.

Controller code

Frontend Axios call