public function financeMemberCanVisitPaymentPage(FunctionalTester $I)
 {
     $I->am('a member of the finance group');
     $I->wantTo('make sure I can view the payments page');
     //Load and login a known member
     $user = User::find(3);
     $role = Role::findByName('finance');
     $role->users()->attach($user->id);
     Auth::login($user);
     $I->amOnPage('/payments');
     $I->seeCurrentUrlEquals('/payments');
     $I->see('Payments');
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     foreach ($this->acsNodeRepository->getAll() as $device) {
         $this->info('Checking device ' . $device->name);
         /** @var $device \BB\Entities\ACSNode */
         if ($device->heartbeatWarning()) {
             $this->warn('Heartbeat warning');
             //There is a warning with the device, see if people have been notified
             $notificationHash = $device->device_id . md5($device->last_heartbeat->timestamp);
             $message = 'Nothing has been heard from device "' . $device->name . '"" in a while. ';
             $message .= 'The last update was ' . \Carbon\Carbon::now()->diffForHumans($device->last_heartbeat, true) . ' ago.';
             $role = Role::findByName('acs');
             foreach ($role->users()->get() as $user) {
                 $this->info('  Notifying ' . $user->name);
                 Notification::logNew($user->id, $message, 'device_contact', $notificationHash);
             }
         }
     }
 }
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Role::where('name', 'infra')->delete();
     Role::findByName('acs')->update(['name' => 'infra', 'title' => 'Infrastructure', 'description' => 'Access control systems and all things RFID']);
 }