Voyager 2
2.x
2.x
  • Introduction
  • Javascript
  • Media Manager
  • Plugins
  • Settings
  • bread
    • Actions
    • BREAD Builder
    • Layouts
    • Lists
    • Manipulate data
    • Multilanguage
    • Relationships
    • Validation
    • Views
  • contributing
    • Assets
    • CSS
    • Introduction
  • de
    • index
  • formfields
    • Checkboxes
    • Date & Time
    • Dynamic input
    • Formfields
    • Media Picker
    • Number
    • Password
    • Radios
    • Relationship
    • Repeater
    • Select
    • Simple array
    • Slider
    • Slug
    • Tags
    • Text
    • Toggle
  • getting-started
    • Installation
    • Prerequisites
    • Tips and tricks
    • What is Voyager
  • overriding
    • Overriding formfields
    • Icons
  • plugins
    • Assets
    • Components
    • Features
    • Filter
    • Plugin development
    • Language
    • Menu Items
    • Custom pages
    • Preferences
    • Routes
    • Settings
    • Widgets
Powered by GitBook
On this page

Was this helpful?

  1. plugins

Components

To register a Vue component with Voyager, simply call voyager.component('my-component', Component):

import Component from './Component.vue';
voyager.component('my-component', Component);

// Or
import { defineComponent } from 'vue';

voyager.component('my-component', defineComponent({
    data() {
        return {
            // ...
        };
    },
    methods: {
        // ...
    }
}));

Settings

You can provide the name of a component that will be shown in a modal when clicking the Settings button on the plugins page. To do so, include the SettingsComponent trait and return the name of your component in a function named getSettingsComponent:

<?php

use Voyager\Admin\Contracts\Plugins\Features\Provider\SettingsComponent;

class MyPlugin implements SettingsComponent
{
    public function getSettingsComponent(): string
    {
        return 'my-component-name';
    }
}
PreviousAssetsNextFeatures

Last updated 3 years ago

Was this helpful?