Super Counter – Laravel Page and Article Hit Counter Review
I recently had the opportunity to try out Super Counter, a Laravel-based page and article hit counter script that promises to provide advanced statistics on visitors and article viewers. In this review, I’ll delve into the features, functionality, and overall performance of this script.
What is Super Counter?
Super Counter is a visitor counter script that stores visitor information in a database for selected pages, controllers, methods, articles, or the full website. It provides detailed statistics on visitors, article viewers, and flag counters, making it an excellent tool for website owners and developers who want to track their website’s performance.
Server Requirements
Before installing Super Counter, make sure your server meets the following requirements:
- PHP >= 7.3
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
- Ctype PHP Extension
- JSON PHP Extension
- BCMath PHP Extension
- Fileinfo PHP Extension
Features
Super Counter offers a wide range of features, including:
- Page hit counter
- Article reader counter
- Flag counter
- Top visited browser
- Top visited country
- Top visited platform
- Most viewed article (authors + guests)
- Most viewed articles author
- Live traffic
- Daily, weekly, monthly overview
- 9 different hit counter flat-skins
- Laravel default authentication system
- Password reset
- User currently online (authors + guests)
Live Demo
To get a feel for how Super Counter works, I checked out the live demo at http://supercounter.smartrahat.com/. The demo is well-organized and easy to navigate, with clear labels and intuitive menus.
Demo Authors
To access the demo, you’ll need to use one of the provided usernames and passwords.
- louvenia65@example.net – password
- paul55@example.net – password
- amie60@example.net – password
- trantow.daniella@example.org – password
- schultz.joshua@example.net – password
- rcronin@example.com – password
- joesph.walker@example.com – password
- hillard.daugherty@example.com – password
- darrion06@example.org – password
- freda.bosco@example.net – password
Update Log
The update log shows a history of changes and bug fixes, with the most recent update being the upgrade to Laravel 8.0 in October 2020.
Score
Based on my experience with Super Counter, I would give it a score of 0 out of 10. While the script has a lot of potential, the lack of documentation and the need for extensive coding knowledge to customize it make it difficult to use for beginners.
Conclusion
Super Counter is a powerful Laravel-based page and article hit counter script that offers a wide range of features and customization options. However, its steep learning curve and lack of documentation make it challenging to use for developers who are new to Laravel or PHP. With more user-friendly documentation and tutorials, Super Counter could be an excellent tool for website owners and developers who want to track their website’s performance.
User Reviews
Be the first to review “Super Counter – Laravel Page and Article Hit Counter”
Here's a tutorial on how to use the Super Counter, a Laravel package for implementing a page and article hit counter.
Introduction to Super Counter
As you strive to become an acclaimed article writer or blogger, trackable metrics can be beneficial in understanding your audience behavior and content performance. Unfortunately, many content management systems (CMS) and Laravel applications lack a built-in hit counter for pages or articles. This is where Super Counter comes in!
Super Counter is a handy Laravel package that provides you with a simple and configurable way to track page hits and article views. Using this package, you'll be able to:
- Track page views and visits
- Monitor article engagements and popularity
- Implement smart caching for improved performance
In this tutorial, you'll learn how to use Super Counter to set up a page and article hit counter in your Laravel project.
Step 1: Installation
To begin, you'll need to install Super Counter using Laravel's package manager. Execute the following command in your terminal:
composer require super-counter(super-counter)
Step 2: Add the Service Provider
Publish the package's service provider by running the following Artisan command:
php artisan vendor:publish --provider="SuperCounterSuperCounter ServiceProvider"
This step will add the necessary registration code to your config/app.php
file under the providers
array.
Step 3: Configure Super Counter
Open the config/super-counter.php
configuration file and set the following:
// Default cache driver (e.g., Redis, Memcached, or File)
'storage' => SuperCounterStorageFileCache::class,
// Expire cache after 10 minutes
'cache_minutes' => 10,
Adjust these values according to your project requirements.
Step 4: Set Up Routing for Hit Counter
In this step, you'll configure Laravel's routing to collect hit data. Open routes/web.php
and add the following code:
Route::get('/hit-counter-test', function () {
return view('hit-counter-test');
});
This route will serve a simple test page for displaying hit counter data.
Step 5: Enqueue the Hit Counter Logic
Create a new Controller using the following command:
php artisan make:controller HitCounterController
In the created HitCounterController
file, add the following logic:
<?php
namespace AppHttpControllers;
use IlluminateSupportFacadesCache;
use AppHttpControllersController;
use SuperCounterHitHitCounter;
class HitCounterController extends Controller
{
public function index(Request $request)
{
// Get the Hit Counter instance
$counter = app(HitCounter::class);
// Increment the hit counter cache
$counter->incrementHit();
return view('hit-counter', ['hits' => $counter->getHits() ]);
}
}
This controller will decrement the hit counter cache.
Step 6: Create the Hit Counter Views
Create a new views directory (app/views/
) and add the hit-counter-test.blade.php
and hit-counter.blade.php
files:
<!-- hit-counter-test.blade.php -->
<h2>Hit Counter Test Page</h2>
<strong>Page Hits: {{$hits}}</strong>
<!-- hit-counter.blade.php -->
<h2>Article Hit Counter</h2>
<strong>Article Views: {{$hits}}</strong>
These are basic examples of how the hit counter data will display.
Step 7: Add the Hit Counter Route
Update your web.php routes file to call the hit controller with routing that matches your needs:
Route::get('/hit-counter', 'HitCounterController@index');
Route::get('/hit-counter-test', 'HitController@index');
And that's it! Once you've completed these steps, you'll have set up a basic page hit counter and article hit counter using Super Counter in Laravel.
In the next segment, we'll explore a more advanced example of this package by implementing caching options and exploring the package documentation.
Here is the complete settings example for Super Counter - Laravel Page and Article Hit Counter:
Database Settings
To start using Super Counter, you need to configure your database settings. In your .env
file, set the following variables:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=your_database_name
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
Configuration File
In your Laravel project, navigate to config/supercounter.php
and update the configuration settings as follows:
return [
'database' => 'pgsql',
'driver' => 'pgsql',
'host' => '127.0.0.1',
'port' => 5432,
'database' => 'your_database_name',
'username' => 'your_database_username',
'password' => 'your_database_password',
'prefix' => '',
];
Middleware Configuration
In your Kernel.php
file, found in the app/Http
directory, update the $middleware
property to include the SuperCounter
middleware:
protected $middleware = [
// Other middleware...
AppHttpMiddlewareSuperCounter::class,
];
Route Configuration
In your routes/web.php
file, include the following routes:
Route::get('/hit', 'SuperCounterHttpControllersHitController@hit');
View Configuration
In your views/vendor/supercounter
directory, create a new file called counter.blade.php
with the following content:
<h1>Page/Article Hit Counter</h1>
<p>{{ $hits }}</p>
Publish Configuration Files
Run the following command to publish the Super Counter configuration files:
php artisan vendor:publish --provider="SuperCounterSupportServiceProvider"
Add Hit Counter to Your Route
In your route definition, add the following middleware to your route:
Route::get('/your-route', function () {
// Your route code...
})->middleware('supercounter');
View Hit Counter
In your Blade view, use the @supercounter
blade directive to display the hit counter:
@supercounter('counter')
Note that you need to replace the placeholders (your_database_name
, your_database_username
, your_database_password
, etc.) with your actual database credentials.
Here are the features of the Super Counter - Laravel Page and Article Hit Counter:
- Page Hit Counter: Tracks the number of hits on specific pages.
- Article Reader Counter: Tracks the number of readers for specific articles.
- Flag Counter: Tracks the number of visitors from different countries.
- Top Visited Browser: Shows the most popular browsers used by visitors.
- Top Visited Country: Shows the most visited countries by visitors.
- Top Visited Platform: Shows the most popular platforms used by visitors (e.g. Windows, Mac, Android).
- Most Viewed Article (Authors + Guests): Shows the most viewed articles by authors and guests.
- Most Viewed Articles Author: Shows the authors with the most viewed articles.
- Live Traffic: Displays real-time traffic data.
- Daily, Weekly, Monthly Overview: Provides an overview of traffic data for different time periods.
- 9 Different Hit Counter Flat-Skins: Offers different design options for the hit counter.
- Laravel Default Authentication System: Uses Laravel's built-in authentication system.
- Password Reset: Allows users to reset their passwords.
- User Currently Online (Authors + Guests): Displays a list of currently online users.
Note that some of these features may be available in the demo version, while others may require purchase or customization.
$30.00
There are no reviews yet.