承接 nauticsoft/nova-view 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nauticsoft/nova-view

最新稳定版本:v1.0.0

Composer 安装命令:

composer require nauticsoft/nova-view

包简介

Create custom views in Laravel Nova.

README 文档

README

Nova View is a companion tool for Laravel Nova. It allows you to add new sections to Nova without the need of creating a new tool.

The new section will display a custom defined Blade view, meaning that you can perform any kind of queries and logic inside that view.

Note: at the moment the package has only been tested on Nova v4.

Installation

Requires PHP 8.3+ and Laravel Nova 4 or 5

You can require Nova View using Composer with the following command:

composer require nauticsoft/nova-view

Registering the tool

Nova View is a Laravel Nova tool, meaning that you need to register it in order to be able to use it.

On your NovaServiceProvider, register the tool like so:

use Nauticsoft\NovaView\NovaView; /**  * Get the tools that should be listed in the Nova sidebar.  *  * @return array  */ public function tools() { return [ NovaView::make(), ]; }

This will register the tool and add your views to the sidebar.

If you want to build your sidebar manually, you can disable the menu with:

use Nauticsoft\NovaView\NovaView; /**  * Get the tools that should be listed in the Nova sidebar.  *  * @return array  */ public function tools() { return [ NovaView::make()->withoutMenu(), ]; }

Creating a Nova View

To create a Nova View you need two files:

  • The main class that needs to implement the Nauticsoft\NovaView\Contracts\NovaView interface.
  • A blade view with your content.
namespace App\Nova\Views; use Nauticsoft\NovaView\Contracts\NovaView; class TestNovaView implements NovaView { public function getTitle(): string { return 'Test view'; } public function getView(): string { return 'nova.test'; } public function getSlug(): string { return 'test'; } }
// resources/views/nova/test.blade.php <div class="w-full"> <h1 class="font-normal text-xl">This is my custom view!</h1> <p class="leading-tight mt-3">Welcome to Nova View! For a nice look, make sure to use the classes that Nova is using right now.</p> <h1 class="font-normal text-xl mt-6">Remember, this is a blade view!</h1> <p class="leading-tight mt-3">This is a blade view, meaning that you can use any blade directive you need: <a class="link-default" href="{{ config('app.url') }}"> Go to the home</a> </p> </div>

Register the view

To make Nova View know that you have a view to display, you need to register it in the config/nova.php file:

// config/nova.php 'views' => [ App\Nova\Views\TestNovaView::class, ],

View components

The package comes with a set of components that you can use in your blade views.

<div class="w-full flex flex-col gap-6"> <div class="w-full"> <x-nova-view::heading>This is a custom page</x-nova-view:heading> <p class="leading-tight mt-3">Welcome to a custome page made using Nova View components.</p> </div> <x-nova-view::cards> <x-nova-view::card class="p-6" width="1/4"> <x-nova-view::heading>Some useful information</x-nova-view:heading> </x-nova-view::card> <x-nova-view::card class="p-6" width="1/4"> <x-nova-view::heading>Some useful information</x-nova-view:heading> </x-nova-view::card> <x-nova-view::card class="p-6" width="1/4"> <x-nova-view::heading>Some useful information</x-nova-view:heading> </x-nova-view::card> <x-nova-view::card class="p-6" width="1/4"> <x-nova-view::heading>Some useful information</x-nova-view:heading> </x-nova-view::card> </x-nova-view::cards> <x-nova-view::heading :level="2">List of users</x-nova-view:heading> <x-nova-view::table :fields="['ID', 'Name', 'Last Name']" :rows="[[1, 'John', 'Doe'], [2, 'Jane', 'Doe']]" /> </div>

Nova View is an open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 1.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固