schulzefelix / laravel-stat-search-analytics by schulzefelix

A Laravel API Wrapper For STAT Search Analytics.
73
2
3
Package Data
Maintainer Username: schulzefelix
Maintainer Contact: github@schulze.co (Felix Schulze)
Package Create Date: 2016-11-04
Package Last Update: 2020-04-12
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-22 03:07:33
Package Statistics
Total Downloads: 73
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 2
Total Watchers: 3
Total Forks: 1
Total Open Issues: 0

A Laravel API Wrapper For STAT Search Analytics.

Latest Version Software License Build Status Quality Score StyleCI Latest Version on Packagist Total Downloads

For information about STAT Search Analytics see https://getstat.com/

Install

This package can be installed through Composer.

$ composer require schulzefelix/laravel-stat-search-analytics

In Laravel 5.5 the package will autoregister the service provider. In Laravel 5.4 you must install this service provider.

// config/app.php
'providers' => [
    ...
    SchulzeFelix\Stat\StatServiceProvider::class,
    ...
];

In Laravel 5.5 the package will autoregister the facade. In Laravel 5.4 you must install the facade manually.

// config/app.php
'aliases' => [
    ...
    'Stat' => SchulzeFelix\Stat\StatFacade::class,
    ...
];

You can publish the config file of this package with this command:

php artisan vendor:publish --provider="SchulzeFelix\Stat\StatServiceProvider"

Usage

Introduction

The responses of this packages are combinations of Laravel Collections, objects for each kind of data object and Carbon instances for date fields.

Projects Methods

List All Projects

The list methods returns a collection of all projects.

$projects = Stat::projects()->list();

Create A Project

To create a project just pass the name of the project. The response will we a StatProject instance.

$project = Stat::projects()->create('Cheese Cake Factory');

$project->toArray();

/*
[
    'id' => 615,
    'name' => 'Cheese Cake Factory',
    'total_sites' => 0,
    'created_at' => 2016-11-01,
    'updated_at' => 2016-11-01,
]
*/

Update A Project

To update the name of a project just pass the project ID and the new name. The response will we a StatProject instance.

$project = Stat::projects()->update(615, 'Cheese Cake Bakery');

$project->toArray();

/*
[
    'id' => 615,
    'name' => 'Cheese Cake Bakery',
    'total_sites' => 5,
    'created_at' => 2016-11-01,
    'updated_at' => 2016-11-03,
]
*/

Delete A Project

To delete a project just pass the project ID. The response the project ID.

$project = Stat::projects()->delete(615);

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ vendor/bin/phpunit

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Credits

License

The MIT License (MIT). Please see License File for more information.