Download the PHP package fbf/laravel-comments without Composer

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

A Laravel 4 package for adding commenting to a website that has user accounts

Features

Installation

Add the following to you composer.json file (Recommend swapping "dev-master" for the latest release)

"fbf/laravel-comments": "dev-master"

Run

composer update

Add the following to app/config/app.php

'Fbf\LaravelComments\LaravelCommentsServiceProvider'

Run the package migration

php artisan migrate --package=fbf/laravel-comments

Publish the config

php artisan config:publish fbf/laravel-comments

Add your namespaced models to the list of commentable models in the config/commentables.php config file (this is just for validation purposes)

Optionally tweak the settings in the other config files for your app.

Optionally copy the administrator config file (src/config/administrator/posts.php) to your administrator model config directory.

Configuration

See the configuration options in the files in the config directory

Administrator

You can use the excellent Laravel Administrator package by FrozenNode to administer your comments.

http://administrator.frozennode.com/docs/installation

A ready-to-use model config file for the Comment model (commentsphp) is provided in the src/config/administrator directory of the package, which you can copy into the app/config/administrator directory (or whatever you set as the model_config_path in the administrator config file).

Usage

Add the polymorphic / hasMany relationship to the models in your app that you want to be commentable:

Add the comments partial to the blade templates where you want the comments displayed, passing in the instance of the commentable model, and the comments.

The above is an example for adding comments to a Post model. If you want comments on something else, obviously change the mentions of the word 'Post' or '$post' to that of your model.

To use in conjunction with fbf/laravel-blog, (or the model in any other package for that matter), see the section in the readme about extending the Post model in your own app. I.e. you need to extend the Post model in your app/models directory and add the relationship in that file, rather than adding this to the model file in the vendor directory.

To note...

To make integration really easy, and to increase performance, there's a line in the list.blade.php view partial that lazy eager loads the user data for each comment. If you override this view partial, and you omit this line, when you try to show the username of the user who wrote each comment, you may cause a big performance hit on your database, as it makes a separate query for each comment's author:

Extending

The laravel-comments::comments partial used above actually includes 2 other partials, laravel-comments::list and laravel-comments::form. You can override any or all of these simply by copying them in your app/views/fbf/laravel/comments directory.

To override the Comment model in the package, create a model in you app/models directory that extends the package model.

Then, update the IoC Container to inject an instance of your model into the Fbf\LaravelComments\CommentsController, instead of the package's model, e.g. in app/start/global.php

You can choose not to use the package routes file and use your own, for routing through to your own controller to handle the creation of comments, which you may wish to extend from the package's controller or not.

Example to use webpurify to replace profanities in comments with asterisks on create


All versions of laravel-comments with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version 4.*
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 fbf/laravel-comments contains the following files

Loading the files please wait ....