Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

Try the following code

User::create(array('name' => 'Name', 'pass' => Hash::make('password')));
Last updated 1 year ago.
0

What other columns do you have your table? Could it be another column that is NOT NULL, not being passed? (you may have a column that is required when inserting a new record, and your are not passing that user property).

Last updated 1 year ago.
0

Could you show your code by making a link from Pastebin.

Last updated 1 year ago.
0
Solution

Don't forget to make your records fillable.

In your model you can add the following:

protected $fillable = ['name', 'pass'];

Also, please don't forget to hash your password.

$password = Hash::make(Input::get('password'));

Please read about fillable at: http://laravel.com/docs/eloquent#mass-assignment

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

MadBerdin madberdin Joined 11 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.