Download the PHP package jonassiewertsen/statamic-livewire without Composer

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

Statamic 4.0+ Latest Version on Packagist

New Maintainer

Please switch to https://github.com/marcorieser/statamic-livewire instead. Switching is easy and there is no breaking change. Please check the Guide in the new repo.

Thanks for your support ❤️

Description

A third-party Laravel Livewire integration for Statamic.

It's as easy as it gets to get started with Livewire if using Statamic.

Installation

Pull in the Livewire package with composer

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 or Blade directives:

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 or Blade directive. Do not forget 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.

Upgrade

Make sure to read the Livewire upgrade guide, in case you're updating to Statamic Livewire 3, as there are breaking changes: https://livewire.laravel.com/docs/upgrading

General documentation

Livewire Docs

Include components

You can create Livewire components as described in the general documentation. To include your Livewire component:

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

@script and @assets

Antlers versions of @script and @assets are provided:

Blade or Antlers? Both!

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

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

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?

Passing Initial Parameters

You can pass data into a component by passing additional parameters

To intercept with those parameters, mount them and store the data as public properties.

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.

Multi-Site

When using Livewire in a Multi-Site context, the current site gets lost between requests. There is a trait (\Jonassiewertsen\Livewire\RestoreCurrentSite) to solve that. Just include it in your component and use Site::current() as you normally do.

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 similar. Make sure to use the Jonassiewertsen\Livewire\WithPagination namespace for your trait if working with Antlers.

In your Livewire component view:

EXPERIMENTAL: Statamic Support

As a little experiment, support for an Entry or EntryCollection has been added, so you can make an entry or a entry collection simply a public property and it just works.

Supported types:

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

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

Entangle: Sharing State Between Livewire And Alpine

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

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.

This: Accessing the Livewire component

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

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.

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.

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:

Requirements

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.1
illuminate/support Version ^10.0|^11.0
statamic/cms Version ^4.23.2|^5.0
livewire/livewire Version ^3.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 jonassiewertsen/statamic-livewire contains the following files

Loading the files please wait ....