@ -23,6 +23,8 @@ class TvController extends Controller {
$latestVideoUpdate = null;
if($request->id) {
$tv = Tv::find($request->id);
$tv->last_connected_at = now();
$tv->save();
$latestApkUpdate = ApkUpdate::getLatest();
$latestVideoUpdate = VideoUpdate::getLatestSelected();
}
@ -167,6 +167,8 @@ class NewTvRequest extends Model {
$tv->col10 = $tvRequest->col10;
$tv->notes = $tvRequest->notes;
$tv->device_info = $newTvReq->device_info;
$tv->installed_at = now();
$newTvReq->activated_at = now();
@ -40,13 +40,6 @@ class Tv extends Model {
//------------------------------------------------------------
// -- RELATED TO DATA FUNCTION
public static function createAnonymousData() :Tv {
$newTv = new self;
$newTv->code = self::generateRandomCode();
$newTv->is_active = true;
$newTv->save();
return $newTv;
// -- END RELATED TO DATA FUNCTION
@ -27,7 +27,7 @@ return new class extends Migration {
$table->string('notes', 255)->nullable();
$table->boolean('is_active')->default(true);
$table->jsonb('device_info')->nullable();
$table->timestampTz('installed_at')->nullable();
$table->timestampTz('installed_at');
$table->timestampTz('last_connected_at')->nullable();
$table->timestampsTz();
});