Download the PHP package matthewbdaly/laravel-comments without Composer

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

Build Status Coverage Status

Simple comments system, loosely inspired by Django's comments system. Allows comments to be attached to an object, and allows for them to be flagged by users for moderator attention.

Installation

You will also need to run php artisan migrate to set up the required database tables.

Usage

To allow comments to be attached to an object, add the trait Matthewbdaly\LaravelComments\Eloquent\Traits\Commentable to it. The object will then have a comments polymorphic relation.

Views

The package includes a view for submitting comments, named comments::comments, which can be included in another view as follows:

The value of parent must be an instance of the commentable object (eg, a blog post). The view also includes a form for flagging comments.

Obviously, if you prefer you can override this view with your own content.

The package also includes the following views:

These simply acknowledge receipt of the comment or flag, but are fairly basic and so you should feel free to replace them as you see fit.

Of course there's nothing stopping you creating your own routes and controllers for creating, viewing and flagging comments, and if you wish to build a REST API that allows for adding comments to objects you can just use these models directly:

I recommend that you use my repositories, which are as follows:

These use matthewbdaly/laravel-repositories and so implement caching on the decorated repository, making it simple to ensure your models get cached appropriately.

Events

You can set up listeners for the following events:

Fired before the comment is saved. The package does not validate comments out of the box, but you can use this to validate the comment using whatever method you wish (eg check it with Akismet, check for links), or process it before saving (eg run it through a Markdown parser).

Fired when a new comment is submitted. This is useful for creating some sort of notification, such as an SMS, email, push notification etc.

Fired before a comment flag is saved. Useful for processing the flag to amend it before saving it.

This event fires after a comment has been flagged for moderator attention. You can use this event to send whatever notification is most appropriate (eg, email, Slack, SMS).


All versions of laravel-comments with dependencies

PHP Build Version
Package Version
Requires matthewbdaly/laravel-repositories Version ^1.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 matthewbdaly/laravel-comments contains the following files

Loading the files please wait ....