Difference between revisions of "Extensions:Comments"
Tag: 2017 source edit |
m (Added updating to v2 link) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{Extensioninfobox|title= | + | {{Extensioninfobox|title=Comments|desc=Adds comments and a sales area to lorekeeper.|auth=Ne-wt, Preimpression|status=stable|github={{Github|user=ne-wt|branch=comments-addon}}|migration=yes|package=no|modified-main=yes}} |
+ | |||
+ | Add comments to your sites! Comments will notify users when commented on and replied to. | ||
+ | |||
+ | Mentions are not yet developed, unfortunately. | ||
+ | |||
== Thanks == | == Thanks == | ||
Special thank you to Uri (Preimpression) who not only helped make this project possible, but significantly reduced its development time. Please consider donating to their ko-fi! | Special thank you to Uri (Preimpression) who not only helped make this project possible, but significantly reduced its development time. Please consider donating to their ko-fi! | ||
https://ko-fi.com/preimpression | https://ko-fi.com/preimpression | ||
− | |||
− | |||
− | |||
− | + | Also thanks to Laravelista for providing the original package. | |
− | |||
− | ''' | + | == Installation == |
− | + | '''<u>As of October 8, 2020, the Comments extension has been separated from the original package.</u>''' | |
− | + | ''As always, we highly recommend installing locally and testing on a local testing server (via XAMPP or something similar) to ensure everything is working.'' | |
− | |||
− | |||
− | |||
− | |||
+ | # Pull the branch (comments-addon) and merge. Make sure to check your conflicts manually - don't rely on Sourcetree to handle the merge! | ||
+ | # Run the command: <code>composer update</code> so that your server will ensure it has some of the minor packages (such as Honeypot by Spatie, which is spam-prevention package). | ||
+ | #* You may need to include composer.lock in this push if you are on a limited hosting plan and composer complains about memory. | ||
+ | # Run the command: <code>php artisan migrate</code> so that Laravel will update the database accordingly. | ||
+ | # If you had the package prior to the October 8 update, run <code>php artisan view:clear</code> to clear your view caches. | ||
I recommend playing with comments before repeating the process for your production site. This will allow you to catch any errors before it can affect your site. Please let me know if you happen to find any. | I recommend playing with comments before repeating the process for your production site. This will allow you to catch any errors before it can affect your site. Please let me know if you happen to find any. | ||
+ | If you encounter any errors please let me know! | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Configuration == | == Configuration == | ||
Comments come with the following extensions installed: | Comments come with the following extensions installed: | ||
Line 41: | Line 32: | ||
If you do not wish to use these please consider removing before pushing to your site. | If you do not wish to use these please consider removing before pushing to your site. | ||
− | |||
== Usage == | == Usage == | ||
To add comments to a new ''page'', add the following: | To add comments to a new ''page'', add the following: | ||
− | *Add <code>use | + | * Add <code>use App\Traits\Commentable;</code> to the top of your model |
− | *Add <code>use Commentable;</code> within the curly brackets (e.g Controller extends Controller <code>{ use Commentable;)</code> | + | * Add <code>use Commentable;</code> within the curly brackets (e.g Controller extends Controller <code>{ use Commentable;)</code> |
− | *Add <code>@comments([ 'model' => $modelvariable,' | + | * Add <code>@comments([ 'model' => $modelvariable, 'perPage' => 5 ])</code> to your view |
+ | * You will also need to update your Notifications inside CommentController to handle whatever new system you're adding comments to. | ||
+ | |||
== Troubleshooting == | == Troubleshooting == | ||
If you need support please @ me in the lorekeeper discord, Newt#7776. | If you need support please @ me in the lorekeeper discord, Newt#7776. | ||
Please note I heavily advise testing on local before pushing to production. | Please note I heavily advise testing on local before pushing to production. | ||
+ | |||
== See Also == | == See Also == | ||
− | + | If you have errors, try [https://www.tutsmake.com/laravel-clear-cache-using-artisan-command-cli/ clearing your laravel caches] before anything! | |
+ | * [[Updating:_to_2.0.0]] |
Latest revision as of 09:09, 25 March 2024
Description | Adds comments and a sales area to lorekeeper. |
---|---|
Author(s) | Ne-wt, Preimpression |
Status | stable |
Github | comments-addon |
LK Version | Unspecified |
Contains a Migration | |
Is part of LK v2 (modified-main) | |
Add comments to your sites! Comments will notify users when commented on and replied to.
Mentions are not yet developed, unfortunately.
Thanks
Special thank you to Uri (Preimpression) who not only helped make this project possible, but significantly reduced its development time. Please consider donating to their ko-fi!
https://ko-fi.com/preimpression
Also thanks to Laravelista for providing the original package.
Installation
As of October 8, 2020, the Comments extension has been separated from the original package. As always, we highly recommend installing locally and testing on a local testing server (via XAMPP or something similar) to ensure everything is working.
- Pull the branch (comments-addon) and merge. Make sure to check your conflicts manually - don't rely on Sourcetree to handle the merge!
- Run the command:
composer update
so that your server will ensure it has some of the minor packages (such as Honeypot by Spatie, which is spam-prevention package).- You may need to include composer.lock in this push if you are on a limited hosting plan and composer complains about memory.
- Run the command:
php artisan migrate
so that Laravel will update the database accordingly. - If you had the package prior to the October 8 update, run
php artisan view:clear
to clear your view caches.
I recommend playing with comments before repeating the process for your production site. This will allow you to catch any errors before it can affect your site. Please let me know if you happen to find any. If you encounter any errors please let me know!
Configuration
Comments come with the following extensions installed:
- User Avatars
- Sales Page Addon
- User Ranks Icon Addon
If you do not wish to use these please consider removing before pushing to your site.
Usage
To add comments to a new page, add the following:
- Add
use App\Traits\Commentable;
to the top of your model - Add
use Commentable;
within the curly brackets (e.g Controller extends Controller{ use Commentable;)
- Add
@comments([ 'model' => $modelvariable, 'perPage' => 5 ])
to your view - You will also need to update your Notifications inside CommentController to handle whatever new system you're adding comments to.
Troubleshooting
If you need support please @ me in the lorekeeper discord, Newt#7776. Please note I heavily advise testing on local before pushing to production.
See Also
If you have errors, try clearing your laravel caches before anything!