Download the PHP package loclzbiz/comments without Composer

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

Comments

Comments is a Laravel package. With it you can easily implement native comments for your application.

Become a Patron

Overview

This package can be used to comment on any model you have in your application.

All comments are stored in a single table with a polymorphic relation for content and a polymorphic relation for the user who posted the comment.

Features

Screenshots

Here are a few screenshots.

No comments & guest:

No comments & logged in:

One comment:

One comment edit form:

Two comments from different users:

Tutorials & articles

I plan to expand this chapter with more tutorials and articles. If you write something about this package let me know, so that I can update this chapter.

Screencasts:

Installation

From the command line:

Run migrations

We need to create the table for comments.

Add Commenter trait to your User model

Add the Commenter trait to your User model so that you can retrieve the comments for a user:

Add Commentable trait to models

Add the Commentable trait to the model for which you want to enable comments for:

Publish Config & configure (optional)

Publish the config file (optional):

Publish views (customization)

The default UI is made for Bootstrap 4, but you can change it however you want.

Publish Migrations (customization)

You can publish migration to allow you to have more control over your table

Publish translations (customization)

The package currently only supports English, but I am open to PRs for other languages.

Usage

In the view where you want to display comments, place this code and modify it:

In the example above we are setting the commentable_type to the class of the book. We are also passing the commentable_id the id of the book so that we know to which book the comments relate to. Behind the scenes, the package detects the currently logged in user if any.

If you open the page containing the view where you have placed the above code, you should see a working comments form.

View only approved comments

To view only approved comments, use this code:

Paginate comments

Pagination paginates by top level comments only, meaning that if you specify the number of comments per page to be 1, and that one comment has 100 replies, it will display that one comment and all of its replies.

It was not possible to do it any other way, because if I paginate by all comments (parent and child) you will end up with blank pages since the comments components loops parent comments first and then uses recursion for replies.

To use pagination, use this code:

Replace 2 with any number you want.

Configure maximum indentation level

By default the replies go up to level three. After that they are "mashed" at that level.

You can configure the maximum indentation level like so:

Events

This package fires events to let you know when things happen.

REST API

To change the controller or the routes, see the config.

POST /comments

Request data:

PUT /comments/{comment}

Request data:

POST /comments/{comment}

Request data:

Upgrading from older versions (troubleshoot)

Before creating an issue, read this.

Sponsors & Backers

I would like to extend my thanks to the following sponsors & backers for funding my open-source journey. If you are interested in becoming a sponsor or backer, please visit the Backers page.

Contributing

Thank you for considering contributing to Comments! The contribution guide can be found Here.

Code of Conduct

In order to ensure that the open-source community is welcoming to all, please review and abide by the Code of Conduct.

License

Comments is open-source software licensed under the MIT license.


All versions of comments with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
erusev/parsedown Version ^1.7
illuminate/database Version ^8.0
illuminate/http Version ^8.0
illuminate/pagination Version ^8.0
illuminate/routing Version ^8.0
illuminate/queue Version ^8.0
illuminate/support Version ^8.0
spatie/laravel-honeypot Version ^3.0
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 loclzbiz/comments contains the following files

Loading the files please wait ....