darinlarimore/statamic-3d-field
A Statamic fieldtype for uploading and managing 3D model files, with an interactive control-panel preview powered by Google's model-viewer. Easily add GLB/GLTF assets to entries and render them on your site.
This addon ships a Statamic Control Panel fieldtype that wraps Google's <model-viewer> web component, so editors can upload and preview 3D assets (.glb / .gltf) inside the publish form. 1.1.0 widens the constraint to statamic/cms ^5.0|^6.0, so the same tagged release covers both Statamic 5 and 6 installs.
composer require <vendor>/<package> — the service provider is auto-discovered via extra.statamic; run php artisan vendor:publish --tag=statamic-... only if you intend to override views/Vue.php artisan config:clear && php artisan view:clear && php artisan statamic:stache:clear.models) with glb,gltf,bin,png,jpg allowed — glTF references sibling files, so a dedicated container beats dumping models into assets.resources/blueprints/), restricting it to that container..glb on an entry, confirm the 3D preview renders in the CP, then render it yourself in Antlers with <model-viewer src="{{ model:url }}" camera-controls auto-rotate>.Where to look first: src/Fieldtypes/*.php for component() and the config() keys the fieldtype actually accepts (container/folder/restrictions), and resources/js for the Vue component if you need to know what the preview does. The compiled bundle is shipped — no npm run build required for consumers.
<model-viewer> in resources/views/partials/model-viewer.antlers.html taking src, poster, and a controls flag, so every 3D block on the site has consistent AR/camera behaviour.model-viewer inside the CP compiler. On the front end add <script type="module" src=".../@google/model-viewer.min.js"> via a @push('head') stack or a Vite entry.assets field for a still frame and pass it as poster; it doubles as the mobile fallback and keeps LCP reasonable.{{ model:url }} / $entry->model->url() works in Antlers, Blade, and API resources — no manual path juggling.statamic/cms:^5.0 and ^6.0 in your pipeline before bumping the lockfile; the CP fieldtype bundle is shared, so a green matrix is the real compatibility signal.model-viewer in the Vue compiler and inside Statamic.booting(). That does nothing for your public site; forgetting the front-end script yields an empty inline element that silently collapses to zero height.@vitejs/plugin-vue2 for @vitejs/plugin-vue, externalizes Vue, and emits an IIFE with a FieldtypeMixin banner shim. If you forked the JS, rebase rather than merge — a stale Vue 2 build against Statamic 6 throws resolve errors at runtime.this. in templates is illegal in Vue 3. If you copied the fieldtype component to customise it, any {{ this.foo }}-style template reference must be removed or the field renders blank with only a console warning. Same for the removed toggle-input global — it is now ui-switch, and overridden views referencing the old component break silently.config/statamic/addons.php (cached config) and that you're not on Statamic 4..gltf + .bin + textures break the moment a relative path or CDN URL is off. Prefer self-contained .glb unless you have a reason not to.poster and rely on the field value rather than the live preview.ios-src USDZ both require a secure origin; test on a real device, not just php artisan serve.component(), or publish/override the Vue component; keep Vue externalized in your own build if you register a second addon on the same page, otherwise you double-load Vue and the CP breaks in confusing ways.How can I help you explore Laravel packages today?