项目作者: 3brettb

项目描述 :
Laravel NFL Fantasy Football
高级语言: PHP
项目地址: git://github.com/3brettb/fantasynfl.git
创建时间: 2017-11-29T19:40:38Z
项目社区:https://github.com/3brettb/fantasynfl

开源协议:MIT License

下载


fantasynfl

Laravel NFL Fantasy Football

Installation

Create new Laravel Web App composer require laravel/laravel

Install Laravel Auth php artisan make:auth

Remove the user table migration from database/migrations

run composer require 3brettb/fantasynfl

Change App\User class to extend FantasyNFL\Fantasy\Models\User

run php artisan vendor:publish

run php artisan migrate

Add an authenticated() method to LoginController

  1. /**
  2. * Perform Fantasy NFL Login actions
  3. *
  4. * @param Request $request
  5. * @param $user
  6. */
  7. public function authenticated(Request $request, $user)
  8. {
  9. FantasyNFL::login($user);
  10. }

FantasyNFL Documentation

Get Team Roster

  1. FantasyNFL::roster($team_id);

Get League

  1. FantasyNFL::find($league_id);

Get League Activity

  1. $league->activity()

Get Entities involved with Activity

  1. $activity->involved[0]->get()

Get Link <a> tag associated with activity

  1. $activity->links[0]->a_tag();

Get League Divisions

  1. $league->divisions()
  2. // -- or --
  3. $league->division($division_id)

Get Division Teams

  1. $division->teams()

Get Week

  1. $league->week() // to get current week
  2. $league->week($week_number) // to get specific week of current season
  3. $league->week($week_number, $year) // returns week of the given season and number

Get Season

  1. $league->season() // to get current season
  2. $league->season($year) // to get specific season by year