title: Passing array variable from event handler class to controller in laravel
body: <p>I created event handler class in </p>
  
  <pre><code>   App\Events\Roomallocwithproperties(Event file)
     App\Handlers\Events\Allocofroomprop(Handler file)
  </code></pre>
  
  <p>In laravel 5,I Passed two variable from Controller and get that variable with the help of constructor inside Event file, as</p>
  
  <pre><code>  public function__construct($a,$b) {
         $this-&gt;a=$a;
           $this-&gt;b=$b;
                        }
  </code></pre>
  
  <p>This value I accessed in Handler file inside handl function such as</p>
  
  <pre><code>public function handle(Roomallocwithproperties $event)
   {
   $c= $event-&gt;a + $event-&gt;b;
  
   return $c;
   }
  </code></pre>
  
  <p>In the Eventservice provider file</p>
  
  <pre><code>protected $listen = [
      'event.name' =&gt; [
          'EventListener',
      ],
      'App\Events\Roomallocwithproperties'=&gt;[
          'App\Handlers\Events\Allocofroomprop', 
  
          ],
  ];
  </code></pre>
  
  <p>And I fire the Events from Controller such as</p>
  
  <pre><code>       $result= Event::fire(new Roomallocwithproperties($val1,$val2));
  
         dd($result);
  </code></pre>
  
  <p>My problem is that I want to return the value $c to again my controller. The reason I use event is I fired the event from foreach every iteration,And again return the value inside it.
  <strong>How to return the variable $c to controller function , How to receive the value inside that controller function !</strong><br>
  Thanks for all replies !</p>