inspheric / nova-indicator-field Goto Github PK
View Code? Open in Web Editor NEWA colour-coded indicator field for Laravel Nova
A colour-coded indicator field for Laravel Nova
I have a integer field in the database that indicate the status, and only see a blank field in the nova resource.
I used as:
Indicator::make('status')
->labels(
[
'0' => 'Pendiente',
'1' => 'En proceso',
'2' => 'Completa',
'3' => 'Cerrada',
'4' => 'Vencida',
'100' => 'Eliminada',
'101' => 'Sin Proveedores',
]
),
Also I try:
Indicator::make('status')
->labels(
[
0 => 'Pendiente',
1 => 'En proceso',
2 => 'Completa',
3 => 'Cerrada',
4 => 'Vencida',
100 => 'Eliminada',
101 => 'Sin Proveedores',
]
),
How to i can add custom colors?
Indicator::make('Status')
->colors([
'banned' => '#a466bd',
'active' => '#a2c617',
'invited' => '#e92919',
'inactive' => '#000000',
])
I would love to have an option where the labels aren't rendered out, but show a popup with the label value on hover. Thanks for this! :)
The Database field => Display field pairs used in this package should be switched around to match Novas default (used in filters etc.) which is Display field => Database field.
I’ve a table with a renewal date field (timestamp) and what to show a status. If the renewal date field has expired then I want to display fact. Here’s my code - but it just shows a dash and no label on the index view.
// Model
public function membershipStatusAttribute() {
if ($this->renewal_date < now()) {
return 'expired';
} else {
return 'valid';
}
}
// Nova resource
Indicator::make('membership_status')
->labels([
'expired' => 'Expired',
'valid' => 'Valid',
])->colors([
'expired' => 'red',
'valid' => 'green',
]),
When running composer require, error message appears:
Class 'Inspheric\Fields\IndicatorFieldServiceProvider' not found
Is this very helpful package abandoned??
nova 4.2.3
laravel 8
It would be amazing if this field could be used as a computed field for its value.
Hi all
The Indicator Field seems not work for a boolean field, as I guess it's not it's intended behaviour. However, it would be great if this would work with boolean fields, too, as I think boolean fields in Nova lack of options to customize.
I can make it work with boolean with a computed field:
Indicator::make('Some Bool', function () {
return (int) $this->someBool;
})->labels([
0 => 'inactive'
1 => 'active'
])
but this takes away "sortable". Is there a better place to cast the boolean?
Default Text or Select field working but not Indicator
Text::make('Status')
Indicator::make('Status')
->labels([
'a' => 'Active',
]),
Same error even doing:
Indicator::make('Status')->withoutLabels()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.