Example #1
0
 /**
  * Uses the container to resolve arguments
  *
  * @param  array $args
  *
  * @return array
  */
 function resolveArguments(array $args)
 {
     $resolved = [];
     foreach ($args as $arg) {
         $resolved[] = is_string($arg) && ($this->di->has($arg) || $this->di->isSingleton($arg) || class_exists($arg)) ? $this->di->get($arg) : $arg;
     }
     return $resolved;
 }
Example #2
0
 /**
  * Middleware constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->forge = Forge::getInstance();
     $this->events = $this->forge->make(Events::class);
 }