/** * Run the database seeds. * * @return void */ public function run() { DB::table('user_profiles')->delete(); $profile = [['username' => 'admin', 'bio' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero.', 'url' => 'http://www.example.org/admin', 'phone' => '+34935555555', 'mobile' => '+34934444444', 'date_of_birth' => \Carbon\Carbon::createFromDate(1977, 1, 28)->toDateTimeString(), 'gender' => 'male', 'twitter' => 'https://twitter.com/pakusland', 'facebook' => 'https://www.facebook.com/paco.orozco', 'linkedin' => 'https://www.linkedin.com/in/pacoorozco', 'github' => 'https://github.com/pacoorozco'], ['username' => 'user', 'bio' => 'Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit.', 'url' => 'http://www.example.org/user', 'phone' => '+34935555551', 'mobile' => '+34934444441', 'date_of_birth' => \Carbon\Carbon::createFromDate(2008, 8, 7)->toDateTimeString(), 'gender' => 'male', 'twitter' => 'https://twitter.com/emilisho', 'facebook' => 'https://www.facebook.com/eampudia', 'linkedin' => 'https://www.linkedin.com/in/emilioa', 'github' => '']]; foreach ($profile as $data) { $user = \Gamify\User::where('username', $data['username'])->firstOrFail(); $profile = new \Gamify\UserProfile(array_except($data, ['username'])); $user->profile()->save($profile); } }
/* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ /** ------------------------------------------ * Route model binding * ------------------------------------------. */ Route::bind('username', function ($value) { return \Gamify\User::where('username', $value)->first(); }); Route::bind('question', function ($value) { return \Gamify\Question::where('shortname', $value)->first(); }); Route::model('users', '\\Gamify\\User'); Route::model('badges', '\\Gamify\\Badge'); Route::model('levels', '\\Gamify\\Level'); Route::model('questions', '\\Gamify\\Question'); Route::model('actions', '\\Gamify\\QuestionAction'); // Authentication routes... Route::get('auth/login', 'Auth\\AuthController@getLogin'); Route::post('auth/login', 'Auth\\AuthController@postLogin'); Route::get('auth/logout', 'Auth\\AuthController@getLogout'); // Registration routes... //Route::get('auth/register', 'Auth\AuthController@getRegister');