---
title: "The HasForms trait — Forms for Laravel | Roundly"
description: "Give your user (or any sender) model a submissions relation plus submitTo() and draftTo() shortcuts."
url: https://roundly-consulting.com/open-source/docs/forms-for-laravel/has-forms
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Forms for Laravel](https://roundly-consulting.com/open-source/docs/forms-for-laravel.md)

# The HasForms trait

Add RoundlyConsulting\\Forms\\Concerns\\HasForms to a user or sender model for a morph relation and submit shortcuts:

```php
use RoundlyConsulting\Forms\Concerns\HasForms;

class User extends Authenticatable
{
    use HasForms;
}

$user->submitTo($form, request());     // Forms::submit with $user as sender
$user->draftTo($form, request());      // Forms::draft — both go through the manager, so Forms::fake() records them
$user->formSubmissions;                // morphMany of the user's per-field Submission rows (one per answered field)
Forms::submissions($form)->forSender($user)->get(); // the user's whole submissions, assembled
```

Both shortcuts are sugar over the same manager as the facade — so Forms::fake() records them — and accept the same trailing options:

```php
$user->submitTo($form, request(), bypassClosed: true);   // trusted path
$user->draftTo($form, request(), uuid: $draft->uuid);    // resume a draft

$user->formSubmissions()->where('form_id', $form->getKey())->get();
```

formSubmissions is a morphMany over the per-field Submission rows — one per answered field — so filter by form\_id or group by uuid as needed, or use Forms::submissions($form)->forSender($user) for assembled answer sets.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/forms-for-laravel.md)
