Hey,
Wanna Laravel attach
method automatically check duplicate row in database,While i have created_at
field in my pivot table, so attach method can't modify duplicate rows, what can i do?
Something like this:
$user->performs()->attach($perform,['created_at' => Carbon::now()]);
EDITED:
I tried to use user_id
and perform_id
as primary but dont work as i want
FIXED
Fixed by this instead of id in table:
$table->primary(['user_id','perform_id']);