diff --git a/app/Models/Outlet.php b/app/Models/Outlet.php new file mode 100644 index 0000000..4349332 --- /dev/null +++ b/app/Models/Outlet.php @@ -0,0 +1,20 @@ +hasOne(Tv::class, 'outlet_fk', 'id'); } + // -- END RELATED TO MIGRATION2 + //------------------------------------------------------------ +} diff --git a/app/Models/StsLog.php b/app/Models/StsLog.php new file mode 100644 index 0000000..b32f0b6 --- /dev/null +++ b/app/Models/StsLog.php @@ -0,0 +1,12 @@ +hasOne(TvAppInfo::class, 'tv_fk', 'id'); } + /// HAS MANY + public function tv_connect_logs(): HasMany { return $this->hasMany(TvConnectLog::class, 'tv_fk', 'id'); } + public function tv_sessions(): HasMany { return $this->hasMany(TvSession::class, 'tv_fk', 'id'); } + /// BELONGS TO + public function outlet(): BelongsTo { return $this->belongsTo(Outlet::class, 'outlet_fk', 'id'); } + // -- END RELATED TO MIGRATION + //------------------------------------------------------------ +} diff --git a/app/Models/TvAppInfo.php b/app/Models/TvAppInfo.php new file mode 100644 index 0000000..edb3d23 --- /dev/null +++ b/app/Models/TvAppInfo.php @@ -0,0 +1,22 @@ +belongsTo(Tv::class, 'tv_fk', 'id'); } + // -- END RELATED TO MIGRATION + //------------------------------------------------------------ +} diff --git a/app/Models/TvConnectLog.php b/app/Models/TvConnectLog.php new file mode 100644 index 0000000..9c9e961 --- /dev/null +++ b/app/Models/TvConnectLog.php @@ -0,0 +1,18 @@ +belongsTo(Tv::class, 'tv_fk', 'id'); } + // -- END RELATED TO MIGRATION + //------------------------------------------------------------ +} diff --git a/app/Models/TvSession.php b/app/Models/TvSession.php new file mode 100644 index 0000000..4eccdd5 --- /dev/null +++ b/app/Models/TvSession.php @@ -0,0 +1,18 @@ +belongsTo(Tv::class, 'tv_fk', 'id'); } + // -- END RELATED TO MIGRATION + //------------------------------------------------------------ +}