Fixes setup and mass assignment of username. Closes #69

This commit is contained in:
James Brooks
2014-12-04 22:33:15 +00:00
parent 70e95f6123
commit 2493da017f
2 changed files with 8 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ class SetupController extends Controller {
*/
public function postIndex() {
$postData = Input::get();
$v = Validator::make($postData, [
'settings.app_name' => 'required',
'settings.app_domain' => 'required',
@@ -34,7 +35,7 @@ class SetupController extends Controller {
// Pull the user details out.
$userDetails = array_pull($postData, 'user');
User::create([
$user = User::create([
'username' => $userDetails['username'],
'email' => $userDetails['email'],
'password' => $userDetails['password'],

View File

@@ -11,18 +11,22 @@ class User extends Eloquent implements UserInterface, RemindableInterface {
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
/**
* Items which can be mass assigned.
* @var array
*/
protected $fillable = ['username'];
/**
* Hash any password being inserted by default
*