Download the PHP package jobmetric/laravel-like without Composer

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

Contributors Forks Stargazers MIT License LinkedIn

Like for laravel

This is a like management package for Laravel that you can use in your projects.

Install via composer

Run the following command to pull in the latest version:

Documentation

This package evolves every day under constant development and integrates a diverse set of features. It is a must-have asset for Laravel enthusiasts and provides a seamless way to coordinate your projects with like and dislike base models.

In this package, you can use it seamlessly with any model that requires likes and dislikes.

Now let's move on to the main function.

Before doing anything, you must migrate after installing the package by composer.

Meet the HasLike class, meticulously designed for integration into your model. This class automates essential tasks, ensuring a streamlined process for:

In the first step, you need to connect this class to your main model.

How is it used?

You can now use the HasLike class for your model. The following example shows how to create a new post with a like:

The likeIt function is used to like the post. The first parameter is the user id, and the second parameter is the type of like. If you want to dislike, you can set it to false.

Now we go to the functions that we have added to our model.

likeOne

like has one relationship

likes

like has many relationships

likeTo

scope locale for select like relationship

dislikeTo

scope locale for select disLike relationship

likesTo

scope locale for select likes relationship

dislikesTo

scope locale for select disLikes relationship

likeIt

This function is very important and is used to store user's likes and dislikes.

The likeIt function is used to like the post. The first parameter is the user id, and the second parameter is the type of like. If you want to dislike, you can set it to false. user_id: user id type: like or dislike

likeCount

get count of likes

dislikeCount

get count of dislikes

loadLikeDislikeCount

This function helps to see the number of likes and dislikes of each object and loads it in the desired model.

loadLikeDislike

load like or disLike after model loaded

The loadLikeDislike function is used to load the likes and dislikes of the object after the model is loaded.

loadLikesDislikes

load likes or dislikes after model loaded

The loadLikesDislikes function is used to load the likes and dislikes of the object after the model is loaded.

isLikedDislikedBy

is liked or disliked by user

forgetLike

forget like or dislike

forgetLikes

forget likes or dislikes

Contributing

Thank you for considering contributing to the Laravel Like! 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-like 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-like contains the following files

Loading the files please wait ....