Download the PHP package coolsam/nested-comments without Composer

On this page you can find all versions of the php package coolsam/nested-comments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nested-comments

Filament Nested Comments & Emoji Reactions

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status GitHub PHPStan Action Status Total Downloads

This package allows you to incorporate comments and replies in your Filament forms, infolists, pages, widgets etc, or even simply in your livewire components. Comment replies can be nested as deep as you want, using the Nested Set data structure. Additionally, the package comes with a Reactions feature to enable your users to react to any of your models (e.g comments or posts) with selected emoji reactions.

image

Installation

You can install the package via composer:

Run the installation command and follow the prompts:

Adjust the configuration file as necessary, then run migrations.

`That's it! You are now ready to add nested comments

Usage: Comments

At the very basic level, this package is simply a Livewire Component that takes in a model record which is commentable. Follow the following steps to prepare your model to be commentable or reactable:

  1. Add the HasComments trait to your model

  2. If you would like to be able to react to your model directly as well, add the HasReactions trait to your model

  3. You can now access the comments and reactions of your model in the following ways

Using the Comments Infolist Entry

image

Using the Comments Widget inside a Resource Page (e.g EditRecord)

As long as the resource page interacts with the record, the CommentsWidget will resolve the record automatically.

image

Using the Comments Widget in a custom Filament Page (You have to pass $record manually)

Using the Comments Page Action in a Resource Page (which interacts with $record)

image

image

Using the Comments Page Action in a custom Filament Page (You have to pass $record manually)

In this case you will have to pass the record attribute manually.

Using the Comments Table Action

image

Using the Comments Blade Component ANYWHERE!

This unlocks incredible possibilities. It allows you to render your comments even in your own frontend blade page. All you have to do is simply pass the commentable $record to the blade component

Alternatively, you could use the Livewire component if you prefer.

Mentions

The package uses Filament TipTap Editor which supports mentions. You can mention users in your comments by typing @ followed by the user's name. The package will automatically resolve the user and send them a notification. You can customize how to fetch mentions by changing the .closures.getMentionsUsing closure in the config file. Two sample methods have been included in the main class for getting all users in the DB or only users that have been mentioned in the current thread (default). Customize this however you wish.

Get only users mentioned in the current thread:

Get all users from your database

image

Usage: Emoji Reactions

This package also allows you to add emoji reactions to your models. You can use the HasReactions trait to add reactions to any model. The reactions are stored in a separate table, and you can customize the reactions that are available via the configuration file. The Comments model that powers the comments feature described above already uses emoji reactions.

In order to start using reactions for your model, add the HasReactions trait to your model. You can then use the reactions method to get the reactions for the model.

The above trait adds the react() method to your model, allowing you to toggle a reaction for the model. You can also use the reactions method to get the reactions for the model.

You can also use the reactions method to get the reactions for the model.

Other useful methods include

To interact with the methods above with ease within and even outside Filament, this package comes with the following handy components:

Reactions Infolist Entry

image

Reactions Blade Component

Just include the blade component anywhere in your blade file and pass the model record to it.

In your view:

Reactions Livewire Component

Similar to the blade component, you can use the Livewire component anywhere in your Livewire component and pass the model record to it.

In your view:

The two components can be used anywhere, in resource pages, custom pages, actions, form fields, widgets, livewire components or just plain blade views. Here is a sample screenshot of how the components will be rendered: image

Package Customization

You can customize the package by changing most of the default values in the config file after publishing it.

Testing

Open Source Dependencies

This package uses the following awesome open source packages, among many others under the hood:

I am grateful for the work that has been put into these packages. They have made it possible to build this package in a short time.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of nested-comments with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
awcodes/filament-tiptap-editor Version ^3.5.12
filament/filament Version ^3.3
kalnoy/nestedset Version ^6.0.5
spatie/laravel-package-tools Version ^1.15.0
tangodev-it/filament-emoji-picker Version ^1.0.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package coolsam/nested-comments contains the following files

Loading the files please wait ....