To use the Livewire components provided by this package, you must first install Livewire itself. Make sure you follow their installation instructions.
After that, you should follow the installation instructions of the base spatie/laravel-comments package. After following these instructions, you should have migrated your database and prepared your model.
With that all done, you're ready to pull in the spatie/laravel-comments-livewire
package
composer require spatie/laravel-comments-livewire
##Using the assets
On each page where you want to use the components, you should include the styles and scripts provided by the package by using one of the following methods.
##Method 1: using the blade directives
You can include the styles in the head of your page.
<head>
@laravelCommentsLivewireStyles
</head>
You can include the scripts before the closing body tag.
<body>
@laravelCommentsLivewireScripts
</body>
##Method 2: Bundling the assets in your app
While method 1 is an easy way of getting started you might prefer to bundle the assets in your app.
In your app.css
file you can import the styles.
@import '../../vendor/spatie/laravel-comments-livewire/resources/dist/comments.css';
And in your app.js
you can do the same for the scripts.
import '../../vendor/spatie/laravel-comments-livewire/resources/dist/comments.js';
##Troubleshooting
If you want problems installing the package, take a look at our demo app and compare it against yours.