I have 2 models: `Customers` and `Attendance` (The relationship is One - Many). I tried to insert a record into the `attendances` table when a customer access to a URL to check in.

```
$customer = Customer::find($id);
$customer->attendances()->create(['checked_in_at' => now()]);

```

However I don't know why above code inserted 2 times instead 1 times, and sometime it inserted correctly 1 time.