Download the PHP package devmtm/nova-custom-views without Composer
On this page you can find all versions of the php package devmtm/nova-custom-views. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devmtm/nova-custom-views
More information about devmtm/nova-custom-views
Files in devmtm/nova-custom-views
Informations about the package nova-custom-views
Nova Custom Views
This package allows you to create customizable views for specific Nova resources.
Installation
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:
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:
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:
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:
Example Usage: Creating Custom Dashboard
To create a custom dashboard view, you can run the command:
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: