mardi 4 octobre 2016

Laravel insert diff between two times on model save

I'm creating a Laravel project but I have an issue.

I'm trying to save the difference between 2 timestamps to the database before I save the model:

My table:

  $table->increments('id');
    $table->time('from');
    $table->time('to');
    $table->time('diff');

So.. before inserting, calculate the difference between these two times and insert this on the same time.

Is this possible and can anyone help me?

Thankyou,



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire