I am trying to build a database structure for a time punching system. What I'm trying to figure out is if what I have is the ideal structure, or if something else exists that I'm overlooking.
I want the records to be connected in some way so that I can pull out all of the records into a table and display them by date and time.
Here is my migration table:
Schema::create('punches', function(Blueprint $t)
{
$t->increments('id');
$t->integer('user_id');
$t->dateTime('time');
$t->boolean('in_punch');
$t->timestamps();
});
I want to be able to have the in punch and the out punch connected, so I don't feel like this is the best way to go about doing it, but I can't come up with anything better. Can you?