php - angular-laravel create users gives a query exception -
i'm trying create new users in basic laravel-angularjs app. i'm getting 500 server error , upon looking further there's query exception. i'm passing text value password hashed. error because of this?
angular controller:
user.saveusers({ "first_name":um.firstname, "last_name":um.lastname, "admin":um.admin, "email":um.email, "password":um.password }).then(function(success) { console.log(success); }, function(error) { console.log(error); });
the laravel controller:
public function store(request $request) { // $data = request::all(); $users = new user(); $users->fill($data); $users->save(); }
users.php:
protected $fillable = ['first_name','last_name','admin', 'email', 'password']; protected $hidden = ['password', 'remember_token', 'created_at', 'updated_at'];
table structure:
create table "users" ("id" integer not null primary key autoincrement, "first_name" varchar not null, "last_name" varchar not null, "admin" tinyint not null, "email" varchar not null, "password" varchar not null, "remember_token" varchar null, "created_at" datetime not null, "updated_at" datetime not null)
Comments
Post a Comment