Skip to content
Laravel Packagev13.xMIT License80+ downloadsAI Ready · Laravel Boost

Messages: Your contact inbox in one call

A Laravel contact form package: validate your form, then store the contact-us message with Message::send(), from a guest or from a signed-in user whose name and email fill the gaps, with an optional attachment. Mark messages read or unread, list the unread ones, and notify your team from the MessageReceived event. It is AI ready: php artisan boost:install teaches your coding agent the whole package through Laravel Boost.

$composer require pharaonic/laravel-messages

Compatibility

Each line is released for the versions in its row, read from that release's composer.json. Pick the line that matches your project; a combination not listed isn't supported. Find the right line of every package for your project.

LineLatest releasePHPLaravelStatusDocs
v13.xv13.0.0 Nov 29, 20268.3 – 8.513Current Docs: Read the v13.x docs
v12.xv12.0.0 Nov 29, 20268.2 – 8.512Maintained Docs: Read the v12.x docs
v11.xv11.0.0 Nov 29, 20268.2 – 8.411MaintainedLaravel 11 no longer gets security fixes Docs: Read the v11.x docs
v10.xv10.0.0 Nov 29, 20268.1 – 8.310MaintainedLaravel 10 no longer gets security fixes Docs: Read the v10.x docs
v9.xv9.0.0 Nov 29, 20268.0 – 8.29MaintainedLaravel 9 no longer gets security fixes Docs: Read the v9.x docs
v8.xv8.0.0 Nov 29, 20268.0 – 8.18MaintainedLaravel 8 no longer gets security fixes Docs: Read the v8.x docs
v7.xv7.0.0 Nov 29, 20268.07MaintainedLaravel 7 no longer gets security fixes Docs: Read the v7.x docs
v6.xv6.0.0 Nov 29, 20268.06MaintainedLaravel 6 no longer gets security fixes Docs: Read the v6.x docs

Maintenance

Latest release
v13.0.0
Nov 29, 2026 (2 days ago)
Released lines
8
documented lines with a release; see compatibility
CI on develop
Tests passed
latest run Nov 29, 2026

From the package's releases and its GitHub Actions. A passing run means the test suite passed on develop, on every PHP version it supports; it isn't a security review, and each release line has its own runs on GitHub. Checked hourly.

A quick look

Validate the form, store the message with its sender and attachment, and read it later.

app/Http/Controllers/ContactController.php
1$data = $request->validate([
2 'message' => ['required', 'string'],
3 'attachment' => ['nullable', 'file', 'max:5120'],
4]);
5 
6$message = Message::send(
7 ['message' => $data['message'], 'ip' => $request->ip()],
8 $request->user(),
9 $request->file('attachment')
10);
11 
12Message::unread()->latest()->get();
13$message->markAsRead();
Key Features

Everything a contact inbox needs

One migration, one model and one call to store a message.

One Call to Store

Message::send() takes the attributes you validated, the sender and the attachment, then dispatches MessageReceived.

Guests or Signed-in Senders

A signed-in sender fills the name, email and mobile the form left out, and stays linked to the message.

Optional Attachment

Stored through Laravel Has Files and read with $message->file('attachment').

Read and Unread

markAsRead(), markAsUnread() and the read() and unread() scopes, with the first read time kept.

AI Ready

Ships a Laravel Boost guideline and a messages-development skill, so php artisan boost:install teaches Claude Code, Cursor, Codex or Copilot the whole API.

Your Table, Your Connection

Configure the table, the connection, and the disk and directory of attachments.

FAQ

Messages Questions

Quick answers about installing and using Messages.

What is Messages?

Store Laravel contact form messages from guests or signed-in users, with an optional attachment, read state and a received event. It's a free, open-source Laravel package by Pharaonic.

How do I install Messages?

Run composer require pharaonic/laravel-messages in your project's root directory, then php artisan migrate.

What does Messages require?

The latest release requires PHP 8.3 – 8.5 and Laravel 13.

How do I build a contact form in Laravel with Messages?

Validate the form in your controller, then call Message::send() with the validated attributes, the signed-in user (or null for a guest) and the uploaded file. The message is stored in the messages table, ready for your admin inbox.

Can guests send messages, or only signed-in users?

Both. Pass null as the sender for a guest. Pass the signed-in user, or any saved Eloquent model, and its name, email and mobile fill the fields the form left out.

Can a contact form message have an attachment?

Yes. Pass the uploaded file as the third argument of Message::send(). It is stored through Laravel Has Files on the disk and in the directory you configure, and read with $message->file('attachment').

How do I list unread messages?

Use the unread() scope, Message::unread()->latest()->get(), and call markAsRead() when someone opens a message. The first read time is kept in read_at.

Does it validate the contact form?

No. Your application validates the request and passes the validated attributes to Message::send(), so the rules, the form and the route stay yours.

How do I notify my team about a new message?

Listen to the MessageReceived event. It is dispatched once the message and its attachment are stored, with the message as $event->message.

How do I stop one visitor from flooding the form?

Use Laravel's throttle middleware or RateLimiter on your contact route.

Is Messages free to use?

Yes. Messages is open source under the MIT license, so you can use it in personal and commercial projects.

Where can I find the Messages documentation?

Read the Messages documentation for setup, configuration, and usage examples.

How do I report a bug or contribute to Messages?

Open an issue or a pull request on GitHub, ask in GitHub Discussions, or chat with us on Discord.

Ready to dig in?

Read the full documentation for installation, configuration, sending messages, senders, attachments, read state, events, and upgrading from 1.x.