Download the PHP package jobmetric/laravel-star without Composer

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

Contributors Forks Stargazers MIT License LinkedIn

Laravel Star

A modern, flexible, and test-covered Laravel package that allows your models to handle star rating functionality (e.g., 1 to 5 stars).
This package provides a clean API for both starable (e.g., articles, posts) and starrer (e.g., users, devices) models.


💾 Installation

Install via composer:

Then publish and run the migration:


✨ Usage

Step 1: Add HasStar to your starable model (e.g., Article)

Step 2: Add CanStar to your starrer model (e.g., User)


✅ Main Features

Add or Update a Star Rating

You can also pass extra options like device ID:

Remove a Star Rating

Check if a Star Exists

Get Star Count and Average

Get Summary

Get Latest Stars

Forget Stars (All for a user or device)


🎯 Conditional Methods

Rating Checks

Get Rated Value


📦 CanStar Feature Set

Check if a model has starred something

Get rate value

Remove star from a model

Count by Rate or Total

Summary of Ratings Given

Models that user has starred

Stars to specific model type

Latest Stars Given

🧱 Star Model Columns

Field Description
starable_type Polymorphic class of starable (e.g., Post)
starable_id ID of the starable model
starred_by_type Polymorphic class of starrer (e.g., User)
starred_by_id ID of the starrer
rate Star rating (e.g., 1 to 5)
ip IP address of the request
device_id Optional device identifier
source Source of the request (e.g., web, app, api)
created_at Timestamp when the star was created
updated_at Timestamp when the star was last updated

🧪 Events

Event Triggered When
StarAddEvent A new star is created and saved
StarRemovingEvent A star is about to be deleted
StarRemovedEvent A star has been successfully deleted
StarUpdatingEvent A star is about to be updated
StarUpdatedEvent A star has been successfully updated

Contributing

Thank you for considering contributing to the Laravel Star! The contribution guide can be found in the CONTRIBUTING.md.

License

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


All versions of laravel-star with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.1
laravel/framework Version >=9.19
jobmetric/laravel-package-core Version ^1.7
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 jobmetric/laravel-star contains the following files

Loading the files please wait ....