Press ESC to close

Manoj Bist

Install Livewire – Laravel

How to install Livewire in laravel 8

Hi mates,

Today we will be learning, how to install livewire in laravel 8. For this article, i am assuming you already have installed latest laravel. So lets first understand the requirements.

Requirements

      PHP 7.2.5 or higher
      Laravel 7.0 or higher

Above are the main requirments for running livewire but Visit the composer.json file on Github for the complete list of package requirements.

Installation

	composer require livewire/livewire

Include Assets

Add the following Blade directives in the head tag, and before the end body tag in your template.

	
    	<html>
          <head>
              // add this line to include livewire css
              @livewireStyles
          </head>
          <body>
              //add this line to include livewire script.
              @livewireScripts
          </body>
          </html>
    

You can also use html tag syntax for including assets, like this

  
  	//for css
  	<livewire:styles />
    
    //for scripts
	<livewire:scripts />
  

Its done, you can now use livewire into your project to build something awsome. but additionally if you wanna tweak some livewire configs, here is how you can do that

Publishing Livewire config

	php artisan livewire:publish --config

Yeah, we just published a livewire config file to confg/livewire.php, you can simply open the file with you favorite code editor to make change in livewire config.

Hope this helped you. ohh you wanna help me too? click on the page, know where?

Manoj Bist

A Passionate Web Developer/Designer With over 6 years of experience in the industry, Manoj Bist is a seasoned professional who combines technical expertise with a down-to-earth demeanor. As a lover of both technology and design, he thrives on creating seamless digital experiences that captivate and inspire.

Leave a Reply

Your email address will not be published. Required fields are marked *