Coder Social home page Coder Social logo

nova-custom-views's Introduction

Latest Stable Version Total Downloads Monthly Downloads Daily Downloads

Nova Custom Views

This package allows you to create customizable views for specific Nova resources.

Installation

composer require digitalcloud/nova-custom-views

Then you need to add the service provider to your config/app.php after the NovaServiceProvider:

 /*
    |--------------------------------------------------------------------------
    | Autoloaded Service Providers
    |--------------------------------------------------------------------------
    |
    | The service providers listed here will be automatically loaded on the
    | request to your application. Feel free to add your own services to
    | this array to grant expanded functionality to your applications.
    |
    */

    'providers' => [

        ...
        App\Providers\NovaServiceProvider::class,
        ...
        devmtm\NovaCustomViews\NovaCustomViewsServiceProvider::class,
        ...

Create a new view This is the same process as for any other Nova Tool, ResourceTool or Field. You can simply use this command in your terminal:

php artisan nova:views resource-name view-name

This will create your view component in /nova-components/views/resource-name. If you've installed the dependencies during the previous process, you can directly go ahead and use:

cd ./nova-components/views/resource-name && npm run watch

Allowed values for view-name are [index | lens | detail | create | update | attach | update-attached]

If you dont provide view-name, it will create all previous nova views.

You can modify any view component inside /nova-components/views/resource-name/resources/js/views

Example Usage: Creating custom detail view for user resource

To create a new view, say user detail view, you can run the command:

php artisan nova:views user detail

This will create a new path: '/nova-components/views/user' which contains all generated user views. The new view is extended the default user nova detail view (using vue mixins). You can modify the default view by going to the path: '/nova-components/views/user/resources/js/views/Detail.vue' and add your custom code as the following:

<template>
   <div>YOUR_CODE_HERE</div>
</template>

Example Usage: Creating Custom Dashboard

To create a custom dashboard view, you can run the command:

php artisan nova:dashboard

This will create a new path: '/nova-components/views/dashboard' which contains the custom dashboard component. The new view is extended the default nova dashboard view (using vue mixins). You can modify the dashboard view by going to the path: '/nova-components/views/user/resources/js/views/Dashboard.vue' and add your custom code as the following:

<template>
   <div>YOUR_CODE_HERE</div>
</template>

nova-custom-views's People

Contributors

devmtm avatar levflavien avatar devmsh avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.