Download the PHP package iurigustavo/craft-livewire-bridge without Composer

On this page you can find all versions of the php package iurigustavo/craft-livewire-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-livewire-bridge

Livewire Bridge for Craft CMS

Use Livewire 4 single-file components as Craft CMS 6 templates.

Beta: Craft CMS 6 is still in beta, so expect breaking changes until it's stable.

When Craft routes a request to a Blade template (an entry's URI, a section template, a custom route…) and that template is a Livewire single-file component, Livewire Bridge mounts it as a full-page Livewire component instead of rendering it as a plain view. Craft's template variables such as $entry are handed to the component, and Craft elements work as Livewire properties across requests.

Requirements

Installation

You can also install it from the Plugin Store in the control panel.

Usage

  1. In Settings → Sections, set the section's template to a Blade file, e.g. news/_entry.blade.php.
  2. Write that template as a Livewire single-file component:

That's it. Visiting the entry's URL renders the component inside the layout, and wire:click, wire:model, validation, wire:navigate, etc. work as usual.

Passing Craft variables

Craft variables are passed to the component only when the component asks for them, either as a public property with the same name or as a mount() argument:

Variables the component doesn't declare are ignored, so they don't leak into the HTML as attributes.

Layouts

The outermost component is wrapped in a layout, resolved the same way as Livewire's own page components:

  1. the #[Layout('...')] attribute,
  2. $view->layout('...') in render()/rendering(),
  3. config('livewire.component_layout') (default layouts::app).

The layout receives the component output in $slot, and $title when you use #[Title] or $view->title(). Livewire components rendered from inside another Craft template aren't wrapped in a layout.

Craft elements as properties

Any Craft element (entries, categories, assets, users…) can be a Livewire property. Only a reference (class, id, siteId) is stored in the snapshot, and the element is fetched again on every Livewire request, the same way Livewire handles Eloquent models.

Component names

Templates are registered under the craft:: Livewire namespace, which points to Craft's site templates folder. For example, resources/views/news/_entry.blade.php becomes craft::news._entry, so you can also embed it elsewhere:

Known limitations

License

MIT. See LICENSE.md.


All versions of craft-livewire-bridge with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
craftcms/cms Version ^6.0.0-beta.1
livewire/livewire Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iurigustavo/craft-livewire-bridge contains the following files

Loading the files please wait ...