diff --git a/src/Migrations/2021_05_13_043430_unifi_devices_add_authkey_site_fields.php b/src/Migrations/2021_05_13_043430_unifi_devices_add_authkey_site_fields.php new file mode 100644 index 0000000..80bfc1c --- /dev/null +++ b/src/Migrations/2021_05_13_043430_unifi_devices_add_authkey_site_fields.php @@ -0,0 +1,34 @@ +string('auth_key')->default('ba86f2bbe107c7c57eb5f2690775c712'); + $table->string('site_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('unifi_devices', function (Blueprint $table) { + $table->dropColumn('auth_key'); + $table->dropColumn('site_id'); + }); + } +} diff --git a/src/Migrations/2021_05_13_230810_create_unifi_sites_table.php b/src/Migrations/2021_05_13_230810_create_unifi_sites_table.php new file mode 100644 index 0000000..7b9e006 --- /dev/null +++ b/src/Migrations/2021_05_13_230810_create_unifi_sites_table.php @@ -0,0 +1,34 @@ +timestamps(); + $table->softDeletes(); + $table->string('id'); + $table->primary('id'); + $table->string('name'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('unifi_sites'); + } +} diff --git a/src/Models/UnifiSite.php b/src/Models/UnifiSite.php new file mode 100644 index 0000000..1a13032 --- /dev/null +++ b/src/Models/UnifiSite.php @@ -0,0 +1,15 @@ +