2017 © Pedro Peláez
 

library laravel-counter

A Laravel 5 package providing counting functionality on models, such as view counters or 'likes'.

image

teamteatime/laravel-counter

A Laravel 5 package providing counting functionality on models, such as view counters or 'likes'.

  • Tuesday, October 27, 2015
  • by Riari
  • Repository
  • 2 Watchers
  • 5 Stars
  • 42 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Note: this package is under active development. While it should be completely functional, caution is advised and you might wish to wait until the first release is pushed out. Until then, things are likely to change and possibly break as features are added or altered., (*1)

If you encounter any issues or have a suggestion, please create an issue., (*2)

Installation

Step 1: Install the package

Add the package to your composer.json and run composer update:, (*3)

"teamteatime/laravel-counter": "dev-master"

Add the service provider to your config/app.php:, (*4)

'TeamTeaTime\Counter\CounterServiceProvider',

If your app defines a catch-all route, make sure you load this service provider before your app service providers., (*5)

Step 2: Publish the package files

Run the vendor:publish command to publish Filer's migrations:, (*6)

php artisan vendor:publish, (*7)

Step 3: Update your database

Run your migrations:, (*8)

php artisan migrate, (*9)

Step 4: Update your models

Add counter support to your models by using the HasCounters trait:, (*10)

class ... extends Eloquent {
    use \TeamTeaTime\Counter\HasCounters;
}

Configuration

Filer requires no configuration out of the box in most cases, but the following options are available to you in config/counter.php:, (*11)

Option Type Description Default
user Array The name of your app's User model, and a closure to return the user ID. These are used to associate counter activity with users. auth()->user()->id or 0

Usage

The Versions

27/10 2015

dev-master

9999999-dev

A Laravel 5 package providing counting functionality on models, such as view counters or 'likes'.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar Riari
by NeeHi

laravel counter view laravel-5 views likes