Best for
- Mailable classes with HTML/Blade or Markdown templates
- Queued email sending
- Attachments and inline images
event4u-app/agent-config/src/skills/laravel-mail/SKILL.md
Use when building Laravel emails — Mailables, Markdown templates, queued sending, attachments, previews — even when the user says 'send this as an email' without naming Mailables.
Decision brief
Use when building Laravel emails — Mailables, Markdown templates, queued sending, attachments, previews — even when the user says 'send this as an email' without naming Mailables.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/laravel-mail"Inspect the Agent Skill "laravel-mail" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/laravel-mail/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Inspect existing mailables — Review app/Mail/ for naming, base class, queueing convention, and the templates in resources/views/emails/ for the project's markdown style. 2. Generate class — php artisan make:mail InvoiceMail --markdown=emails.invoice. 3. Configure — Set subjec…
Use this skill when building email functionality: - Mailable classes with HTML/Blade or Markdown templates - Queued email sending - Attachments and inline images - Mail testing and previewing
Review the “Example” section in the pinned source before continuing.
blade {{-- resources/views/emails/invoice.blade.php --}}
Thank you for your order. Here is your invoice summary:
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 7 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill when building email functionality:
For simple notification emails (one-off messages), see laravel-notifications. Use Mailables when you need full control over the email template.
app/Mail/ for naming, base class, queueing convention, and the templates in resources/views/emails/ for the project's markdown style.php artisan make:mail InvoiceMail --markdown=emails.invoice.ShouldQueue).resources/views/emails/.php artisan make:mail InvoiceMail --markdown=emails.invoice
declare(strict_types=1);
namespace App\Mail;
use App\Models\Invoice;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class InvoiceMail extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
public function __construct(
private readonly Invoice $invoice,
) {}
public function envelope(): Envelope
{
return new Envelope(
subject: 'Invoice #' . $this->invoice->getNumber(),
replyTo: ['billing@example.com'],
);
}
public function content(): Content
{
return new Content(
markdown: 'emails.invoice',
with: [
'invoice' => $this->invoice,
'url' => route('invoices.show', $this->invoice->getId()),
],
);
}
/** @return array<int, \Illuminate\Mail\Mailables\Attachment> */
public function attachments(): array
{
return [
Attachment::fromPath('/path/to/invoice.pdf')
->as('invoice-' . $this->invoice->getNumber() . '.pdf')
->withMime('application/pdf'),
];
}
}
{{-- resources/views/emails/invoice.blade.php --}}
<x-mail::message>
# Invoice {{ $invoice->getNumber() }}
Thank you for your order. Here is your invoice summary:
<x-mail::table>
| Item | Amount |
|:-----|-------:|
@foreach ($invoice->getItems() as $item)
| {{ $item->getName() }} | {{ $item->getFormattedAmount() }} |
@endforeach
| **Total** | **{{ $invoice->getFormattedTotal() }}** |
</x-mail::table>
<x-mail::button :url="$url">
View Invoice
</x-mail::button>
Thanks,<br>
{{ config('app.name') }}
</x-mail::message>
// Send immediately
Mail::to($user)->send(new InvoiceMail($invoice));
// Queue for background sending (preferred)
Mail::to($user)->queue(new InvoiceMail($invoice));
// Send later
Mail::to($user)->later(now()->addMinutes(10), new InvoiceMail($invoice));
// Multiple recipients
Mail::to($users)
->cc($manager)
->bcc('archive@example.com')
->send(new InvoiceMail($invoice));
// Assert mail was sent
Mail::fake();
// ... trigger action ...
Mail::assertSent(InvoiceMail::class, function (InvoiceMail $mail) use ($user) {
return $mail->hasTo($user->getEmail());
});
Mail::assertNotSent(InvoiceMail::class);
Mail::assertNothingSent();
Mail::assertQueued(InvoiceMail::class);
// routes/web.php (local only)
Route::get('/mail-preview', function () {
$invoice = Invoice::factory()->create();
return new InvoiceMail($invoice);
});
ShouldQueue to avoid blocking requests.build() method.Mail::fake() — verify recipients, content, and queuing.ShouldQueue) — synchronous sending blocks the request.Mail::fake() alone — it doesn't render the template. Use Mail::assertSent() with closure.build() method — use envelope(), content(), attachments().Alternatives
coreyhaines31/marketingskills
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
event4u-app/agent-config
Use BEFORE writing/changing tests, adding mocks, or test-only methods on production classes — vs mocking-the-mock, production pollution, partial mocks, and overfit/tautological assertions
event4u-app/agent-config
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
event4u-app/agent-config
Use when writing, generating, or improving Pest tests for Laravel — clear intent, good coverage, maintainable structure, and alignment with project testing conventions.