https://github.com/antonioribeiro/nova-boolean-datetime-field
A Laravel Nova Boolean DateTime field
https://github.com/antonioribeiro/nova-boolean-datetime-field
Last synced: 6 months ago
JSON representation
A Laravel Nova Boolean DateTime field
- Host: GitHub
- URL: https://github.com/antonioribeiro/nova-boolean-datetime-field
- Owner: antonioribeiro
- License: mit
- Created: 2019-01-20T19:44:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-09T07:37:03.000Z (over 5 years ago)
- Last Synced: 2025-04-14T12:56:36.571Z (6 months ago)
- Language: PHP
- Size: 403 KB
- Stars: 21
- Watchers: 5
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Laravel Nova Boolean DateTime Field
This package allows you to show set/unset states for your date fields as boolean view or badges.
This is how your boolean dates will render:

Edit view will let you use the DatePicker as always

Detail view will show badges and values

### Installation Instructions
Install via [Composer](https://getcomposer.org/):
`$ composer require pragmarx/nova-boolean-datetime-field`
No you just have to use it in your Resources:
``` php
use PragmaRX\BooleanDatetime\BooleanDatetime;
```And here's some usage examples:
A normal dotted boolean
``` php
BooleanDatetime::make('Sent', 'sent_at'),
```A badge datetime boolean
``` php
BooleanDateTime::make('Delivered', 'delivered_at')
->badge(),
```Change colors
``` php
BooleanDateTime::make('Bounced', 'bounced_at')
->badge()
->colors('bg-danger text-white', 'bg-lighter text-black'),
```Make a less important value a clear badge
``` php
BooleanDateTime::make('Opened', 'opened_at')
->badge()
->colors('bg-success text-white', 'bg-warning text-black'),
```Change badge labels
``` php
BooleanDateTime::make('Clicked', 'clicked_at')
->badge('Done', 'Open'),
```Hide it from index
``` php
BooleanDateTime::make('Clicked', 'clicked_at')
->badge()
->hideFromIndex(),
```