Files
opnform-host-nginx/api/app/Models/Forms/FormSubmission.php
Chirag Chhatrala ceb0648262 Better Form Stats (#567)
* Better Form Stats

* fix lint

* submission timer store in localstorage

* Update test case for stats

* remove extra code

* fix form stats

* on restart remove timer

* fix resetTimer function name

* Improve form timer

* Fix timer after form validation error + polish UI

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-09-18 19:20:52 +02:00

33 lines
547 B
PHP

<?php
namespace App\Models\Forms;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class FormSubmission extends Model
{
use HasFactory;
protected $fillable = [
'data',
'completion_time',
];
protected function casts(): array
{
return [
'data' => 'array',
'completion_time' => 'integer',
];
}
/**
* RelationShips
*/
public function form()
{
return $this->belongsTo(Form::class);
}
}