gizmojo's avatar

Replicate fillable columns only

Is there a way of replicating straight from collection record?

$result = Product::withCount('categories')->get();

$record = $result->first();
$replicate = $record->replicate();

// Unset non-fillable?

$replicate->save();

Above code throws error:

Column not found: 1054 Unknown column 'categories_count' in 'field list'

0 likes
1 reply

Please or to participate in this conversation.