Download the PHP package hawaaworld/laravel-trends without Composer

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

Laravel Trends

Total Downloads Latest Stable Version License

Note This package is a fork of hacklabsdev/laravel-trends and is not maintained by the original author.

Introduction

Have you ever wondered how Twitter's Trending Topics works? Laravel Trends provides a lightweight trending system to your application.

Prerequisites

Before you install the package make sure you have queues working and running since Trends uses it to control the tendencies. Refer to Laravel official documentation in order to configure queues in your project.

Installation

You may install Laravel Trends via Composer:

composer require hawaaworld/laravel-trends

Next, publish the Trends configuration and migration files using the vendor:publish command. The configuration file will be placed in your config directory:

php artisan vendor:publish --provider="Hawaaworld\Trends\TrendsServiceProvider"

And finally, you should run your database migrations:

php artisan migrate

How it works

Trends allows you to create a trending system for any model you want. Let's take Twitter as an example. Everytime a hashtag is tweeted it receives 1 point of energy, but after 30 minutes this single point of energy loss 0.25 of its value. After more 30 minutes it loss 0.45 points of its value. Finally, after another 30 minutes it loss 0.30 of its value returning to 0. But how can a trend be detected? Imagine that thousands of people hits the same hashtag at the same time, this hashtag will have thousands of energy points and if you have an ordered list of hashtags this one will surely be on top, but after a few minutes if this hashtag doesn't receive any more energy points it will start to lose its energy and loss over time.

Configuration

To configure your losing time you can set the loss_time parameter in config/trends.php. The losing time is measured in hours.

Preparing your model

To allow your model to work with Trends you'll need to implement the Energy interface with HasEnergy trait. And in order to return the current model's energy value, add energy_amount to your serialization.

Usage

To add energy to your model use the following method:

To get the current energy amount:

Getting the top trends

to get the top trends from all types of models use the following method:

To customize the model you want to retrieve, let's say you want to get the top 10 trending videos, you can use the following method:

You can set your own query builder to get the trending models you want:

License

Laravel Trends is open-sourced software licensed under the MIT license.


All versions of laravel-trends with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2|^8.3
laravel/framework Version ^9.0|^10.0|^11.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 hawaaworld/laravel-trends contains the following files

Loading the files please wait ....