fantasynfl
Laravel NFL Fantasy Football, (*1)
Installation
Create new Laravel Web App composer require laravel/laravel
, (*2)
Install Laravel Auth php artisan make:auth
, (*3)
Remove the user table migration from database/migrations, (*4)
run composer require 3brettb/fantasynfl
, (*5)
Change App\User class to extend FantasyNFL\Fantasy\Models\User, (*6)
run php artisan vendor:publish
, (*7)
run php artisan migrate
, (*8)
Add an authenticated()
method to LoginController, (*9)
/**
* Perform Fantasy NFL Login actions
*
* @param Request $request
* @param $user
*/
public function authenticated(Request $request, $user)
{
FantasyNFL::login($user);
}
FantasyNFL Documentation
Get Team Roster, (*10)
FantasyNFL::roster($team_id);
Get League, (*11)
FantasyNFL::find($league_id);
Get League Activity, (*12)
$league->activity()
Get Entities involved with Activity, (*13)
$activity->involved[0]->get()
Get Link <a> tag
associated with activity, (*14)
$activity->links[0]->a_tag();
Get League Divisions, (*15)
$league->divisions()
// -- or --
$league->division($division_id)
Get Division Teams, (*16)
$division->teams()
Get Week, (*17)
$league->week() // to get current week
$league->week($week_number) // to get specific week of current season
$league->week($week_number, $year) // returns week of the given season and number
Get Season, (*18)
$league->season() // to get current season
$league->season($year) // to get specific season by year