yormy/referral-system

Tracking of referrals in laravel

0.0.5 2022-07-01 08:49 UTC

This package is auto-updated.

Last update: 2022-07-01 09:18:47 UTC


README

Latest Version on Packagist Total Downloads GitHub Workflow Status Alt text

Installation

You can install the package via composer:

composer require yormy/referral-system

You can publish and run the migrations with:

php artisan vendor:publish --provider="Yormy\ReferralSystem\ReferralSystemServiceProvider" --tag="migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --provider="Yormy\ReferralSystem\ReferralSystemServiceProvider" --tag="config"

Setting up middelware

Add the following middleware to your routes web so that the cookies are captured

'web' => [
    ...
    \Yormy\ReferralSystem\Http\Middleware\ReferrerMiddleware::class,

Without publishing your views and you use of VUE:

In your app.js

require("./../../vendor/yormy/referral-system/resources/assets/package.js")

rerun

run npm prod

Views publishing

Blade version

php artisan vendor:publish --provider="Yormy\ReferralSystem\ReferralSystemServiceProvider" --tag="blade"

Vue version

Note , this needs vuetify v-datatable and v-chip

php artisan vendor:publish --provider="Yormy\ReferralSystem\ReferralSystemServiceProvider" --tag="vue"

in your app.js

require("./../assets/vendor/referral-system/package")

rerun

run npm prod

Register your routes

User routes

For referrers to see their own statistics Make sure you publish these routes within your authentication middleware

Route::ReferralSystemUser('referral-system');

This makes the routes available as /referral-system/details

Admin routes

Your admin routes to see the referrers overview Make sure you publish these routes within your authentication middleware

Route::ReferralSystemAdmin('referral-system');

This makes the routes available as /referral-system/referrers

Usage

$referral-system = new Yormy\ReferralSystem();
echo $referral-system->echoPhrase('Hello, Yormy!');

Testing

composer test

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.