Wingman for Craft CMS

Wingman is a Craft 6 plugin. Craft 6 is still in beta, and so is Wingman (6.0.0-beta.1) — try it on staging first and use caution on production sites.

Craft 6 · Beta — use caution on production

Your Laravel models, at home in Craft

Craft 6 can turn an Eloquent model into an element, if you write the classes and the registration for each one. Wingman does it from the control panel: pick a model, give it a handle, and your customers, orders or bookings get an index, an editor, permissions and a relation field your entries can use.

Wingman

Same model, every template engine

Each model gets a template query in Twig and Blade. Pro adds the other direction: from a model row to the entries that point at it, without N+1 queries.

twig
{# Twig #}
{% for customer in craft.customers().orderBy('name').all() %}
  {{ customer }} — {{ customer.company }}
  {# Pro: entries relating to this customer #}
  {{ wingman.relatedEntries(customer, 'customers').count() }} case studies
{% endfor %}

{{-- Blade --}}
@foreach ($craft->customers()->all() as $customer) {{ $customer }} @endforeach

// PHP (Pro), on the model itself
$customer->craftEntries('customers')->all();
Customer::loadCraftEntries($customers, 'customers'); // no N+1

Features

Everything around core's Eloquent elements that you'd otherwise write by hand.

Registered from the control panel

Pick a model from your app, give it a handle and a label, choose its label column, what trashing does to the row, and whether it's in the sidebar. No element classes, no field classes, no service provider code.

Guarded so it can't take your site down

Handles that would collide with Craft's own element types or CP pages, Craft's own models, unknown classes and hidden label columns are refused with a message. A model that breaks later is skipped and logged.

Health, backfill and orphans

See rows, rows with elements, missing elements and orphans per model. Backfill creates missing elements without touching your rows, and queues itself for big tables. Delete orphans cleans up after rows deleted outside Eloquent.

Twig and Blade

craft.customers() in both engines, elements that print their label, and wingman.element(model) to get from a model row to its element.

Pro: reverse lookups and conditions

A trait gives your models craftEntries() and eager loading for lists. Element indexes and relation fields get a condition rule per model attribute.

Pro: GraphQL, $hidden respected

Typed queries per model and typed relation fields, each model behind its own schema permission. Attributes your model hides are never fields, filters or sort keys.

Frequently Asked Questions

The questions worth answering before you install it.

Try it on staging today

Lite is free. Wingman is a Craft 6 beta plugin on a beta CMS — start on a development or staging site and use caution on production.

More plugins

Pairs well with Wingman