How to Install Laravel Livewire?

06 Apr, 2020

Hello

Today, I will show you how to install laravel livewire. Before that, if you are not familiar with Livewire, here is about what exactly the laravel livewire.

Livewire is a full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel.

Besides, you can check it out in the official site and feel free to share your thought to the official forum.

Let's get started.

What's required

How to Install.

To install livewire to Laravel project, you need to run the following command in the terminal.

composer require livewire/livewire

Once you install livewire successfully, then you need to include livewire to your file.

Setting Up

I assume that you have a fresh laravel project where you have installed livewire.

Now, go to resources/views/welcome.blade.php file and follow the instructions-

  • Add @livewireStyles inside your <head> tag
  • Add @livewireScripts directive before close your </body tag.

Done, easy enough, right?

Making your first component with Laravel Livewire

Hello. I’m Thouhedul Islam. Some people also know me as Suchi.

I am a Full-stack Developer. I love to play with PHP specially Laravel, JavaScript, MySql and latest web technology. Currently I am working for CartX as my day time job.

At night I love to solve problem for community. I am quite active at Laracasts