Download the PHP package larastash/reviews without Composer

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

💬⭐ Laravel Reviews

The Larastash Reviews package is a powerful Laravel package that enables you to add review functionalities to your Eloquent models.

With this package, you can easily manage reviews for various reviewable entities and perform various review-related operations.

Requirements

Installation

To install the Larastash Reviews package, you can use Composer:

After installing the package, publish migration and config files:

Note You can edit migration and set foreignUuid if your user model uses a UUID.

Prepare Models

To use the Larastash Reviews package, you need to apply the Reviewable trait to the Eloquent model that you want to make reviewable.

Additionally, you can apply the Reviewer trait to the User model.

Usage

The following examples demonstrate the usage of the Laravel package for managing reviews.

Creates or updates a review for the $product entity with the provided values. The parameters $value, $body, $title, $extra, and $userId are used to set the properties of the review.

Publish Reviews

To create a new review (uses updateOrCreate under the hood), use the publish method.

With Extra Data

You can pass additional data to the review, such as approved, anonymous review, recommended, etc.

Note You can also work with this data, for example, choose an average extra value or get only approved reviews.

Another User (Reviewer)

Publish review as another user.

Note By default, the overview is owned by the current authorized user (by Auth::id()).

Update Review

Sometimes, when we have some extra data, for example, we need to change only approved, then we can use the update method.

It will change the value approved to true, and will not affect other extra data, such as recommended.

Of course, you can use the publish method to update the review. But then you will need to pass the full current extra data, not just the approved = true.

User Has Review

Check if the user has a review or not.

Delete Review

Deletes the user's review.

Total Number of Reviews

Get the total number of reviews for a entry.

Avg Value and Extras

Get the average value of a review.

Get the average extra value of a review.

Reviewable Query Builder

Get the review query builder instance.

Eager Loading

Related Reviewable Methods

Get User Reviews

This will be available if you add the Larastash\Reviews\Concerns\Reviewer trait to the User model.

Helpers

review()

This function, review, is a helper function provided by the Laravel package.

It creates a new Larastash\Reviews\Review instance for the given reviewable entity (a model that uses the Reviewable trait). This function is particularly useful when you want to interact with the review-related methods of the Review class for a specific model instance. It saves you from manually creating a new Review instance each time you want to perform actions related to reviews for a specific entity.

Testing

Contributing

If you find any issues or have suggestions for improvement, please feel free to contribute by creating a pull request or submitting an issue.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of reviews with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/database Version ^10.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 larastash/reviews contains the following files

Loading the files please wait ....