stickleapp / core
This is my package stickle core
Fund package maintenance!
D Clay Smith
Installs: 225
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
pkg:composer/stickleapp/core
Requires
- php: ^8.3
- illuminate/contracts: ^10.0||^11.0||^12.0
- laravel/prompts: ^0.3.7
Requires (Dev)
- driftingly/rector-laravel: ^2.1
- larastan/larastan: ^3.7
- laravel/boost: ^1.2
- laravel/pint: ^1.25
- nesbot/carbon: ^3.10
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.6
- pestphp/pest: ^4.1
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-faker: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/phpstan: ^2.1
- rector/rector: ^2.2
This package is auto-updated.
Last update: 2025-10-20 11:13:47 UTC
README
This software is not ready to be used. Contact me dclaysmith@gmail.com.
Stickle is a package for Laravel that helps you analyze--and interact with--your customer base.
Use Cases
Stickle allows you to embed customer analytics and engagement functionality in your Laravel application. Use it to:
- Build real-time customer analytics dashboard;
- Trigger Laravel notifications based on end-user behavior;
- Highlight important customer behavior in your admin panel;
- Segment your customer base to identify high value or at-risk customers in realtime.
Stickle Apps allow you to do even more.
Stickle Core
Stickle Core is the foundation of Stickle that:
- Tracks user attributes and behavior via a Javascript tracking code;
- Logs authentication events;
- Logs changes in model attributes;
- Logs user-defined server-side events;
- Exposes Eloquent methods for querying your customers;
- Exposes a REST API for ingesting events from other channels (Mobile, etc);
- Provides the ability to define customer segments 'as-code' and track these segments over time.
Stickle Apps
Stickle Apps extend the funtionality of Stickle Core. Anyone can write a Stickle app but we'll provide some first-party apps to get people started.
Getting Started
Requirements
Stickle requires:
- PHP 8.3+
- Laravel 11.0+.
Installation
You may use Composer to require Stickle into your PHP project:
composer require stickleapp/core
You may install Stickle into your Laravel project using the following command:
php artisan install:stickle
The installer will guide you through the setup process helping you set configuration options for your project. You can specify:
- If you want to install the Stickle JS SDK and track client events;
- If you want to track events raised by Illuminate\Auth events;
- If you want to track each authenticated event via middleware; and
- How you define the relationships between
Users
andGroups
in your application.
Running Migrations
After you have specified your configuration options in the installation script, run migrations:
php artisan migrate
Initialization
When complete you can run Stickle with the following command:
php artisan run:stickle
This command will does the following:
- activates cron tasks;
- activates websockets server (if applicable).
You can access a test page at the URL specified in the terminal.
Advanced Configuration
Stickle will work out of the box using the configuration options specified during the installation process. You can override these (and several other) options in the config\stickle.php
file.
Database Options
You can specify the following configuration options:
connection
. (Defaults toDB_CONNECTION
env value) This connection should contain the tracked models.tablePrefix
. (Defaultlc*
) This will be prepended to the tables created by the migrations.
Sync Schedule
Stickle runs several jobs to transform your data. You can update the frequency that these jobs run:
ExportSegments
. (Default Every 360 minutes).RecordSegmentStatistics
. (Default Every 360 minutes).RecordEntityStatistics
. (Default Every 360 minutes).RollupEvents
. (Default Every 360 minutes).RollupPageViews
. (Default Every 360 minutes).RollupSessions
. (Default Every 360 minutes).
Customer Models
User
. By default, Stickle assumes theApp\Models\User
class is the user responsible for authentication events. You can override this class.Group
. You can optionally specify a Group class that represents a real world company, account, organization, etc. that aUser
belongs to.Relationship
. You should specify the relationship between theGroup
and theUser
. By default, the relationship isIlluminate\Database\Eloquent\Relations\HasMany
meaning eachGroup
has zero or moreUsers
objects. Other options include:Illuminate\Database\Eloquent\Relations\HasOne
. EachUser
belongs to oneGroup
and eachGroup
has exactly oneUser
.Illuminate\Database\Eloquent\Relations\BelongsToMany
. EachUser
can belong to zero or moreGroups
and eachGroup
can have have zero or moreUsers
.
Payment
. You can optionally specify a Payment model that represents a payment made by a StickleEntity model to your organization.
Tracking Options
Stickle can track requests and events on the server and on the client. There are several configuration options that determine the behavior of each method:
Server
loadMiddleware
. Defaulttrue
. Whentrue
, Stickle loads middleware during the Package Service Provider'sboot
method.trackAuthenticationEvents
. Defaulttrue
. Automatically log all authenticatedIlluminate\Auth
events.trackRequests
. Defaulttrue
. Automatically track all authenticated requests made in the application.
Client
loadMiddleware
. Defaulttrue
. Whentrue
, Stickle injects a tracking code via middleware during the Package Service Provider'sboot
method.trackPageViews
. Defaulttrue
. Whentrue
, the Javascript tracking code will listen for pushState changes and record a pageview for each.routePrefix
. Default''
. Tracking events are sent to the/request
endpoint by default. If you move this endpoint to a different location, updateroutePrefix
to reflect this location.
Paths
Where to autoload Segments
(ActiveAccounts.php) and export them.
Where to autoload Listeners
Where to autoload Playbooks
(ActiveAccounts.php) and export them (Move to => Stickle Playbooks)
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.