diff --git a/app/Http/Controllers/WelcomeController.php b/app/Http/Controllers/WelcomeController.php index 832f240..f8b2cae 100644 --- a/app/Http/Controllers/WelcomeController.php +++ b/app/Http/Controllers/WelcomeController.php @@ -19,19 +19,26 @@ public function index() // Ambil data dari Firebase $dht11 = $this->database->getReference('dht11')->getValue() ?? []; $security = $this->database->getReference('security')->getValue() ?? []; + $smartcab = $this->database->getReference('smartcab')->getValue() ?? []; // Ambil nilai spesifik $humidity = $dht11['humidity'] ?? 'N/A'; $temperature = $dht11['temperature'] ?? 'N/A'; $motion = $security['motion'] ?? 'N/A'; $status = $security['status'] ?? 'N/A'; + $last_access = $smartcab['last_access'] ?? 'N/A'; + $status_device = $smartcab['status_device'] ?? 'N/A'; + $servo_status = $smartcab['servo_status'] ?? 'N/A'; // Kirim data ke tampilan return view('welcome', compact( 'humidity', 'temperature', 'motion', - 'status' + 'status', + 'last_access', + 'status_device', + 'servo_status' )); } } diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 0bac187..fe7be1d 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -191,8 +191,8 @@ class="p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-
Door Status
-Locked
+{{ $servo_status }}
Last Access
-Dikenali
+{{ $last_access }}
Device Status
-Online
+{{ $status_device }}