Skip to content

Commit e122b7e

Browse files
authored
Merge pull request #26 from Kristories/master
Support hideWhen
2 parents cebe8be + 9de29cd commit e122b7e

File tree

11 files changed

+2024
-620
lines changed

11 files changed

+2024
-620
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,21 @@ Qrcode::make('QR Code', 'field')
8686

8787
![Logo & background](art/4-logo-background.png)
8888

89+
## Dynamic Field Visibility
90+
91+
You can dynamically hide the QR Code field based on another field's value:
92+
93+
#### Hiding the Field Conditionally
94+
95+
Use `hideWhen()` to hide the QR Code field when a condition is met:
96+
97+
```php
98+
Qrcode::make('QR Code', 'code')
99+
->hideWhen(function ($resource) {
100+
return $resource->status === 0; // Hide if status is inactive
101+
});
102+
```
103+
89104
## Related
90105

91106
- [Nova QR Code Manager](https://github.com/Devtical/nova-qrcode-manager)

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
],
1010
"license": "MIT",
1111
"require": {
12-
"php": "^8.0",
13-
"laravel/nova": "^4.0.0|^5.0.0"
12+
"php": "^8.1",
13+
"illuminate/support": "^10.0|^11.0"
1414
},
1515
"require-dev": {
16+
"laravel/nova": "^5.0",
17+
"laravel/nova-devtool": "^1.5",
1618
"laravel/pint": "^1.13"
1719
},
20+
"repositories": [
21+
{ "type": "composer", "url": "https://nova.laravel.com" }
22+
],
1823
"autoload": {
1924
"psr-4": {
2025
"Devtical\\Qrcode\\": "src/"

dist/js/field.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"/js/field.js": "/js/field.js"
2+
"/js/field.js": "/js/field.js?id=dd6c2cca2983ba932ea253aae7aed16d"
33
}

nova.mix.js

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)