faustbrian / Laravel Commentable
Licence: mpl-2.0
Stars: ✭ 141
Projects that are alternatives of or similar to Laravel Commentable
Laravel Comments
Add comments to your Laravel application
Stars: ✭ 234 (+65.96%)
Mutual labels: comments, laravel
Comments
Native comments for your Laravel application.
Stars: ✭ 390 (+176.6%)
Mutual labels: comments, laravel
Laravel Disqus
A simple Disqus platform integration with Laravel.
Stars: ✭ 71 (-49.65%)
Mutual labels: comments, laravel
Laravel Fractal
An easy to use Fractal wrapper built for Laravel and Lumen applications
Stars: ✭ 1,748 (+1139.72%)
Mutual labels: laravel
Maravel Permissions
Because in the Maravelous univer every user deserves super power
Stars: ✭ 139 (-1.42%)
Mutual labels: laravel
Laravel Azure Storage
Microsoft Azure Blob Storage integration for Laravel's Storage API
Stars: ✭ 139 (-1.42%)
Mutual labels: laravel
Laravel Db Profiler
Database Profiler for Laravel Web and Console Applications.
Stars: ✭ 141 (+0%)
Mutual labels: laravel
Laravel Api Explorer
API explorer for laravel applications
Stars: ✭ 138 (-2.13%)
Mutual labels: laravel
Artisan Menu
📝 Artisan Menu - Use Artisan via an elegant console GUI
Stars: ✭ 141 (+0%)
Mutual labels: laravel
Config
Manage Laravel configuration by persistent storage
Stars: ✭ 139 (-1.42%)
Mutual labels: laravel
Laravel Scout Postgres
PostgreSQL Full Text Search Engine for Laravel Scout
Stars: ✭ 140 (-0.71%)
Mutual labels: laravel
Strapi Plugin Comments
A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
Stars: ✭ 138 (-2.13%)
Mutual labels: comments
Employee Mgmt Laravel5.4 Adminlte
The project is using laravel 5.4 and adminlte
Stars: ✭ 141 (+0%)
Mutual labels: laravel
Steam
A composer package to make use of the steam web api.
Stars: ✭ 139 (-1.42%)
Mutual labels: laravel
Laravel Commentable
Installation
Require this package, with Composer, in the root directory of your project.
$ composer require artisanry/commentable
To get started, you'll need to publish the vendor assets and migrate:
php artisan vendor:publish --provider="Artisanry\Commentable\CommentableServiceProvider" && php artisan migrate
Usage
Setup a Model
<?php
namespace App;
use Artisanry\Commentable\Traits\HasComments;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use HasComments;
}
Create a comment
$user = User::first();
$post = Post::first();
$comment = $post->comment([
'title' => 'Some title',
'body' => 'Some body',
], $user);
dd($comment);
Create a comment as a child of another comment (e.g. an answer)
$user = User::first();
$post = Post::first();
$parent = $post->comments->first();
$comment = $post->comment([
'title' => 'Some title',
'body' => 'Some body',
], $user, $parent);
dd($comment);
Update a comment
$comment = $post->updateComment(1, [
'title' => 'new title',
'body' => 'new body',
]);
Delete a comment
$post->deleteComment(1);
Count comments an entity has
$post = Post::first();
dd($post->commentCount());
Testing
$ phpunit
Security
If you discover a security vulnerability within this package, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.
Credits
This project exists thanks to all the people who contribute.
License
Mozilla Public License Version 2.0 (MPL-2.0).
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].