Download the PHP package marcorieser/statamic-livewire without Composer

On this page you can find all versions of the php package marcorieser/statamic-livewire. 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 statamic-livewire

Statamic Livewire

A third-party Laravel Livewire integration for Statamic. It aims to make it as easy as possible to use Livewire in Statamic.

Table of Contents

Requirements

Installation

Install the addon via composer:

Upgrade

Below is a list with specific upgrade instructions.

Livewire documentation

In general, all Livewire specific information can be found in the official Livewire Docs.

Features

Blade or Antlers? Yes, please!

If creating a Livewire component, you need to render a template file

Normally your template file would be a blade file, named counter.blade.php. Great, but what about Antlers? Rename your template to counter.antlers.html, use Antlers syntax and do whatever you like. No need to change anything inside your component Controller. How cool is that?

More Information: (https://livewire.laravel.com/docs/components)

Include components

You can create Livewire components as described in the general documentation. To include your Livewire component in Antlers, you can use the livewire tag:

If you want to include a component from a dynamic variable, you can use the livewire:component tag:

Passing Initial Parameters

You can pass data into a component by passing additional parameters:

The Official Livewire documentation provides more information.

Keying Components

Livewire components are automatically keyed by default. If you want to manually key a component, you can use the key attribute.

The Official Livewire documentation provides more information.

Manually including Livewire's frontend assets

By default, Livewire injects the JavaScript and CSS assets it needs into each page that includes a Livewire component. If you want more control over this behavior, you can manually include the assets on a page using the following Antlers tags:

Manually bundling Livewire and Alpine

If you need to include some custom Alpine plugins, you need to manually bundle the Livewire and Alpine assets and disable the automatic injection by using the following Antlers tag. Remember to include the Livewire styles as well.

Static caching

This addon adds an AssetsReplacer class to make Livewire compatible with half and full static caching. You may customize the replacers in the config of this addon:

If you are using full measure static caching, and you're manually bundling Livewire and Alpine as per the instructions above, you need to make sure to only start Livewire once the CSRF token has been replaced.

@script and @assets

Antlers versions of @script and @assets are provided:

Computed Properties

When using Antlers, the computed properties are loaded automatically and only resolve when accessed. Simply access them as you would access a regular variable in the cascade. Read more about Computed Properties in the Livewire Docs.

Cascade

Normally all the variables in the Cascade are only available on initial render and get lost between Livewire requests. This means you'd need pass in the required ones into the component yourself. To make our lives a bit easier, you can add the #[Cascade] attribute to your component.
This is only needed for Antlers views and mirrors the logic of Blade's @cascade directive.

Now you can access the variables from the Cascade directly in your Antlers view, even on subsequent renders:

You can also limit which cascade keys are exposed (and provide defaults):

For subsequent requests, the addon restores the Cascade using the original Livewire URL, so site, request, and content data resolve as expected.

Multi-Site / Localization

By default, your current site is persisted between Livewire requests automatically.
In case you want to implement your own logic, you can disable localization in your published config/statamic-livewire.php config.

Lazy Components

Livewire allows you to lazy load components that would otherwise slow down the initial page load. For this you can simply pass lazy="true" as argument to your component tag.

Paginating Data

You can paginate results by using the WithPagination trait.

Blade

To use pagination with Blade, please use the Livewire\WithPagination namespace for your trait as described in the Livewire docs.

Antlers

Pagination with Antlers does work similarly. Make sure to use the MarcoRieser\Livewire\WithPagination namespace for your trait if working with Antlers.

In your Livewire component view:

Synthesizers

You can use the built-in Synthesizers to make your Livewire components aware of Statamic specific data types.

Currently, the following types are supported:

To make it work, you need to enable that feature first.

  1. Run php artisan vendor:publish
  2. Select statamic-livewire in the list
  3. Enable synthesizers

Augmentation

By default, the Synthesizers augment the data before it gets passed into the antlers view. You can disable this by setting synthesizers.augmentation to false in your published config/statamic-livewire.php config.

Entangle: Sharing State Between Livewire And Alpine

It's worth mentioning that, since Livewire v3 now builds on top of Alpine, the @entangle directive is not documented anymore. Instead, it's possible to entangle the data via the $wire object.

In case you want to share state between Livewire and Alpine, there is a Blade directive called @entangle. To be usable with Antlers, the addon provides a dedicated tag:

This: Accessing the Livewire component

It's worth mentioning that, since Livewire v3 now builds on top of Alpine, the @this directive is not used widely anymore. Instead, it's possible to access and manipulate the state directly via JavaScript / the $wire object.

You can access and perform actions on the Livewire component like this:

Other Statamic Livewire Packages

If using Livewire, those packages might be interesting for you as well:

Did I miss a link? Let me know!

Credits

Thanks to:

Support

I love to share with the community. Nevertheless, it does take a lot of work, time and effort.

Sponsor me on GitHub to support my work and the support for this addon.

License

This plugin is published under the MIT license. Feel free to use it and remember to spread love.


All versions of statamic-livewire with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.0 || ^12.0 || ^13.0
statamic/cms Version ^5.73.0 || ^6.0
livewire/livewire Version ^3.6.4 || ^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 marcorieser/statamic-livewire contains the following files

Loading the files please wait ...