Download the PHP package daydevelops/vote without Composer

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

Laravel 7 Vote Package

Build Status Total Downloads License

This package gives your laravel project the ability to create and manage an upvote/downvote system for user created content. This project was inspired by Reddit karma.

Main Features in this Package

This package will provide you with 2 table migrations which will create a votes table (dd_votes) and a voter table (dd_voters).

You will also be given access to two traits:

Votable -> Adds upvoting and downvoting functionality to a votable object such as a blog post, comment, photos, or anything else with a user_id representing an owner.

CanVote -> To be applied to your User model. Adds additional functionality to your user which lets them manage their ability to vote and provides a votable score (calculated from votes others have casted on their votable objects).

You can also access the two models Vote and Voter.

A config file vote.php will be published to your config directory.

Installation

Via Composer

Usage

Apply the Votable Trait

Suppose we have a blog and users can create comments. If we want to allow users to upvote and downvote comments, we simply add the Votable trait.

Apply the CanVote Trait

The CanVote trait should be applied to your User model.

Available Methods/Properties on the Votable Object

Authenticated User Casts a Vote

Authenticated User Casts an Upvote

Authenticated User Casts a Downvote

Authenticated User Removes a Vote

Has the Authenticated User Voted on this Object?

Has the Authenticated User Upvoted this Object?

Has the Authenticated User Downvoted this Object?

Get a Collection of all the Votes on this Object

Get the Total Score of all Votes Casted on this Object

Available Methods/Properties on the CanVote (User) Object

Does this User have a Voter Record?

Get the Voter Object for this User

Make a Voter Record for this user

Get the Users Score Calculated from Votes Casted by other Users

Available Methods/Properties on the Voter Model

where $voter = $user->voter;:

Change the Weight of the Voters FUTURE Votes

Can the Voter Vote on an Object?

Is the Voter Banned from Voting?

Ban or Unban the Voter

Events

Daydevelops\Vote\Events\ItemUpVoted -> Fired when a votable object is upvoted

Daydevelops\Vote\Events\ItemDownVoted -> Fired when a votable object is udownvoted

Daydevelops\Vote\Events\VoterWeightChanged -> Fired when a voters vote weight is updated

Tests

For further clarification on any of the features of this package, take a look at the tests or reach out to the maintainer of the package.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.


All versions of vote with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~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 daydevelops/vote contains the following files

Loading the files please wait ....