LaravelFacebookSdk
LaravelFacebookSdk copied to clipboard
array_dot notation not working
Hi Guys!
The array_dot notation not working for me.
My model:
protected static $graph_node_fillable_fields = ['fb_id', 'fb_creator_id', 'message', 'story', 'fb_creator_name'];
protected static $graph_node_field_aliases = [
'id' => 'fb_id',
'message' => 'message',
'story' => 'story',
'from.id' => 'fb_creator_id',
'from.name' => 'fb_creator_name',
];
And it dont save from.id and from.name to the database using createOrUpdateGraphNode.
If i convert fields with array_dot helper in mapGraphNodeFieldNamesToDatabaseColumnNames function than it is working fine
public static function mapGraphNodeFieldNamesToDatabaseColumnNames(Model $object, array $fields)
{
//convert fields to array_dot notation
$fields = array_dot($fields);
foreach ($fields as $field => $value) {
if (static::graphNodeFieldIsWhiteListed(static::fieldToColumnName($field))) {
$object->{static::fieldToColumnName($field)} = $value;
}
}
}
Am I using it wrong or is it a known issue?
Regards, Aprod