Download the PHP package bishalgurung/laravel-comment without Composer

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

Installation

Installing the package

Exporting the migration files:

Migrating the tables

Seeding default reactions:

You can add more reactions by changing the "reactions" array in the comment.php config file and running comment:install again

Exporting the config file (optional):

The follwing will publish the config file below

Associate comments with Eloquent models

This package allows your models the ability to have comments associated to it.

Here's a small example of how to add comment to your model.

Lets say you have a Post model. In order to make it commentable, you just attach the HasComment trait to it

Now to add a comment, just use:

By default, the logged in user will be set as the user_type and userid in the comments_ table. But you can change that by using:

If you want to retrieve all the comments of a post, use:

Attach reaction to an Eloquent model

You can also attach reaction to any model. For that, just use:

Now to add a reaction to a model, just use:

Now to retrieve the reaction counts along with the Post model, we use:

This will return reaction count attached to Post collection as below:

Attach reply to a comment

If you take a look at the comment model in the vendor/bishalgurung/laravel-comment/src/Models/Comment.php file, you will notice that the Comment model also uses the HasComment trait. Which means that you can comment on a comment model. So a comment on a comment model is a reply, and this is how you use the reply system.

And to get replies, just use:

Upcoming feature


All versions of laravel-comment with dependencies

PHP Build Version
Package Version
No informations.
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 bishalgurung/laravel-comment contains the following files

Loading the files please wait ....