feat: initial release of relaticle/comments
Filament comments package with: - Polymorphic commenting on any Eloquent model - Threaded replies with configurable depth - @mentions with autocomplete and user search - Emoji reactions with toggle and who-reacted tooltips - File attachments via Livewire uploads - Reply and mention notifications via Filament notification system - Thread subscriptions for notification control - Real-time broadcasting (opt-in Echo) with polling fallback - Dark mode support - CommentsAction, CommentsTableAction, CommentsEntry for Filament integration - 204 tests, 421 assertions
This commit is contained in:
0
tests/Models/.gitkeep
Normal file
0
tests/Models/.gitkeep
Normal file
24
tests/Models/Post.php
Normal file
24
tests/Models/Post.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Relaticle\Comments\Tests\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Relaticle\Comments\Concerns\HasComments;
|
||||
use Relaticle\Comments\Contracts\Commentable;
|
||||
use Relaticle\Comments\Tests\Database\Factories\PostFactory;
|
||||
|
||||
class Post extends Model implements Commentable
|
||||
{
|
||||
use HasComments;
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'posts';
|
||||
|
||||
protected $fillable = ['title'];
|
||||
|
||||
protected static function newFactory(): PostFactory
|
||||
{
|
||||
return PostFactory::new();
|
||||
}
|
||||
}
|
||||
26
tests/Models/User.php
Normal file
26
tests/Models/User.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Relaticle\Comments\Tests\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Relaticle\Comments\Concerns\IsCommenter;
|
||||
use Relaticle\Comments\Contracts\Commenter;
|
||||
use Relaticle\Comments\Tests\Database\Factories\UserFactory;
|
||||
|
||||
class User extends Authenticatable implements Commenter
|
||||
{
|
||||
use HasFactory;
|
||||
use IsCommenter;
|
||||
use Notifiable;
|
||||
|
||||
protected $table = 'users';
|
||||
|
||||
protected $fillable = ['name', 'email', 'password'];
|
||||
|
||||
protected static function newFactory(): UserFactory
|
||||
{
|
||||
return UserFactory::new();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user