protected function _create() { try { $data = $this->_get_user_data(); $user = new PartnerModel(null); $user->id = $user->create(array_replace($data, array('password' => Secure::password($data['password'], $data['username'])))); (new NotifyPartnerAccount())->register($user->id, $data['password']); Alert::once('success', 'Account created successfully!', Url::current()); } catch (\Exception $e) { Alert::once('error', $e->getCode() == 11000 ? 'Username already exists' : $e->getMessage(), Url::current()); } }
/** * Run the migrations. * * @return void */ public function up() { Schema::create('partners', function (Blueprint $table) { $table->increments('id'); $table->string('slug'); $table->string('company'); $table->string('website'); $table->string('slogan')->nullable(); $table->text('bio')->nullable(); $table->text('tags')->nullable(); $table->text('options')->nullable(); $table->text('contacts')->nullable(); $table->string('photo')->nullable(); $table->timestamps(); $table->timestamp('published')->nullable(); $table->softDeletes(); }); Partner::create(['company' => 'TAGITM', 'slug' => 'tagitm', 'website' => 'http://www.tagitm.org', 'slogan' => '', 'photo' => '/images/partners/tagitm.png', 'published' => Carbon::create(2015, 00, 28, 15, 05, 29)]); }