Coder Social home page Coder Social logo

logitick / prelaunchr-laravel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonstavis/prelaunchr-laravel

0.0 2.0 0.0 6 MB

Simple Laravel pre-launch site which collects emails and enables referrals for various tiers of prizes. Inspired by harrystech/prelaunchr.

License: MIT License

PHP 8.54% JavaScript 36.63% CSS 25.34% HTML 29.34% Shell 0.14%

prelaunchr-laravel's Introduction

Prelaunchr-Laravel

Inspired by the harrystech/prelaunchr Ruby on Rails app and a blog post by Tim Ferriss, Prelaunchr-Laravel provides similar functionality for those working with a PHP/Laravel technology stack.

The app provides an email signup, referral links, private referral status page, and prize levels for various numbers of referrals. The app was written for the launch of midwestfit.com to gather referrals and offer free membership extensions to users. By default, the HTML/CSS for MidwestFit is included in this repository. A demo version of the app can be found here with emails disabled.

Mechanics

Prelaunchr-Laravel has a main mechanic from which everything else is derived: Every User is given a unique referral_code which is how the application knows who referred a signing up user. Based on the amount of referrals a User has brought to the site, they are put into a different "prize group". The groups, amounts, and prizes are completely up to you to set.

Users additionally have a referral_secret. This allows for a permanent, private referral status page for each user to see prizes earned. Otherwise, users automatically see this private page as long as their session remains alive in the browser which originated the email signup. As a testing feature you may leave the status page and return to the homepage by visiting /homepage

Rewards are given based on confirmed emails. An email is confirmed by clicking on a link sent to each new email address entered on the main site page.

IP Blocking

Multiple signups from the same IP address may be blocked. This number is configurable via the IP_LIMIT .env.php property.

Setup

  • composer install
  • Copy .env.example to .env and set your database connection properties.
  • php artisan migrate
  • php artisan db:seed
  • npm install
  • gulp watch
  • php artisan serve

Admin

A simple Laravel Administrator administrator panel is available at /admin. You may customize this by following their documentation.

An admin user is provided in this project's seed file.

Teardown

There is currently no automated teardown method to collect referrals. This may be done easily by connecting your live launched app to the prelaunch-laravel database and creating a new model with a few Eloquent relationships:

<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class PrelaunchUser extends Model {

	protected $connection = 'prelaunch';
	protected $table = 'users';

	public function referrer()
	{
		return $this->belongsTo('App\PrelaunchUser', 'referrer_id');
	}

	public function referrals()
	{
		return $this->hasMany('App\PrelaunchUser', 'referrer_id');
	}

	public function confirmedReferrals()
	{
		return $this->hasMany('App\PrelaunchUser', 'referrer_id')->whereValidEmail(true);
	}
}

Count referrals with:

	PrelaunchUser::referrals()->count();

License

The code, documentation, non-branded copy and configuration are released under the MIT license. Any branded assets are included only to illustrate and inspire.

Please change the artwork to use your own brand! MidwestFit does not give you permission to use its logos, brand, or trademarks in your own marketing. Stock images are protected by copyright and may not be used in any manner.

Attributions

prelaunchr-laravel's People

Contributors

jonstavis avatar

Watchers

Paul Daniel Iway avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.