Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

livewire/livewire v3.4.10

A front-end framework for Laravel.
Package summary
Share
0
issues
0
licenses
Package created
20 Sep 2019
Version published
2 Apr 2024
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does livewire/livewire do?

Livewire, a full-stack framework for Laravel, enables developers to construct dynamic UI components utilizing PHP solely, eliminating the need for JavaScript. It promotes a simpler and more streamlined workflow for designing interactive user interfaces by assembling components similar to Vue or React components using PHP views.

How do you use livewire/livewire?

To use Livewire in your Laravel project, start by installing it with Composer:

composer require livewire/livewire

Afterwards, you can create and use Livewire components. A simple counter component's creation might look like the following:

php artisan make:livewire counter

This command will generate two files:

  1. A class file for your component's PHP code, typically located at 'app/Http/Livewire/Counter.php'.
  2. A view file for your component's HTML markup, typically located at 'resources/views/livewire/counter.blade.php'.

Your 'counter.blade.php' file may look as follows:

<div>
    <span>{{ $count }}</span>
    <button wire:click="increment">Increment</button>
</div>

In 'Counter.php', you may have:

<?php

namespace App\Http\Livewire;

use Livewire\Component;

class Counter extends Component
{
    public $count = 0;

    public function increment()
    {
        $this->count++;
    }

    public function render()
    {
        return view('livewire.counter');
    }
}

Finally, to use your new Livewire component, add the following line to any of your Blade files:

@livewire('counter')

Where are the livewire/livewire docs?

The official documentation for Livewire can be found on the Livewire website. These comprehensive documents provide in-depth details about the usage and functionalities of Livewire. From getting started with your first Livewire component to more advanced topics like testing, the official docs serve as an important resource for maximizing the utility of Livewire in your Laravel projects.