Weave 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

NEON is a human-friendly, YAML-like data serialization format used for Nette configuration files. This package provides a fast, strict parser and dumper for PHP, with support for comments, inheritance, entities and includes, plus detailed error reporting.

View on GitHub
Deep Wiki
Context7

nette/neon is a standalone PHP library for NEON (Nette Object Notation), a human-friendly data serialization format similar to YAML but simpler. It parses and dumps configuration files, making it ideal for Nette Framework configs and any PHP project that needs readable structured data.

  • Parser & Dumper for decoding and encoding NEON
  • Human-readable syntax with comments, indentation, and fewer quotes
  • Rich types including entities, dates, and special constants
  • Clear error messages with line numbers for invalid input
  • Zero dependencies — usable in any PHP project
Frequently asked questions about Neon
What is nette/neon and how does it work with Laravel?
nette/neon is a PHP package that encodes and decodes NEON (Nette Object Notation), a human-friendly configuration and data serialization format. It is a pure codec exposing Neon::decode(), Neon::decodeFile(), and Neon::encode(), plus an AST and traverser layer added in v3.3.0. Laravel does not natively read NEON, so any integration requires a custom adapter or bootstrap hook that converts NEON into PHP arrays before Laravel's configuration layer loads.
How do I install nette/neon with Composer?
Run composer require nette/neon in your Laravel project. The package has no Laravel service provider, facade, or config stub, so Composer installation does not register anything automatically. You call the Neon class directly or wrap it in your own service provider. Check the reported license metadata (NOASSERTION) with legal before production use.
Can I use NEON files instead of PHP config files in Laravel?
Not natively. Laravel's LoadConfiguration bootstrap expects config/*.php files that return arrays, and config:cache freezes those arrays into a single PHP file. You can add a parallel loader that globs config/*.neon, decodes each file with Neon::decodeFile(), and merges the results into the repository before LoadConfiguration runs. That is additive architecture, not a built-in fit, and you must define precedence between PHP config, NEON config, and env() overrides.
Does nette/neon work with Laravel config:cache?
Only if you handle it explicitly. Laravel's config:cache command writes cached PHP config and will silently ignore NEON files unless you override ConfigCacheCommand or pre-merge NEON values before the cache is written. Without that, cached and uncached environments can behave differently, which is the most common production failure mode for this integration. Document and test both paths.
How do I decode a NEON file in Laravel?
Use Neon::decodeFile($path) to read and decode a NEON file, or Neon::decode($string) for an in-memory string. Since v3.3.4 decodeFile is atomic, which matters when config is read concurrently during deploys. Wrap every decode in try/catch because parse failures happen during bootstrap before Laravel's exception handler and logger are reliably available.
What NEON syntax features does nette/neon support?
NEON supports comments, multiline strings, arrays, nested structures, and familiar human-friendly syntax designed for readable config files. Version 3.4.0 removed on/off syntax and raised the minimum PHP version to 8.0, so older NEON files may need updates. It is a configuration format, not a general-purpose interop format like JSON.
Which PHP and Laravel versions does nette/neon support?
nette/neon v3.4.x requires PHP 8.0 or newer after the v3.4.0 release. It is framework-agnostic and does not declare Laravel version constraints, so compatibility with Laravel depends on your PHP version and your adapter code. Test against your Laravel version, especially if you override bootstrap or config caching.
What are the risks of using nette/neon for Laravel configuration?
The main risks are architectural and operational. nette/neon is a pure codec with no Laravel hooks, so every integration is bespoke and must handle config:cache coherence, precedence rules, and type fidelity. Minor releases have included BC breaks such as dropping non-UTF-8 mode and rewriting the parser, and a config loader sits on the critical boot path, so a parse failure can affect application startup. The package license metadata reports NOASSERTION, so legal sign-off is a hard gate before production use.
How do I handle NEON parse errors during Laravel bootstrap?
Wrap every Neon::decodeFile() or Neon::decode() call in try/catch and degrade to a clear, non-fatal error rather than letting the exception escape during bootstrap. At that stage Laravel's exception handler and logger may not be fully wired, so a raw parse failure can produce an opaque outage. Log enough context to identify the offending file, and fail fast in local development while degrading safely in production.
What are alternatives to nette/neon for Laravel configuration?
Laravel's native PHP config arrays are the default and work with config:cache without adapters. JSON, YAML, and TOML have mature PHP parsers and broader interop, though each still needs a Laravel loader and cache strategy. If you specifically need to consume an existing NEON corpus from a Nette service or acquired codebase, nette/neon is the right codec; absent that forcing function, it is usually a solution seeking a problem.
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.
frankkessler/guzzle-oauth2-middleware
delatbabel/site-config
delatbabel/applog
eusonlito/laravel-gettext
henzeb/housepedia-intelligence-laravel
aliqsm/laravel-authkit
itsjustvita/laravel-wp-migrator
uslanozan/laravel-cache-contract
adilazhari/laravel-trace
ulsyairil/ai-local-guardrails
dzwallet/laravel-sdk
glc36/maxloop-kernel
ikhbarnuridev/filament-mega-menu
mydnic/volet-chatbot
enadstack/laravel-localization
mydnic/volet-feature-board-filament-plugin
wmde/email-address
refinery29/test-util
dees040/laravel-api-responses
teamzac/geocoder