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
Component Model

Component Model Laravel Package

nette/component-model

nette/component-model provides foundational classes for hierarchical component trees in Nette apps. It handles named parent-child relationships, lifecycle events, component lookup, and recursive iteration, enabling reusable, loosely coupled UI and application components.

View on GitHub
Deep Wiki
Context7

⚛ Component model foundation for Nette.

Frequently asked questions about Component Model
Is nette/component-model a Laravel package?
No. nette/component-model is a framework-independent Nette primitive, not a Laravel package: it ships no service provider, facade, Blade directive, or Laravel adapter. You can install it in a Laravel app, but Laravel will not auto-wire it or treat Nette components as view components.
How do I install nette/component-model in a Laravel application?
Run composer require nette/component-model; Composer will pull the small nette/utils dependency. There is no Laravel package discovery, so if you want a shared tree you must bind Nette Container as a singleton in a service provider yourself. Treat that as a one-week spike, not a drop-in integration.
What PHP and Laravel versions does nette/component-model support?
The package requires PHP 8.1 or newer; it does not declare or test a Laravel version because it is not a Laravel package. It can run alongside modern Laravel on PHP 8.1+, but the compatibility burden is on your app. Verify it in a branch before adding it to a production dependency graph.
How is nette/component-model different from Blade or Livewire components?
Blade components are view-layer units resolved by Laravel, Livewire components add reactive state and hydration, and the Nette component model is a plain PHP object graph with named parent-child links. It handles attach/detach lifecycle callbacks, component lookup, and recursive iteration, but it does not render templates or handle requests. The overlap is conceptual, not API-level, so it cannot replace Blade or Livewire.
How do I use Nette Container and Component inside a Laravel service provider?
Bind Nette Container as a singleton and scope it to one bounded context, such as a form-section tree or widget grid. Subclass Nette\ComponentModel\Component for objects that need ordered attach/detach notifications, and bridge monitor() callbacks into Laravel's dispatcher only when cross-cutting listeners are required. Keep the tree unreachable from controllers and jobs to avoid two competing lookup mechanisms during incident response.
Are the magic properties $name, $parent, and $components deprecated in nette/component-model?
Version 3.2.0 deprecates the magic properties $name, $parent, and $components in favor of getters, along with monitor($type) without callbacks, subclassing attached()/detached(), and the old NAME_SEPARATOR constant. v4.0 will remove all of it. New code written against the convenient legacy API is scheduled for rewrite, so code against the getters and current signatures now.
How does monitor() attach and detach work, and can it trigger Laravel events?
monitor() registers callbacks that fire on attach and detach lifecycle events, and 3.1.4 added reentry protection plus closure deduplication to harden that machinery. If Laravel listeners need to react, dispatch a Laravel event from inside a monitor callback rather than expecting Nette to know about Illuminate\Contracts\Events\Dispatcher. Keep that bridge narrow and documented.
Can I use nette/component-model to render UI instead of Blade or Livewire?
No. There is no template bridge, request/response integration, or Livewire hydration story, so Nette components cannot become the primary rendering unit in a Laravel app without unreasonable custom work. Use it only as a self-contained sub-tree or diagnostic object graph alongside Laravel's own container and view layer. If the motivation is nested UI components, Blade or Livewire is the native answer.
What is the license of nette/component-model and can I use it commercially?
GitHub reports NOASSERTION; Nette projects are typically triple-licensed BSD-3-Clause, GPL-2.0, and GPL-3.0, but that must be confirmed for this repository. A TPM should route it through legal before the first PR, not after. Do not assume commercial-friendly terms until the license review is done.
Is nette/component-model maintained, and what alternatives should a Laravel team consider?
It is maintained, with positive signals such as 3.1.4's lifecycle hardening and adoption of mandatory nette/phpstan-rules, but it is a single-vendor ecosystem with a small maintainer pool and no Laravel-side community. Alternatives for Laravel teams are the Illuminate container, Blade or Livewire for UI composition, or a plain PHP tree built on SplObjectStorage. Ask whether the sidecar graph fixes a concrete failing behavior before taking on ownership.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core