Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Neon Laravel Package

nette/neon

Human-friendly configuration format for PHP. NEON is a structured data language similar to YAML/JSON, with neat syntax for arrays and objects, comments, and multiline strings. Includes fast parser and emitter, used across Nette and beyond.

View on GitHub
Deep Wiki
Context7

🍸 Encodes and decodes NEON file format.

Frequently asked questions about Neon
Can I use Nette/Neon for Laravel configuration files instead of PHP arrays or YAML?
Technically yes, but it requires significant custom work. Laravel’s native config system expects arrays or JSON/YAML, so you’d need a custom `ServiceProvider` to parse `.neon` files into Laravel’s config structure. This approach lacks native support for `config:cache` or environment-specific overrides.
Does Nette/Neon offer any advantages over Laravel’s built-in YAML support?
NEON provides a more human-readable syntax for nested configs and supports comments/multiline strings, but Laravel’s YAML already covers these use cases. NEON’s AST parser also introduces overhead compared to Laravel’s optimized config loading.
Will Nette/Neon work with Laravel’s `config:cache` command?
No, not out of the box. NEON files must be manually parsed into PHP arrays before caching, and Laravel’s config cache system isn’t designed to handle NEON’s file-watching or atomic parsing. Custom logic would be required to sync changes.
What Laravel versions does Nette/Neon support?
NEON itself has no Laravel-specific versioning, but its PHP 8.0+ requirements (since v3.4.0) may conflict with older Laravel versions. For Laravel 8/9/10, you’d need to handle breaking changes (e.g., AST rewrites in v3.3.0) manually.
How do I load a `.neon` file in Laravel’s config?
You’d need a custom `ServiceProvider` to decode NEON files into arrays using `Neon::decodeFile()`. Example: `Neon::decodeFile(base_path('config/app.neon'))`, then merge into Laravel’s config array. No native Laravel helpers exist for this.
Are there performance implications of using NEON in Laravel?
Yes. NEON’s AST parser is slower than Laravel’s native config loading, and its strict UTF-8 validation adds overhead. For production, consider caching parsed NEON configs manually, but this bypasses Laravel’s built-in optimizations.
Will Nette/Neon work with Laravel’s service container?
Only if manually bound. NEON configs must be converted to arrays and registered via `bind()` or `singleton()` in a `ServiceProvider`. Laravel’s container won’t auto-detect NEON files like it does for PHP/YAML configs.
Does Nette/Neon integrate with Laravel’s static analysis tools (Psalm/PHPStan)?
Potentially, but you’ll need custom configurations. NEON’s phpDoc improvements (v3.4.8+) may conflict with Laravel’s tooling unless explicitly whitelisted. IDE autocompletion for NEON configs would also require custom setup.
What are the risks of using NEON in a Laravel project?
Key risks include: breaking changes in minor NEON versions (e.g., PHP 8.0+ requirements), lack of Laravel-native failure modes (e.g., `config:cache` conflicts), and license ambiguity (NOASSERTION vs. MIT). Debugging NEON-specific errors (e.g., UTF-8 validation) in Laravel’s context is also non-trivial.
Are there better alternatives to NEON for Laravel’s config needs?
Yes. Laravel’s built-in YAML support or packages like `spatie/laravel-config-array` (for dynamic configs) are more aligned with Laravel’s architecture. If you need human-readable configs, consider extending Laravel’s YAML with custom syntax or using PHP arrays with comments.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata