Exemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('leagues')->delete();
     League::create(['league_id' => '1', 'name' => 'Winter 2015 Monday A/B League', 'start_date' => '2015-10-01', 'end_date' => '2016-02-18', 'url' => '???', 'format_id' => 1, 'location_id' => 1]);
     League::create(['league_id' => '2', 'name' => 'Winter 2015 Wednesday C/D League', 'start_date' => '2015-10-01', 'end_date' => '2016-02-18', 'url' => '???', 'format_id' => 1, 'location_id' => 1]);
     League::create(['league_id' => '3', 'name' => 'Spring 2016 Monday A/B League', 'start_date' => '2016-01-15', 'end_date' => '2016-03-20', 'url' => '???', 'format_id' => 1, 'location_id' => 1]);
     League::create(['league_id' => '4', 'name' => 'Spring 2016 Wednesday C/D League', 'start_date' => '2016-01-15', 'end_date' => '2016-03-20', 'url' => '???', 'format_id' => 1, 'location_id' => 1]);
 }
Exemplo n.º 2
0
 /**
  * Fills leagues table
  *
  */
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         $l = League::create(['name' => $faker->name(), 'abbreviation' => $faker->realText(10), 'description' => $faker->realText(150)]);
         $l->game()->associate(Game::first())->save();
         //associate league with first game
     }
 }
Exemplo n.º 3
0
 public function CreateLeague($name, $initial_balance, $userId)
 {
     $league = League::create(['name' => $name, 'code' => 'aaaaa', 'initial_balance' => $initial_balance, 'start_at' => Carbon::now(), 'end_at' => null, 'user_id' => $userId]);
     $randomString = rand(1000, 9999);
     $league->code = $randomString . $league->id;
     $league->user_id = $userId;
     $league->save();
     $this->AddUserToLeague($userId, $league->id, $league->initial_balance);
     return $league->id;
 }
Exemplo n.º 4
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $user = Auth::user();
     League::create(['name' => $request->input('name'), 'description' => $request->input('description'), 'city' => $request->input('city'), 'state' => $request->input('state'), 'commissioner_id' => $user->id]);
 }