Download the PHP package byrcsc/laravel-comments without Composer

On this page you can find all versions of the php package byrcsc/laravel-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 laravel-comments

Laravel Comments

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

Threaded comments for any Eloquent model.

Your posts need comments? A sale needs a remark? A ticket needs an internal note? Add one trait to the model and it has them: threaded, moderated, and ready for reactions, edit history, and attachments when you need those too.

The table is polymorphic, so posts, orders, tickets, and invoices all share it.

The package handles storing and moving comments. Your application keeps its UI, its rendering, its users, and its moderation rules.

Laravel Tested PHP versions
12.x 8.3, 8.4
13.x 8.3, 8.4

Installation

Install the package and publish its migrations:

Publish the configuration before the migration when you need custom table names or non-integer actor identities:

Set COMMENTS_ACTOR_KEY_TYPE to uuid, ulid, or string as needed. It covers commentator and reactor identities. The commentable model key is independent; adjust commentable_id in the published migration when those models do not use integer keys.

Notification wording and its mail views publish separately, and only when you want to change them:

What the package stores

A comment belongs to one already-persisted commentable record and is written by a commentator: any Eloquent model, or a guest identified only by a name and an email address. Comments form threads through replies, carry a moderation status, and accumulate reactions, revisions, and attachments.

The package controls comment state and history. It does not control what your application shows:

Quick start

Add HasComments to the model that receives comments:

Write a comment, reply to it, react to it:

Guest comments carry a name and an email instead of a model, and start out pending by default:

Read a thread the way you would read any relation:

That is the whole loop. Threading depth, moderation hooks, reactions, revisions, attachments, pinning, counts, notifications, and the rest are in the documentation.

What is included

Important behavior

Out of scope

The package draws its edges deliberately. What follows describes what it sets out to do rather than what it might do later: treat none of it as planned work, and none of it as ruled out forever.

Documentation

Development

The local checks mirror CI:

PHPStan runs at max with no baseline. Tests use SQLite locally and run against MySQL and PostgreSQL in CI. tests/Release/ pins the public surface, the documented guarantees, and the quick start above, run against the workbench's own models. A failure there is asking whether you meant to change the API. See CONTRIBUTING.md.

workbench/ is a bootable demo application that installs the package the way a real application would, and exercises every integration seam: guest comments, moderation hooks, threading depth, reactions, revisions, attachments and the image pipeline, counts, pinning, the reply notification, and a policy above this package's. composer build sets it up; see workbench/README.md for the demo loop.

Versioning

The package follows semantic versioning.

Bug fixes go into the newest version only. To get a fix, upgrade to it.

Questions and issues

This package is maintained by one person, so replies can take a while. Everything gets read.

Credits

License

MIT. See CHANGELOG.md.


All versions of laravel-comments with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^12.0||^13.0
illuminate/database Version ^12.0||^13.0
illuminate/events Version ^12.0||^13.0
illuminate/support Version ^12.0||^13.0
spatie/laravel-package-tools Version ^1.16
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 byrcsc/laravel-comments contains the following files

Loading the files please wait ...