public function run() { DB::table('teams')->delete(); $team = App\Team::create(array('name' => 'Developer', 'description' => 'This is the team for developers.')); $team = App\Team::create(array('name' => 'Consultants', 'description' => 'This is the team for consultants.')); $team = App\Team::create(array('name' => 'Support', 'description' => 'This is the team for supporter.')); }
<?php /* |-------------------------------------------------------------------------- | Model Factories |-------------------------------------------------------------------------- | | Here you may define all of your model factories. Model factories give | you a convenient way to create models for testing and seeding your | database. Just tell the factory how a default model should look. | */ $factory->define(App\User::class, function (Faker\Generator $faker) { return ['name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt(str_random(10)), 'remember_token' => str_random(10)]; }); $factory->define(App\Team::class, function (Faker\Generator $faker) { return ['name' => $faker->colorName, 'city' => $faker->city, 'logo' => $faker->name, 'logo_ext' => $faker->fileExtension]; }); $factory->define(App\Match::class, function (Faker\Generator $faker) { return ['team1_id' => App\Team::all()->random()->id, 'team2_id' => App\Team::all()->random()->id, 'team1_goals' => rand(1, 10), 'team2_goals' => rand(1, 10), 'team_type' => rand(0, 1) ? 'senior' : 'sub-15', 'city' => $faker->city, 'date' => $faker->dateTime]; }); $factory->define(App\Player::class, function (Faker\Generator $faker) { return ['name' => $faker->firstName, 'last_name' => $faker->lastName, 'number' => rand(1, 1000), 'position' => $faker->word, 'image' => $faker->name, 'image_ext' => $faker->fileExtension, 'team_type' => rand(0, 1) ? 'senior' : 'sub-15']; }); $factory->define(App\Statistic::class, function (Faker\Generator $faker) { return ['matches' => rand(0, 200), 'victories' => rand(0, 200), 'draws' => rand(0, 200), 'defeats' => rand(0, 200), 'goals_scored' => rand(0, 200), 'goals_conceded' => rand(0, 200), 'yellow_cards' => rand(0, 20), 'red_cards' => rand(0, 10), 'harnessing' => rand(0, 50), 'frequency' => rand(0, 100), 'unrealized_matches' => rand(0, 10), 'predicted_matches' => rand(0, 30), 'year' => rand(2012, 2016)]; });
Route::put('userseen/{user}', 'UserController@updateSeen'); Route::resource('user', 'UserController'); // Authentication routes... //Route::get('auth/login', 'Auth\AuthController@getLogin'); Route::get('auth/login', function () { return view('front.login')->with('teamResults', App\Team::orderBy('team_points', 'desc')->take(10)->get())->with('j', $j = 1); }); Route::post('auth/login', 'Auth\\AuthController@postLogin'); Route::get('auth/logout', 'Auth\\AuthController@getLogout'); Route::get('auth/confirm/{token}', 'Auth\\AuthController@getConfirm'); // Resend routes... Route::get('auth/resend', 'Auth\\AuthController@getResend'); // Registration routes... //Route::get('auth/register', 'Auth\AuthController@getRegister'); Route::get('auth/register', function () { return view('front.register')->with('teamResults', App\Team::orderBy('team_points', 'desc')->take(10)->get())->with('j', $j = 1); }); Route::post('auth/register', 'Auth\\AuthController@postRegister'); // Password reset link request routes... Route::get('password/email', 'Auth\\PasswordController@getEmail'); Route::post('password/email', 'Auth\\PasswordController@postEmail'); // Password reset routes... Route::get('password/reset/{token}', 'Auth\\PasswordController@getReset'); Route::post('password/reset', 'Auth\\PasswordController@postReset'); Route::get('team_player_list', ['uses' => 'TeamPlayerListController@index', 'middleware' => ['auth', 'notHaveTeam']]); Route::put('matchplayer/{id}', 'TeamPlayerListController@updateMatchPlayer'); /*Route::get('create_team', function(){ return view('test.create_team'); });*/ Route::get('game_player_list', ['uses' => 'GamePlayerListController@index', 'middleware' => ['auth', 'notHaveTeam']]); Route::get('add_player_in_team', ['uses' => 'AddPlayerInTeamController@index', 'middleware' => ['auth', 'notHaveTeam']]);