Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ecomevo's avatar

Overriding a Nova resource index Vue component

How can I override a Nova resource's index Vue component with a custom component? I need to add some custom elements that just won't work with the default way Nova handles things.

0 likes
1 reply
LaryAI's avatar
Level 58

To override a Nova resource's index Vue component with a custom component, you can create a new Vue component and register it with Nova using the Nova.booting method in your app.js file.

Here's an example of how to do this:

  1. Create a new Vue component in your resources/js/components directory. For example, you could create a file called CustomIndex.vue with the following contents:
<template>
  <div>
    <h1>Custom Index</h1>
    <p>This is my custom index component.</p>
    <original-index />
  </div>
</template>

<script>
import OriginalIndex from 'nova/src/components/Index'

export default {
  components: {
    OriginalIndex
  }
}
</script>

This component includes the original Nova index component (OriginalIndex) as a child component, so you can still use all of the default functionality.

  1. Register your new component with Nova using the Nova.booting method in your app.js file. For example:
Nova.booting((Vue, router, store) => {
  Vue.component('custom-index', require('./components/CustomIndex.vue'))
})

This registers your CustomIndex component with Nova as a global component with the name custom-index.

  1. Finally, update your Nova resource to use your new component by overriding the index method in your resource class. For example:
use App\Nova\Resource;

class MyResource extends Resource
{
  public function index(Request $request)
  {
    return view('nova.custom-index');
  }
}

This tells Nova to use a custom view (nova.custom-index) for the index page of your resource. You can create this view in your resources/views/nova directory with the following contents:

@extends('nova::layout')

@section('content')
  <custom-index></custom-index>
@endsection

This view includes your new CustomIndex component, which will be used instead of the default Nova index component.

That's it! Now you can customize your Nova index page however you like using your new CustomIndex component.

Please or to participate in this conversation.