Download the PHP package mtvs/laravel-reviews without Composer

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

Build Status

Laravel Reviews

Ratings and reviews for the Laravel's Eloquent models

laravel-reviews

Users will be able to rate and review the reviewable models. Then these reviews can be approved and be shown.

You will be able to load the ratings average and count on a reviewable model and display them.

It will provide the ability to sort the reviewables based on their ratings average using the Bayesian formula.

Installation And Setup

Then publish the files that are supposed to be in your codebase in order to be customizable by you. They're the review model, its database migration, its database factory, the HTTP controller and the config file.

Next in your routes file, call the following macro on the router to register the default routes. You can use artisan route:list to see the routes.

Then, if you want to use the UI components, run the following command to install them. The components are written using Vue and Bootstrap.

The command also installs a stylesheet and a pack of font icons in the public directory to be used by the components. Don't forget to include the stylesheet in your views layout file.

If you haven't enabled the auto registration in the app.js file, you need to register the components manually.

`

Now let's setup the models. There are some traits that are meant to be imported in the review model, the user model and also the model(s) that are going to be reviewed. The review model's trait has already been imported in it when it was installed. But the other traits need to be installed manually.

You also have to specify the reviewable models in the reviews config file.

Finally, remember to run the database migrations and compile the view components. You can also use the provided factory to seed the reviews.

Usage

The Ratings Component

To display the average and the count of a reviewable model's ratings, you can call <x-ratings>.

Do not forget to load those values on the model by calling loadRatings() on it or eager load them when making the query by calling withRatings().

The Reviews Component

To display the list of the reviews of a reviewable model and also the form to post them, you can call <x-reviews>.

It also contains a call to the <x-ratings>.

You can link the ratings component that you possibly use in the upper part of the page to the reviews component by wrapping the ratings in an <a href="reviews"> referring the reviews component.

Ranking Based on The Ratings

Reviewable models can be sorted based on their ratings when they're queried. To do so call the highestRated() on the query. It uses the Bayesian average formula to calculate the score of each model and sort them from the highest to the lowest score.

The Approval of Reviews

The review model uses Approvable trait from mtvs/eloquent-approval to enable to manage which reviews are allowed to be displayed.


All versions of laravel-reviews with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^9.0
mtvs/eloquent-approval Version ^5.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 mtvs/laravel-reviews contains the following files

Loading the files please wait ....