예제 #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $lights = HouseLight::all();
     foreach ($lights as $light) {
         $job = new TurnLightOff($light->light_id);
         $this->dispatch($job);
     }
 }
예제 #2
0
 /**
  * Turn off all lights after test.
  * TODO: It'd be nice to save a pre-test state and return to that.
  */
 public function tearDown()
 {
     $lights = HouseLight::all();
     foreach ($lights as $light) {
         $job = new TurnLightOff($light->light_id);
     }
     $this->dispatch($job);
     parent::tearDown();
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $lights = HouseLight::all();
     $settings = LightSetting::all();
     return view('home', compact('lights', 'settings'));
 }