This guide assumes that you already know how to install and configure Laravel.
In your app
directory, create a comments
folder and extract all the files from the archive you have downloaded from CodeCanyon.
Edit your composer.json
file and add the following line to the psr-4
autoload:
"Hazzard\\Comments\\": "app/comments/src/"
And this one to your dependencies (require
):
"s9e/text-formatter": "^0.4"
In your terminal/console run composer install
.
Add Hazzard\Comments\CommentsServiceProvider::class
to your providers
array in config/app.php
and run:
php artisan vendor:publish --provider="Hazzard\Comments\CommentsServiceProvider"
This command will publish the configuration file (config/comments.php), the assets folder (public/vendor/comments) and the database migrations *.
Notice: The script assumes that you have already have the users table installed.
Finally, run:
php artisan migrate
* The migrations will add 3 tables comments
, comment_votes
, comment_options
and a role
field to your users table. This field will be used to determine if the the authenticated user is an admin or a regular user.
Notice: If your app already has another method to determine that, then delete the
..._add_users_role_column.php
migration from the database/migrations directory.
You can clone the demo version from the GitHub repository. Run:
git clone https://github.com/hazzardweb/ajax-comment-system-laravel-demo.git
Now you can continue with the normal installation. This demo requires you to have reCAPTCHA configured.
Laravel Comments requires Laravel >= 5.1.9 and supports the following browsers (desktop and mobile): Chrome, Firefox, Opera, Safari MS Edge and IE9+.