/**
  * Resolve the subscriber instance.
  *
  * @param  mixed  $subscriber
  * @return mixed
  */
 protected function resolveSubscriber($subscriber)
 {
     if (is_string($subscriber)) {
         return $this->container->make($subscriber);
     }
     return $subscriber;
 }
 /**
  * Fire the job.
  *
  * @return void
  */
 public function fire()
 {
     $payload = unserialize($this->job->getData());
     // Once we have the message payload, we can create the given class and fire
     // it off with the given data. The data is in the messages serialized so
     // we will unserialize it and pass into the jobs in its original form.
     $this->instance = $this->container->make($payload['job']);
     $this->instance->fire($this, $payload['data']);
 }
 /**
  * Get a callable array for a class based filter.
  *
  * @param  string  $filter
  * @return array
  */
 protected function getClassBasedFilter($filter)
 {
     if (str_contains($filter, '@')) {
         list($class, $method) = explode('@', $filter);
         return array($this->container->make($class), $method);
     }
     return array($this->container->make($filter), 'filter');
 }
Exemple #4
0
 /**
  * Closes a form
  *
  * @return string A form closing tag
  */
 public function close()
 {
     if ($this->app->bound('former.form')) {
         $closing = $this->app['former.form']->close();
     }
     // Destroy instances
     $instances = array('former.form', 'former.form.framework');
     foreach ($instances as $instance) {
         $this->app[$instance] = null;
         unset($this->app[$instance]);
     }
     // Reset populator
     $this->app['former.populator']->reset();
     // Reset all values
     $this->errors = null;
     $this->rules = null;
     return isset($closing) ? $closing : null;
 }
 /**
  * Fire the job.
  *
  * @return void
  */
 public function fire()
 {
     $this->instance = $this->container->make($this->job);
     $this->instance->fire($this, $this->data);
 }