Contacts
An inbox for the messages a public contact form writes to contact_submissions. Read and unread state, archive, bulk actions and reply drafts, with a hook for your own Mailable.


What it adds
| File | Purpose |
|---|---|
app/Models/ContactSubmission.php | Name, email, subject, message, status, IP, reply and reply timestamp |
database/factories/ContactSubmissionFactory.php | Factory with a replied state |
database/migrations/*_create_contact_submissions_table.php | |
app/Livewire/Admin/Contacts/ContactList.php and its view | The inbox |
Install
php artisan ui-kit:install-module contacts
No Composer packages.
What the installer changes
- Adds one route between the markers in
routes/admin.php. - Adds a
Contactsentry with theunread_contactsbadge inconfig/admin.php. - Runs the migration.
Routes
| Route | Name |
|---|---|
GET /admin/contacts | admin.contacts.index |
Left to you
- The public form. Validate and write a
ContactSubmissionfrom your own controller or Livewire component; the module stores and displays, nothing more. - Replies by email.
ContactList@submitReplysaves the draft and has a commentedMail::to()call waiting for yourContactReplyMailable. - The badge. Return
['unread_contacts' => ContactSubmission::where('status', 'unread')->count()]from yourSidebarBadgeResolver.
With support tickets
When the support-tickets module is also installed, each message gets a Copy to Ticket button that opens a ticket for the sender with the message as the first reply.
Removing
Delete the model, factory, Livewire component and view, remove the route line and the nav entry between their markers, drop contact_submissions, and remove contacts from installed_modules.