Download the PHP package codenco-dev/nova-grid-system without Composer
On this page you can find all versions of the php package codenco-dev/nova-grid-system. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codenco-dev/nova-grid-system
More information about codenco-dev/nova-grid-system
Files in codenco-dev/nova-grid-system
Package nova-grid-system
Short Description A Laravel Nova tool to have a grid system
License MIT
Informations about the package nova-grid-system
Nova grid system for Laravel Nova
Install
You can install this package via composer:
Then, you will need to register the tool within the NovaServiceProvider.php:
How to use?
This package allows you to define field sizes for detail, update or resource creation pages with tailwind CSS classes.
Like I want
You can use the size
method on your field to add a meta property for each page. All Tailwind fluid classes for size can be used.
See https://tailwindcss.com/docs/width/#fluid-width
Where I want
If you don't want to change the size of fields on each page, you can use methods to filter the effect:
sizeOnCreating
sizeOnUpdating
sizeOnForms
sizeOnDetail
Stacked or not stacked...
Automatically, with the default configuration, the field labels are stacked.
If you don't want this, you can use the stacked
method with a parameter value of false
.
As for previous point, you can do it wherever you want with:
stackedOnCreating
stackedOnUpdating
stackedOnForms
stackedOnDetail
Damn ! There is a bottom border
On the detail page, Nova automatically remove its lower border for the last field. In this package, it's not possible to calculate the last field, so you can delete it yourself. You can use these methods:
removeBottomBorderOnCreating
removeBottomBorderOnUpdating
removeBottomBorderOnForms
removeBottomBorderOnDetail
Example
This code uses the simplest method of configuration::
In this previous example, sizes are ok in forms pages but not in detail pages. This code presents several configurations depending on the context and uses different methods
Play with default values
Do you want go fast to configure your app ?
With the HasDefaultSize
trait, you can use defined default values.
You can use this trait in each resource where you want or on the App\Nova\Resource
file if you want have default
values on each resource automatically.
You be able to define default values on several ways :
- by defining their on config file
- by creating different methods acting, as the case may be (detail, creating, updating) like this :
Methods can be : defaultFieldSize
,defaultFieldSizeOnDetail
,defaultFieldSizeOnCreating
,defaultFieldSizeOnUpdating
.
Configuration
You can disable each "automatic" feature for each type of page with the nova-grid-system.php
config file.
You can define default sizes for every fields.
To publish it, you can use this command:
License
The MIT License (MIT). Please see License File for more information.
About
This package is inspired by a deleted package by Eduardo Geschonke https://github.com/jobcerto