Suppose, I have these ardent models
class User extends \LaravelBook\Ardent\Ardent
{
public $autoHydrateEntityFromInput = true;
protected $fillable = array('username', 'password', 'address');
protected $table = 'Users';
public static $relationsData = array(
'location' => array(self::HAS_ONE, 'Location');
}
class Location extends \LaravelBook\Ardent\Ardent
{
protected $fillable = array('address');
protected $table = 'Locations';
}
Now, when I write a controller code like this,
$user = new User;
$user->address = Input::get('address');
$user->push();
It doesn't save the address data to address table
Did you find a solution for this?? this is exactly what i'm trying to do..
Take a look into this discussion http://laravel.io/forum/06-11-2014-how-to-access-additional-user-information-stored-in-another-table
I think it can be helpfull
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community