
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?



Leave a Reply