';
+ }
+
+ /**
+ * Get HTML wrapper for disabled text.
+ *
+ * @param string $text
+ * @return string
+ */
+ protected function getDisabledTextWrapper($text)
+ {
+ return '
'.$text.'
';
+ }
+
+ /**
+ * Get HTML wrapper for active text.
+ *
+ * @param string $text
+ * @return string
+ */
+ protected function getActivePageWrapper($text)
+ {
+ return '
'.$text.'
';
+ }
+
+ /**
+ * Get a pagination "dot" element.
+ *
+ * @return string
+ */
+ protected function getDots()
+ {
+ return $this->getDisabledTextWrapper('...');
+ }
+
+ /**
+ * Get the current page from the paginator.
+ *
+ * @return int
+ */
+ protected function currentPage()
+ {
+ return $this->paginator->currentPage();
+ }
+
+ /**
+ * Get the last page from the paginator.
+ *
+ * @return int
+ */
+ protected function lastPage()
+ {
+ return $this->paginator->lastPage();
+ }
+}
diff --git a/vendor/illuminate/pagination/LengthAwarePaginator.php b/vendor/illuminate/pagination/LengthAwarePaginator.php
new file mode 100644
index 00000000..8c562e16
--- /dev/null
+++ b/vendor/illuminate/pagination/LengthAwarePaginator.php
@@ -0,0 +1,164 @@
+ $value) {
+ $this->{$key} = $value;
+ }
+
+ $this->total = $total;
+ $this->perPage = $perPage;
+ $this->lastPage = (int) ceil($total / $perPage);
+ $this->path = $this->path != '/' ? rtrim($this->path, '/') : $this->path;
+ $this->currentPage = $this->setCurrentPage($currentPage, $this->lastPage);
+ $this->items = $items instanceof Collection ? $items : Collection::make($items);
+ }
+
+ /**
+ * Get the current page for the request.
+ *
+ * @param int $currentPage
+ * @param int $lastPage
+ * @return int
+ */
+ protected function setCurrentPage($currentPage, $lastPage)
+ {
+ $currentPage = $currentPage ?: static::resolveCurrentPage();
+
+ // The page number will get validated and adjusted if it either less than one
+ // or greater than the last page available based on the count of the given
+ // items array. If it's greater than the last, we'll give back the last.
+ if (is_numeric($currentPage) && $currentPage > $lastPage) {
+ return $lastPage > 0 ? $lastPage : 1;
+ }
+
+ return $this->isValidPageNumber($currentPage) ? (int) $currentPage : 1;
+ }
+
+ /**
+ * Get the URL for the next page.
+ *
+ * @return string|null
+ */
+ public function nextPageUrl()
+ {
+ if ($this->lastPage() > $this->currentPage()) {
+ return $this->url($this->currentPage() + 1);
+ }
+ }
+
+ /**
+ * Determine if there are more items in the data source.
+ *
+ * @return bool
+ */
+ public function hasMorePages()
+ {
+ return $this->currentPage() < $this->lastPage();
+ }
+
+ /**
+ * Get the total number of items being paginated.
+ *
+ * @return int
+ */
+ public function total()
+ {
+ return $this->total;
+ }
+
+ /**
+ * Get the last page.
+ *
+ * @return int
+ */
+ public function lastPage()
+ {
+ return $this->lastPage;
+ }
+
+ /**
+ * Render the paginator using the given presenter.
+ *
+ * @param \Illuminate\Contracts\Pagination\Presenter|null $presenter
+ * @return string
+ */
+ public function render(Presenter $presenter = null)
+ {
+ if (is_null($presenter) && static::$presenterResolver) {
+ $presenter = call_user_func(static::$presenterResolver, $this);
+ }
+
+ $presenter = $presenter ?: new BootstrapThreePresenter($this);
+
+ return $presenter->render();
+ }
+
+ /**
+ * Get the instance as an array.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return [
+ 'total' => $this->total(),
+ 'per_page' => $this->perPage(),
+ 'current_page' => $this->currentPage(),
+ 'last_page' => $this->lastPage(),
+ 'next_page_url' => $this->nextPageUrl(),
+ 'prev_page_url' => $this->previousPageUrl(),
+ 'from' => $this->firstItem(),
+ 'to' => $this->lastItem(),
+ 'data' => $this->items->toArray(),
+ ];
+ }
+
+ /**
+ * Convert the object to its JSON representation.
+ *
+ * @param int $options
+ * @return string
+ */
+ public function toJson($options = 0)
+ {
+ return json_encode($this->toArray(), $options);
+ }
+}
diff --git a/vendor/illuminate/pagination/PaginationServiceProvider.php b/vendor/illuminate/pagination/PaginationServiceProvider.php
new file mode 100644
index 00000000..48d3e2c4
--- /dev/null
+++ b/vendor/illuminate/pagination/PaginationServiceProvider.php
@@ -0,0 +1,30 @@
+app['request']->url();
+ });
+
+ Paginator::currentPageResolver(function ($pageName = 'page') {
+ $page = $this->app['request']->input($pageName);
+
+ if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) {
+ return $page;
+ }
+
+ return 1;
+ });
+ }
+}
diff --git a/vendor/illuminate/pagination/Paginator.php b/vendor/illuminate/pagination/Paginator.php
new file mode 100644
index 00000000..6229f06f
--- /dev/null
+++ b/vendor/illuminate/pagination/Paginator.php
@@ -0,0 +1,135 @@
+ $value) {
+ $this->{$key} = $value;
+ }
+
+ $this->perPage = $perPage;
+ $this->currentPage = $this->setCurrentPage($currentPage);
+ $this->path = $this->path != '/' ? rtrim($this->path, '/') : $this->path;
+ $this->items = $items instanceof Collection ? $items : Collection::make($items);
+
+ $this->checkForMorePages();
+ }
+
+ /**
+ * Get the current page for the request.
+ *
+ * @param int $currentPage
+ * @return int
+ */
+ protected function setCurrentPage($currentPage)
+ {
+ $currentPage = $currentPage ?: static::resolveCurrentPage();
+
+ return $this->isValidPageNumber($currentPage) ? (int) $currentPage : 1;
+ }
+
+ /**
+ * Check for more pages. The last item will be sliced off.
+ *
+ * @return void
+ */
+ protected function checkForMorePages()
+ {
+ $this->hasMore = count($this->items) > ($this->perPage);
+
+ $this->items = $this->items->slice(0, $this->perPage);
+ }
+
+ /**
+ * Get the URL for the next page.
+ *
+ * @return string|null
+ */
+ public function nextPageUrl()
+ {
+ if ($this->hasMore) {
+ return $this->url($this->currentPage() + 1);
+ }
+ }
+
+ /**
+ * Determine if there are more items in the data source.
+ *
+ * @return bool
+ */
+ public function hasMorePages()
+ {
+ return $this->hasMore;
+ }
+
+ /**
+ * Render the paginator using the given presenter.
+ *
+ * @param \Illuminate\Contracts\Pagination\Presenter|null $presenter
+ * @return string
+ */
+ public function render(Presenter $presenter = null)
+ {
+ if (is_null($presenter) && static::$presenterResolver) {
+ $presenter = call_user_func(static::$presenterResolver, $this);
+ }
+
+ $presenter = $presenter ?: new SimpleBootstrapThreePresenter($this);
+
+ return $presenter->render();
+ }
+
+ /**
+ * Get the instance as an array.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return [
+ 'per_page' => $this->perPage(), 'current_page' => $this->currentPage(),
+ 'next_page_url' => $this->nextPageUrl(), 'prev_page_url' => $this->previousPageUrl(),
+ 'from' => $this->firstItem(), 'to' => $this->lastItem(),
+ 'data' => $this->items->toArray(),
+ ];
+ }
+
+ /**
+ * Convert the object to its JSON representation.
+ *
+ * @param int $options
+ * @return string
+ */
+ public function toJson($options = 0)
+ {
+ return json_encode($this->toArray(), $options);
+ }
+}
diff --git a/vendor/illuminate/pagination/SimpleBootstrapThreePresenter.php b/vendor/illuminate/pagination/SimpleBootstrapThreePresenter.php
new file mode 100644
index 00000000..bbb2790e
--- /dev/null
+++ b/vendor/illuminate/pagination/SimpleBootstrapThreePresenter.php
@@ -0,0 +1,47 @@
+paginator = $paginator;
+ }
+
+ /**
+ * Determine if the underlying paginator being presented has pages to show.
+ *
+ * @return bool
+ */
+ public function hasPages()
+ {
+ return $this->paginator->hasPages() && count($this->paginator->items()) > 0;
+ }
+
+ /**
+ * Convert the URL window into Bootstrap HTML.
+ *
+ * @return string
+ */
+ public function render()
+ {
+ if ($this->hasPages()) {
+ return sprintf(
+ '
%s %s
',
+ $this->getPreviousButton(),
+ $this->getNextButton()
+ );
+ }
+
+ return '';
+ }
+}
diff --git a/vendor/illuminate/pagination/UrlWindow.php b/vendor/illuminate/pagination/UrlWindow.php
new file mode 100644
index 00000000..655f646d
--- /dev/null
+++ b/vendor/illuminate/pagination/UrlWindow.php
@@ -0,0 +1,222 @@
+paginator = $paginator;
+ }
+
+ /**
+ * Create a new URL window instance.
+ *
+ * @param \Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator
+ * @param int $onEachSide
+ * @return array
+ */
+ public static function make(PaginatorContract $paginator, $onEachSide = 3)
+ {
+ return (new static($paginator))->get($onEachSide);
+ }
+
+ /**
+ * Get the window of URLs to be shown.
+ *
+ * @param int $onEachSide
+ * @return array
+ */
+ public function get($onEachSide = 3)
+ {
+ if ($this->paginator->lastPage() < ($onEachSide * 2) + 6) {
+ return $this->getSmallSlider();
+ }
+
+ return $this->getUrlSlider($onEachSide);
+ }
+
+ /**
+ * Get the slider of URLs there are not enough pages to slide.
+ *
+ * @return array
+ */
+ protected function getSmallSlider()
+ {
+ return [
+ 'first' => $this->paginator->getUrlRange(1, $this->lastPage()),
+ 'slider' => null,
+ 'last' => null,
+ ];
+ }
+
+ /**
+ * Create a URL slider links.
+ *
+ * @param int $onEachSide
+ * @return array
+ */
+ protected function getUrlSlider($onEachSide)
+ {
+ $window = $onEachSide * 2;
+
+ if (! $this->hasPages()) {
+ return [
+ 'first' => null,
+ 'slider' => null,
+ 'last' => null,
+ ];
+ }
+
+ // If the current page is very close to the beginning of the page range, we will
+ // just render the beginning of the page range, followed by the last 2 of the
+ // links in this list, since we will not have room to create a full slider.
+ if ($this->currentPage() <= $window) {
+ return $this->getSliderTooCloseToBeginning($window);
+ }
+
+ // If the current page is close to the ending of the page range we will just get
+ // this first couple pages, followed by a larger window of these ending pages
+ // since we're too close to the end of the list to create a full on slider.
+ elseif ($this->currentPage() > ($this->lastPage() - $window)) {
+ return $this->getSliderTooCloseToEnding($window);
+ }
+
+ // If we have enough room on both sides of the current page to build a slider we
+ // will surround it with both the beginning and ending caps, with this window
+ // of pages in the middle providing a Google style sliding paginator setup.
+ return $this->getFullSlider($onEachSide);
+ }
+
+ /**
+ * Get the slider of URLs when too close to beginning of window.
+ *
+ * @param int $window
+ * @return array
+ */
+ protected function getSliderTooCloseToBeginning($window)
+ {
+ return [
+ 'first' => $this->paginator->getUrlRange(1, $window + 2),
+ 'slider' => null,
+ 'last' => $this->getFinish(),
+ ];
+ }
+
+ /**
+ * Get the slider of URLs when too close to ending of window.
+ *
+ * @param int $window
+ * @return array
+ */
+ protected function getSliderTooCloseToEnding($window)
+ {
+ $last = $this->paginator->getUrlRange(
+ $this->lastPage() - ($window + 2),
+ $this->lastPage()
+ );
+
+ return [
+ 'first' => $this->getStart(),
+ 'slider' => null,
+ 'last' => $last,
+ ];
+ }
+
+ /**
+ * Get the slider of URLs when a full slider can be made.
+ *
+ * @param int $onEachSide
+ * @return array
+ */
+ protected function getFullSlider($onEachSide)
+ {
+ return [
+ 'first' => $this->getStart(),
+ 'slider' => $this->getAdjacentUrlRange($onEachSide),
+ 'last' => $this->getFinish(),
+ ];
+ }
+
+ /**
+ * Get the page range for the current page window.
+ *
+ * @param int $onEachSide
+ * @return array
+ */
+ public function getAdjacentUrlRange($onEachSide)
+ {
+ return $this->paginator->getUrlRange(
+ $this->currentPage() - $onEachSide,
+ $this->currentPage() + $onEachSide
+ );
+ }
+
+ /**
+ * Get the starting URLs of a pagination slider.
+ *
+ * @return array
+ */
+ public function getStart()
+ {
+ return $this->paginator->getUrlRange(1, 2);
+ }
+
+ /**
+ * Get the ending URLs of a pagination slider.
+ *
+ * @return array
+ */
+ public function getFinish()
+ {
+ return $this->paginator->getUrlRange(
+ $this->lastPage() - 1,
+ $this->lastPage()
+ );
+ }
+
+ /**
+ * Determine if the underlying paginator being presented has pages to show.
+ *
+ * @return bool
+ */
+ public function hasPages()
+ {
+ return $this->paginator->lastPage() > 1;
+ }
+
+ /**
+ * Get the current page from the paginator.
+ *
+ * @return int
+ */
+ protected function currentPage()
+ {
+ return $this->paginator->currentPage();
+ }
+
+ /**
+ * Get the last page from the paginator.
+ *
+ * @return int
+ */
+ protected function lastPage()
+ {
+ return $this->paginator->lastPage();
+ }
+}
diff --git a/vendor/illuminate/pagination/UrlWindowPresenterTrait.php b/vendor/illuminate/pagination/UrlWindowPresenterTrait.php
new file mode 100644
index 00000000..64a33977
--- /dev/null
+++ b/vendor/illuminate/pagination/UrlWindowPresenterTrait.php
@@ -0,0 +1,66 @@
+window['first'])) {
+ $html .= $this->getUrlLinks($this->window['first']);
+ }
+
+ if (is_array($this->window['slider'])) {
+ $html .= $this->getDots();
+ $html .= $this->getUrlLinks($this->window['slider']);
+ }
+
+ if (is_array($this->window['last'])) {
+ $html .= $this->getDots();
+ $html .= $this->getUrlLinks($this->window['last']);
+ }
+
+ return $html;
+ }
+
+ /**
+ * Get the links for the URLs in the given array.
+ *
+ * @param array $urls
+ * @return string
+ */
+ protected function getUrlLinks(array $urls)
+ {
+ $html = '';
+
+ foreach ($urls as $page => $url) {
+ $html .= $this->getPageLinkWrapper($url, $page);
+ }
+
+ return $html;
+ }
+
+ /**
+ * Get HTML wrapper for a page link.
+ *
+ * @param string $url
+ * @param int $page
+ * @param string|null $rel
+ * @return string
+ */
+ protected function getPageLinkWrapper($url, $page, $rel = null)
+ {
+ if ($page == $this->paginator->currentPage()) {
+ return $this->getActivePageWrapper($page);
+ }
+
+ return $this->getAvailablePageWrapper($url, $page, $rel);
+ }
+}
diff --git a/vendor/illuminate/pagination/composer.json b/vendor/illuminate/pagination/composer.json
new file mode 100644
index 00000000..871c66ec
--- /dev/null
+++ b/vendor/illuminate/pagination/composer.json
@@ -0,0 +1,32 @@
+{
+ "name": "illuminate/pagination",
+ "description": "The Illuminate Pagination package.",
+ "license": "MIT",
+ "homepage": "http://laravel.com",
+ "support": {
+ "issues": "https://github.com/laravel/framework/issues",
+ "source": "https://github.com/laravel/framework"
+ },
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylorotwell@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.5.9",
+ "illuminate/contracts": "5.1.*",
+ "illuminate/support": "5.1.*"
+ },
+ "autoload": {
+ "psr-4": {
+ "Illuminate\\Pagination\\": ""
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/illuminate/pipeline/Hub.php b/vendor/illuminate/pipeline/Hub.php
new file mode 100644
index 00000000..ed48df45
--- /dev/null
+++ b/vendor/illuminate/pipeline/Hub.php
@@ -0,0 +1,74 @@
+container = $container;
+ }
+
+ /**
+ * Define the default named pipeline.
+ *
+ * @param \Closure $callback
+ * @return void
+ */
+ public function defaults(Closure $callback)
+ {
+ return $this->pipeline('default', $callback);
+ }
+
+ /**
+ * Define a new named pipeline.
+ *
+ * @param string $name
+ * @param \Closure $callback
+ * @return void
+ */
+ public function pipeline($name, Closure $callback)
+ {
+ $this->pipelines[$name] = $callback;
+ }
+
+ /**
+ * Send an object through one of the available pipelines.
+ *
+ * @param mixed $object
+ * @param string|null $pipeline
+ * @return mixed
+ */
+ public function pipe($object, $pipeline = null)
+ {
+ $pipeline = $pipeline ?: 'default';
+
+ return call_user_func(
+ $this->pipelines[$pipeline], new Pipeline($this->container), $object
+ );
+ }
+}
diff --git a/vendor/illuminate/pipeline/Pipeline.php b/vendor/illuminate/pipeline/Pipeline.php
new file mode 100644
index 00000000..12aa6d71
--- /dev/null
+++ b/vendor/illuminate/pipeline/Pipeline.php
@@ -0,0 +1,159 @@
+container = $container;
+ }
+
+ /**
+ * Set the object being sent through the pipeline.
+ *
+ * @param mixed $passable
+ * @return $this
+ */
+ public function send($passable)
+ {
+ $this->passable = $passable;
+
+ return $this;
+ }
+
+ /**
+ * Set the array of pipes.
+ *
+ * @param array|mixed $pipes
+ * @return $this
+ */
+ public function through($pipes)
+ {
+ $this->pipes = is_array($pipes) ? $pipes : func_get_args();
+
+ return $this;
+ }
+
+ /**
+ * Set the method to call on the pipes.
+ *
+ * @param string $method
+ * @return $this
+ */
+ public function via($method)
+ {
+ $this->method = $method;
+
+ return $this;
+ }
+
+ /**
+ * Run the pipeline with a final destination callback.
+ *
+ * @param \Closure $destination
+ * @return mixed
+ */
+ public function then(Closure $destination)
+ {
+ $firstSlice = $this->getInitialSlice($destination);
+
+ $pipes = array_reverse($this->pipes);
+
+ return call_user_func(
+ array_reduce($pipes, $this->getSlice(), $firstSlice), $this->passable
+ );
+ }
+
+ /**
+ * Get a Closure that represents a slice of the application onion.
+ *
+ * @return \Closure
+ */
+ protected function getSlice()
+ {
+ return function ($stack, $pipe) {
+ return function ($passable) use ($stack, $pipe) {
+ // If the pipe is an instance of a Closure, we will just call it directly but
+ // otherwise we'll resolve the pipes out of the container and call it with
+ // the appropriate method and arguments, returning the results back out.
+ if ($pipe instanceof Closure) {
+ return call_user_func($pipe, $passable, $stack);
+ } else {
+ list($name, $parameters) = $this->parsePipeString($pipe);
+
+ return call_user_func_array([$this->container->make($name), $this->method],
+ array_merge([$passable, $stack], $parameters));
+ }
+ };
+ };
+ }
+
+ /**
+ * Get the initial slice to begin the stack call.
+ *
+ * @param \Closure $destination
+ * @return \Closure
+ */
+ protected function getInitialSlice(Closure $destination)
+ {
+ return function ($passable) use ($destination) {
+ return call_user_func($destination, $passable);
+ };
+ }
+
+ /**
+ * Parse full pipe string to get name and parameters.
+ *
+ * @param string $pipe
+ * @return array
+ */
+ protected function parsePipeString($pipe)
+ {
+ list($name, $parameters) = array_pad(explode(':', $pipe, 2), 2, []);
+
+ if (is_string($parameters)) {
+ $parameters = explode(',', $parameters);
+ }
+
+ return [$name, $parameters];
+ }
+}
diff --git a/vendor/illuminate/pipeline/PipelineServiceProvider.php b/vendor/illuminate/pipeline/PipelineServiceProvider.php
new file mode 100644
index 00000000..aceaddf2
--- /dev/null
+++ b/vendor/illuminate/pipeline/PipelineServiceProvider.php
@@ -0,0 +1,39 @@
+app->singleton(
+ 'Illuminate\Contracts\Pipeline\Hub', 'Illuminate\Pipeline\Hub'
+ );
+ }
+
+ /**
+ * Get the services provided by the provider.
+ *
+ * @return array
+ */
+ public function provides()
+ {
+ return [
+ 'Illuminate\Contracts\Pipeline\Hub',
+ ];
+ }
+}
diff --git a/vendor/illuminate/pipeline/composer.json b/vendor/illuminate/pipeline/composer.json
new file mode 100644
index 00000000..85b07349
--- /dev/null
+++ b/vendor/illuminate/pipeline/composer.json
@@ -0,0 +1,32 @@
+{
+ "name": "illuminate/pipeline",
+ "description": "The Illuminate Pipeline package.",
+ "license": "MIT",
+ "homepage": "http://laravel.com",
+ "support": {
+ "issues": "https://github.com/laravel/framework/issues",
+ "source": "https://github.com/laravel/framework"
+ },
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylorotwell@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.5.9",
+ "illuminate/contracts": "5.1.*",
+ "illuminate/support": "5.1.*"
+ },
+ "autoload": {
+ "psr-4": {
+ "Illuminate\\Pipeline\\": ""
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/illuminate/queue/BeanstalkdQueue.php b/vendor/illuminate/queue/BeanstalkdQueue.php
new file mode 100644
index 00000000..ad090acd
--- /dev/null
+++ b/vendor/illuminate/queue/BeanstalkdQueue.php
@@ -0,0 +1,143 @@
+default = $default;
+ $this->timeToRun = $timeToRun;
+ $this->pheanstalk = $pheanstalk;
+ }
+
+ /**
+ * Push a new job onto the queue.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function push($job, $data = '', $queue = null)
+ {
+ return $this->pushRaw($this->createPayload($job, $data), $queue);
+ }
+
+ /**
+ * Push a raw payload onto the queue.
+ *
+ * @param string $payload
+ * @param string $queue
+ * @param array $options
+ * @return mixed
+ */
+ public function pushRaw($payload, $queue = null, array $options = [])
+ {
+ return $this->pheanstalk->useTube($this->getQueue($queue))->put(
+ $payload, Pheanstalk::DEFAULT_PRIORITY, Pheanstalk::DEFAULT_DELAY, $this->timeToRun
+ );
+ }
+
+ /**
+ * Push a new job onto the queue after a delay.
+ *
+ * @param \DateTime|int $delay
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function later($delay, $job, $data = '', $queue = null)
+ {
+ $payload = $this->createPayload($job, $data);
+
+ $pheanstalk = $this->pheanstalk->useTube($this->getQueue($queue));
+
+ return $pheanstalk->put($payload, Pheanstalk::DEFAULT_PRIORITY, $this->getSeconds($delay), $this->timeToRun);
+ }
+
+ /**
+ * Pop the next job off of the queue.
+ *
+ * @param string $queue
+ * @return \Illuminate\Contracts\Queue\Job|null
+ */
+ public function pop($queue = null)
+ {
+ $queue = $this->getQueue($queue);
+
+ $job = $this->pheanstalk->watchOnly($queue)->reserve(0);
+
+ if ($job instanceof PheanstalkJob) {
+ return new BeanstalkdJob($this->container, $this->pheanstalk, $job, $queue);
+ }
+ }
+
+ /**
+ * Delete a message from the Beanstalk queue.
+ *
+ * @param string $queue
+ * @param string $id
+ * @return void
+ */
+ public function deleteMessage($queue, $id)
+ {
+ $this->pheanstalk->useTube($this->getQueue($queue))->delete($id);
+ }
+
+ /**
+ * Get the queue or return the default.
+ *
+ * @param string|null $queue
+ * @return string
+ */
+ public function getQueue($queue)
+ {
+ return $queue ?: $this->default;
+ }
+
+ /**
+ * Get the underlying Pheanstalk instance.
+ *
+ * @return \Pheanstalk\Pheanstalk
+ */
+ public function getPheanstalk()
+ {
+ return $this->pheanstalk;
+ }
+}
diff --git a/vendor/illuminate/queue/CallQueuedHandler.php b/vendor/illuminate/queue/CallQueuedHandler.php
new file mode 100644
index 00000000..dc16c88b
--- /dev/null
+++ b/vendor/illuminate/queue/CallQueuedHandler.php
@@ -0,0 +1,80 @@
+dispatcher = $dispatcher;
+ }
+
+ /**
+ * Handle the queued job.
+ *
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @param array $data
+ * @return void
+ */
+ public function call(Job $job, array $data)
+ {
+ $command = $this->setJobInstanceIfNecessary(
+ $job, unserialize($data['command'])
+ );
+
+ $this->dispatcher->dispatchNow($command, function ($handler) use ($job) {
+ $this->setJobInstanceIfNecessary($job, $handler);
+ });
+
+ if (! $job->isDeletedOrReleased()) {
+ $job->delete();
+ }
+ }
+
+ /**
+ * Set the job instance of the given class if necessary.
+ *
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @param mixed $instance
+ * @return mixed
+ */
+ protected function setJobInstanceIfNecessary(Job $job, $instance)
+ {
+ if (in_array('Illuminate\Queue\InteractsWithQueue', class_uses_recursive(get_class($instance)))) {
+ $instance->setJob($job);
+ }
+
+ return $instance;
+ }
+
+ /**
+ * Call the failed method on the job instance.
+ *
+ * @param array $data
+ * @return void
+ */
+ public function failed(array $data)
+ {
+ $handler = $this->dispatcher->resolveHandler($command = unserialize($data['command']));
+
+ if (method_exists($handler, 'failed')) {
+ call_user_func([$handler, 'failed'], $command);
+ }
+ }
+}
diff --git a/vendor/illuminate/queue/Capsule/Manager.php b/vendor/illuminate/queue/Capsule/Manager.php
new file mode 100644
index 00000000..179be60e
--- /dev/null
+++ b/vendor/illuminate/queue/Capsule/Manager.php
@@ -0,0 +1,183 @@
+setupContainer($container ?: new Container);
+
+ // Once we have the container setup, we will setup the default configuration
+ // options in the container "config" bindings. This just makes this queue
+ // manager behave correctly since all the correct binding are in place.
+ $this->setupDefaultConfiguration();
+
+ $this->setupManager();
+
+ $this->registerConnectors();
+ }
+
+ /**
+ * Setup the default queue configuration options.
+ *
+ * @return void
+ */
+ protected function setupDefaultConfiguration()
+ {
+ $this->container['config']['queue.default'] = 'default';
+ }
+
+ /**
+ * Build the queue manager instance.
+ *
+ * @return void
+ */
+ protected function setupManager()
+ {
+ $this->manager = new QueueManager($this->container);
+ }
+
+ /**
+ * Register the default connectors that the component ships with.
+ *
+ * @return void
+ */
+ protected function registerConnectors()
+ {
+ $provider = new QueueServiceProvider($this->container);
+
+ $provider->registerConnectors($this->manager);
+ }
+
+ /**
+ * Get a connection instance from the global manager.
+ *
+ * @param string $connection
+ * @return \Illuminate\Contracts\Queue\Queue
+ */
+ public static function connection($connection = null)
+ {
+ return static::$instance->getConnection($connection);
+ }
+
+ /**
+ * Push a new job onto the queue.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @param string $connection
+ * @return mixed
+ */
+ public static function push($job, $data = '', $queue = null, $connection = null)
+ {
+ return static::$instance->connection($connection)->push($job, $data, $queue);
+ }
+
+ /**
+ * Push a new an array of jobs onto the queue.
+ *
+ * @param array $jobs
+ * @param mixed $data
+ * @param string $queue
+ * @param string $connection
+ * @return mixed
+ */
+ public static function bulk($jobs, $data = '', $queue = null, $connection = null)
+ {
+ return static::$instance->connection($connection)->bulk($jobs, $data, $queue);
+ }
+
+ /**
+ * Push a new job onto the queue after a delay.
+ *
+ * @param \DateTime|int $delay
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @param string $connection
+ * @return mixed
+ */
+ public static function later($delay, $job, $data = '', $queue = null, $connection = null)
+ {
+ return static::$instance->connection($connection)->later($delay, $job, $data, $queue);
+ }
+
+ /**
+ * Get a registered connection instance.
+ *
+ * @param string $name
+ * @return \Illuminate\Contracts\Queue\Queue
+ */
+ public function getConnection($name = null)
+ {
+ return $this->manager->connection($name);
+ }
+
+ /**
+ * Register a connection with the manager.
+ *
+ * @param array $config
+ * @param string $name
+ * @return void
+ */
+ public function addConnection(array $config, $name = 'default')
+ {
+ $this->container['config']["queue.connections.{$name}"] = $config;
+ }
+
+ /**
+ * Get the queue manager instance.
+ *
+ * @return \Illuminate\Queue\QueueManager
+ */
+ public function getQueueManager()
+ {
+ return $this->manager;
+ }
+
+ /**
+ * Pass dynamic instance methods to the manager.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return mixed
+ */
+ public function __call($method, $parameters)
+ {
+ return call_user_func_array([$this->manager, $method], $parameters);
+ }
+
+ /**
+ * Dynamically pass methods to the default connection.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return mixed
+ */
+ public static function __callStatic($method, $parameters)
+ {
+ return call_user_func_array([static::connection(), $method], $parameters);
+ }
+}
diff --git a/vendor/illuminate/queue/Connectors/BeanstalkdConnector.php b/vendor/illuminate/queue/Connectors/BeanstalkdConnector.php
new file mode 100644
index 00000000..1087415d
--- /dev/null
+++ b/vendor/illuminate/queue/Connectors/BeanstalkdConnector.php
@@ -0,0 +1,26 @@
+connections = $connections;
+ }
+
+ /**
+ * Establish a queue connection.
+ *
+ * @param array $config
+ * @return \Illuminate\Contracts\Queue\Queue
+ */
+ public function connect(array $config)
+ {
+ return new DatabaseQueue(
+ $this->connections->connection(Arr::get($config, 'connection')),
+ $config['table'],
+ $config['queue'],
+ Arr::get($config, 'expire', 60)
+ );
+ }
+}
diff --git a/vendor/illuminate/queue/Connectors/IronConnector.php b/vendor/illuminate/queue/Connectors/IronConnector.php
new file mode 100644
index 00000000..d103c193
--- /dev/null
+++ b/vendor/illuminate/queue/Connectors/IronConnector.php
@@ -0,0 +1,61 @@
+crypt = $crypt;
+ $this->request = $request;
+ }
+
+ /**
+ * Establish a queue connection.
+ *
+ * @param array $config
+ * @return \Illuminate\Contracts\Queue\Queue
+ */
+ public function connect(array $config)
+ {
+ $ironConfig = ['token' => $config['token'], 'project_id' => $config['project']];
+
+ if (isset($config['host'])) {
+ $ironConfig['host'] = $config['host'];
+ }
+
+ $iron = new IronMQ($ironConfig);
+
+ if (isset($config['ssl_verifypeer'])) {
+ $iron->ssl_verifypeer = $config['ssl_verifypeer'];
+ }
+
+ return new IronQueue($iron, $this->request, $config['queue'], $config['encrypt']);
+ }
+}
diff --git a/vendor/illuminate/queue/Connectors/NullConnector.php b/vendor/illuminate/queue/Connectors/NullConnector.php
new file mode 100644
index 00000000..39de4800
--- /dev/null
+++ b/vendor/illuminate/queue/Connectors/NullConnector.php
@@ -0,0 +1,19 @@
+redis = $redis;
+ $this->connection = $connection;
+ }
+
+ /**
+ * Establish a queue connection.
+ *
+ * @param array $config
+ * @return \Illuminate\Contracts\Queue\Queue
+ */
+ public function connect(array $config)
+ {
+ $queue = new RedisQueue(
+ $this->redis, $config['queue'], Arr::get($config, 'connection', $this->connection)
+ );
+
+ $queue->setExpire(Arr::get($config, 'expire', 60));
+
+ return $queue;
+ }
+}
diff --git a/vendor/illuminate/queue/Connectors/SqsConnector.php b/vendor/illuminate/queue/Connectors/SqsConnector.php
new file mode 100644
index 00000000..4e8e5e65
--- /dev/null
+++ b/vendor/illuminate/queue/Connectors/SqsConnector.php
@@ -0,0 +1,46 @@
+getDefaultConfiguration($config);
+
+ if ($config['key'] && $config['secret']) {
+ $config['credentials'] = Arr::only($config, ['key', 'secret']);
+ }
+
+ return new SqsQueue(
+ new SqsClient($config), $config['queue'], Arr::get($config, 'prefix', '')
+ );
+ }
+
+ /**
+ * Get the default configuration for SQS.
+ *
+ * @param array $config
+ * @return array
+ */
+ protected function getDefaultConfiguration(array $config)
+ {
+ return array_merge([
+ 'version' => 'latest',
+ 'http' => [
+ 'timeout' => 60,
+ 'connect_timeout' => 60,
+ ],
+ ], $config);
+ }
+}
diff --git a/vendor/illuminate/queue/Connectors/SyncConnector.php b/vendor/illuminate/queue/Connectors/SyncConnector.php
new file mode 100644
index 00000000..4269b803
--- /dev/null
+++ b/vendor/illuminate/queue/Connectors/SyncConnector.php
@@ -0,0 +1,19 @@
+files = $files;
+ $this->composer = $composer;
+ }
+
+ /**
+ * Execute the console command.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $table = $this->laravel['config']['queue.failed.table'];
+
+ $tableClassName = Str::studly($table);
+
+ $fullPath = $this->createBaseMigration($table);
+
+ $stub = str_replace(
+ ['{{table}}', '{{tableClassName}}'], [$table, $tableClassName], $this->files->get(__DIR__.'/stubs/failed_jobs.stub')
+ );
+
+ $this->files->put($fullPath, $stub);
+
+ $this->info('Migration created successfully!');
+
+ $this->composer->dumpAutoloads();
+ }
+
+ /**
+ * Create a base migration file for the table.
+ *
+ * @param string $table
+ * @return string
+ */
+ protected function createBaseMigration($table = 'failed_jobs')
+ {
+ $name = 'create_'.$table.'_table';
+
+ $path = $this->laravel->databasePath().'/migrations';
+
+ return $this->laravel['migration.creator']->create($name, $path);
+ }
+}
diff --git a/vendor/illuminate/queue/Console/FlushFailedCommand.php b/vendor/illuminate/queue/Console/FlushFailedCommand.php
new file mode 100644
index 00000000..fc210931
--- /dev/null
+++ b/vendor/illuminate/queue/Console/FlushFailedCommand.php
@@ -0,0 +1,34 @@
+laravel['queue.failer']->flush();
+
+ $this->info('All failed jobs deleted successfully!');
+ }
+}
diff --git a/vendor/illuminate/queue/Console/ForgetFailedCommand.php b/vendor/illuminate/queue/Console/ForgetFailedCommand.php
new file mode 100644
index 00000000..2a016cf5
--- /dev/null
+++ b/vendor/illuminate/queue/Console/ForgetFailedCommand.php
@@ -0,0 +1,49 @@
+laravel['queue.failer']->forget($this->argument('id'))) {
+ $this->info('Failed job deleted successfully!');
+ } else {
+ $this->error('No failed job matches the given ID.');
+ }
+ }
+
+ /**
+ * Get the console command arguments.
+ *
+ * @return array
+ */
+ protected function getArguments()
+ {
+ return [
+ ['id', InputArgument::REQUIRED, 'The ID of the failed job'],
+ ];
+ }
+}
diff --git a/vendor/illuminate/queue/Console/ListFailedCommand.php b/vendor/illuminate/queue/Console/ListFailedCommand.php
new file mode 100644
index 00000000..27b4df7f
--- /dev/null
+++ b/vendor/illuminate/queue/Console/ListFailedCommand.php
@@ -0,0 +1,113 @@
+getFailedJobs();
+
+ if (count($jobs) == 0) {
+ return $this->info('No failed jobs!');
+ }
+
+ $this->displayFailedJobs($jobs);
+ }
+
+ /**
+ * Compile the failed jobs into a displayable format.
+ *
+ * @return array
+ */
+ protected function getFailedJobs()
+ {
+ $results = [];
+
+ foreach ($this->laravel['queue.failer']->all() as $failed) {
+ $results[] = $this->parseFailedJob((array) $failed);
+ }
+
+ return array_filter($results);
+ }
+
+ /**
+ * Parse the failed job row.
+ *
+ * @param array $failed
+ * @return array
+ */
+ protected function parseFailedJob(array $failed)
+ {
+ $row = array_values(Arr::except($failed, ['payload']));
+
+ array_splice($row, 3, 0, $this->extractJobName($failed['payload']));
+
+ return $row;
+ }
+
+ /**
+ * Extract the failed job name from payload.
+ *
+ * @param string $payload
+ * @return string|null
+ */
+ private function extractJobName($payload)
+ {
+ $payload = json_decode($payload, true);
+
+ if ($payload && (! isset($payload['data']['command']))) {
+ return Arr::get($payload, 'job');
+ }
+
+ if ($payload && isset($payload['data']['command'])) {
+ preg_match('/"([^"]+)"/', $payload['data']['command'], $matches);
+
+ if (isset($matches[1])) {
+ return $matches[1];
+ } else {
+ return Arr::get($payload, 'job');
+ }
+ }
+ }
+
+ /**
+ * Display the failed jobs in the console.
+ *
+ * @param array $jobs
+ * @return void
+ */
+ protected function displayFailedJobs(array $jobs)
+ {
+ $this->table($this->headers, $jobs);
+ }
+}
diff --git a/vendor/illuminate/queue/Console/ListenCommand.php b/vendor/illuminate/queue/Console/ListenCommand.php
new file mode 100644
index 00000000..67de1d16
--- /dev/null
+++ b/vendor/illuminate/queue/Console/ListenCommand.php
@@ -0,0 +1,144 @@
+listener = $listener;
+ }
+
+ /**
+ * Execute the console command.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $this->setListenerOptions();
+
+ $delay = $this->input->getOption('delay');
+
+ // The memory limit is the amount of memory we will allow the script to occupy
+ // before killing it and letting a process manager restart it for us, which
+ // is to protect us against any memory leaks that will be in the scripts.
+ $memory = $this->input->getOption('memory');
+
+ $connection = $this->input->getArgument('connection');
+
+ $timeout = $this->input->getOption('timeout');
+
+ // We need to get the right queue for the connection which is set in the queue
+ // configuration file for the application. We will pull it based on the set
+ // connection being run for the queue operation currently being executed.
+ $queue = $this->getQueue($connection);
+
+ $this->listener->listen(
+ $connection, $queue, $delay, $memory, $timeout
+ );
+ }
+
+ /**
+ * Get the name of the queue connection to listen on.
+ *
+ * @param string $connection
+ * @return string
+ */
+ protected function getQueue($connection)
+ {
+ if (is_null($connection)) {
+ $connection = $this->laravel['config']['queue.default'];
+ }
+
+ $queue = $this->laravel['config']->get("queue.connections.{$connection}.queue", 'default');
+
+ return $this->input->getOption('queue') ?: $queue;
+ }
+
+ /**
+ * Set the options on the queue listener.
+ *
+ * @return void
+ */
+ protected function setListenerOptions()
+ {
+ $this->listener->setEnvironment($this->laravel->environment());
+
+ $this->listener->setSleep($this->option('sleep'));
+
+ $this->listener->setMaxTries($this->option('tries'));
+
+ $this->listener->setOutputHandler(function ($type, $line) {
+ $this->output->write($line);
+ });
+ }
+
+ /**
+ * Get the console command arguments.
+ *
+ * @return array
+ */
+ protected function getArguments()
+ {
+ return [
+ ['connection', InputArgument::OPTIONAL, 'The name of connection'],
+ ];
+ }
+
+ /**
+ * Get the console command options.
+ *
+ * @return array
+ */
+ protected function getOptions()
+ {
+ return [
+ ['queue', null, InputOption::VALUE_OPTIONAL, 'The queue to listen on', null],
+
+ ['delay', null, InputOption::VALUE_OPTIONAL, 'Amount of time to delay failed jobs', 0],
+
+ ['memory', null, InputOption::VALUE_OPTIONAL, 'The memory limit in megabytes', 128],
+
+ ['timeout', null, InputOption::VALUE_OPTIONAL, 'Seconds a job may run before timing out', 60],
+
+ ['sleep', null, InputOption::VALUE_OPTIONAL, 'Seconds to wait before checking queue for jobs', 3],
+
+ ['tries', null, InputOption::VALUE_OPTIONAL, 'Number of times to attempt a job before logging it failed', 0],
+ ];
+ }
+}
diff --git a/vendor/illuminate/queue/Console/RestartCommand.php b/vendor/illuminate/queue/Console/RestartCommand.php
new file mode 100644
index 00000000..72ad27e2
--- /dev/null
+++ b/vendor/illuminate/queue/Console/RestartCommand.php
@@ -0,0 +1,34 @@
+laravel['cache']->forever('illuminate:queue:restart', time());
+
+ $this->info('Broadcasting queue restart signal.');
+ }
+}
diff --git a/vendor/illuminate/queue/Console/RetryCommand.php b/vendor/illuminate/queue/Console/RetryCommand.php
new file mode 100644
index 00000000..703c8d5d
--- /dev/null
+++ b/vendor/illuminate/queue/Console/RetryCommand.php
@@ -0,0 +1,97 @@
+argument('id');
+
+ if (count($ids) === 1 && $ids[0] === 'all') {
+ $ids = Arr::pluck($this->laravel['queue.failer']->all(), 'id');
+ }
+
+ foreach ($ids as $id) {
+ $this->retryJob($id);
+ }
+ }
+
+ /**
+ * Retry the queue job with the given ID.
+ *
+ * @param string $id
+ * @return void
+ */
+ protected function retryJob($id)
+ {
+ $failed = $this->laravel['queue.failer']->find($id);
+
+ if (! is_null($failed)) {
+ $failed = (object) $failed;
+
+ $failed->payload = $this->resetAttempts($failed->payload);
+
+ $this->laravel['queue']->connection($failed->connection)
+ ->pushRaw($failed->payload, $failed->queue);
+
+ $this->laravel['queue.failer']->forget($failed->id);
+
+ $this->info("The failed job [{$id}] has been pushed back onto the queue!");
+ } else {
+ $this->error("No failed job matches the given ID [{$id}].");
+ }
+ }
+
+ /**
+ * Reset the payload attempts.
+ *
+ * @param string $payload
+ * @return string
+ */
+ protected function resetAttempts($payload)
+ {
+ $payload = json_decode($payload, true);
+
+ if (isset($payload['attempts'])) {
+ $payload['attempts'] = 1;
+ }
+
+ return json_encode($payload);
+ }
+
+ /**
+ * Get the console command arguments.
+ *
+ * @return array
+ */
+ protected function getArguments()
+ {
+ return [
+ ['id', InputArgument::IS_ARRAY, 'The ID of the failed job'],
+ ];
+ }
+}
diff --git a/vendor/illuminate/queue/Console/SubscribeCommand.php b/vendor/illuminate/queue/Console/SubscribeCommand.php
new file mode 100644
index 00000000..48d45017
--- /dev/null
+++ b/vendor/illuminate/queue/Console/SubscribeCommand.php
@@ -0,0 +1,162 @@
+laravel['queue']->connection();
+
+ if (! $iron instanceof IronQueue) {
+ throw new RuntimeException('Iron.io based queue must be default.');
+ }
+
+ $iron->getIron()->updateQueue($this->argument('queue'), $this->getQueueOptions());
+
+ $this->line('Queue subscriber added:'.$this->argument('url').'');
+ }
+
+ /**
+ * Get the queue options.
+ *
+ * @return array
+ */
+ protected function getQueueOptions()
+ {
+ return [
+ 'push_type' => $this->getPushType(), 'subscribers' => $this->getSubscriberList(),
+ ];
+ }
+
+ /**
+ * Get the push type for the queue.
+ *
+ * @return string
+ */
+ protected function getPushType()
+ {
+ if ($this->option('type')) {
+ return $this->option('type');
+ }
+
+ try {
+ return $this->getQueue()->push_type;
+ } catch (Exception $e) {
+ return 'multicast';
+ }
+ }
+
+ /**
+ * Get the current subscribers for the queue.
+ *
+ * @return array
+ */
+ protected function getSubscriberList()
+ {
+ $subscribers = $this->getCurrentSubscribers();
+
+ $url = $this->argument('url');
+
+ if (! Str::startsWith($url, ['http://', 'https://'])) {
+ $url = $this->laravel['url']->to($url);
+ }
+
+ $subscribers[] = ['url' => $url];
+
+ return $subscribers;
+ }
+
+ /**
+ * Get the current subscriber list.
+ *
+ * @return array
+ */
+ protected function getCurrentSubscribers()
+ {
+ try {
+ return $this->getQueue()->subscribers;
+ } catch (Exception $e) {
+ return [];
+ }
+ }
+
+ /**
+ * Get the queue information from Iron.io.
+ *
+ * @return object
+ */
+ protected function getQueue()
+ {
+ if (isset($this->meta)) {
+ return $this->meta;
+ }
+
+ return $this->meta = $this->laravel['queue']->getIron()->getQueue($this->argument('queue'));
+ }
+
+ /**
+ * Get the console command arguments.
+ *
+ * @return array
+ */
+ protected function getArguments()
+ {
+ return [
+ ['queue', InputArgument::REQUIRED, 'The name of Iron.io queue.'],
+
+ ['url', InputArgument::REQUIRED, 'The URL to be subscribed.'],
+ ];
+ }
+
+ /**
+ * Get the console command options.
+ *
+ * @return array
+ */
+ protected function getOptions()
+ {
+ return [
+ ['type', null, InputOption::VALUE_OPTIONAL, 'The push type for the queue.'],
+ ];
+ }
+}
diff --git a/vendor/illuminate/queue/Console/TableCommand.php b/vendor/illuminate/queue/Console/TableCommand.php
new file mode 100644
index 00000000..f41d15c0
--- /dev/null
+++ b/vendor/illuminate/queue/Console/TableCommand.php
@@ -0,0 +1,91 @@
+files = $files;
+ $this->composer = $composer;
+ }
+
+ /**
+ * Execute the console command.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $table = $this->laravel['config']['queue.connections.database.table'];
+
+ $tableClassName = Str::studly($table);
+
+ $fullPath = $this->createBaseMigration($table);
+
+ $stub = str_replace(
+ ['{{table}}', '{{tableClassName}}'], [$table, $tableClassName], $this->files->get(__DIR__.'/stubs/jobs.stub')
+ );
+
+ $this->files->put($fullPath, $stub);
+
+ $this->info('Migration created successfully!');
+
+ $this->composer->dumpAutoloads();
+ }
+
+ /**
+ * Create a base migration file for the table.
+ *
+ * @param string $table
+ * @return string
+ */
+ protected function createBaseMigration($table = 'jobs')
+ {
+ $name = 'create_'.$table.'_table';
+
+ $path = $this->laravel->databasePath().'/migrations';
+
+ return $this->laravel['migration.creator']->create($name, $path);
+ }
+}
diff --git a/vendor/illuminate/queue/Console/WorkCommand.php b/vendor/illuminate/queue/Console/WorkCommand.php
new file mode 100644
index 00000000..1ae918f6
--- /dev/null
+++ b/vendor/illuminate/queue/Console/WorkCommand.php
@@ -0,0 +1,177 @@
+worker = $worker;
+ }
+
+ /**
+ * Execute the console command.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ if ($this->downForMaintenance() && ! $this->option('daemon')) {
+ return $this->worker->sleep($this->option('sleep'));
+ }
+
+ $queue = $this->option('queue');
+
+ $delay = $this->option('delay');
+
+ // The memory limit is the amount of memory we will allow the script to occupy
+ // before killing it and letting a process manager restart it for us, which
+ // is to protect us against any memory leaks that will be in the scripts.
+ $memory = $this->option('memory');
+
+ $connection = $this->argument('connection');
+
+ $response = $this->runWorker(
+ $connection, $queue, $delay, $memory, $this->option('daemon')
+ );
+
+ // If a job was fired by the worker, we'll write the output out to the console
+ // so that the developer can watch live while the queue runs in the console
+ // window, which will also of get logged if stdout is logged out to disk.
+ if (! is_null($response['job'])) {
+ $this->writeOutput($response['job'], $response['failed']);
+ }
+ }
+
+ /**
+ * Run the worker instance.
+ *
+ * @param string $connection
+ * @param string $queue
+ * @param int $delay
+ * @param int $memory
+ * @param bool $daemon
+ * @return array
+ */
+ protected function runWorker($connection, $queue, $delay, $memory, $daemon = false)
+ {
+ if ($daemon) {
+ $this->worker->setCache($this->laravel['cache']->driver());
+
+ $this->worker->setDaemonExceptionHandler(
+ $this->laravel['Illuminate\Contracts\Debug\ExceptionHandler']
+ );
+
+ return $this->worker->daemon(
+ $connection, $queue, $delay, $memory,
+ $this->option('sleep'), $this->option('tries')
+ );
+ }
+
+ return $this->worker->pop(
+ $connection, $queue, $delay,
+ $this->option('sleep'), $this->option('tries')
+ );
+ }
+
+ /**
+ * Write the status output for the queue worker.
+ *
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @param bool $failed
+ * @return void
+ */
+ protected function writeOutput(Job $job, $failed)
+ {
+ if ($failed) {
+ $this->output->writeln('Failed: '.$job->getName());
+ } else {
+ $this->output->writeln('Processed: '.$job->getName());
+ }
+ }
+
+ /**
+ * Determine if the worker should run in maintenance mode.
+ *
+ * @return bool
+ */
+ protected function downForMaintenance()
+ {
+ if ($this->option('force')) {
+ return false;
+ }
+
+ return $this->laravel->isDownForMaintenance();
+ }
+
+ /**
+ * Get the console command arguments.
+ *
+ * @return array
+ */
+ protected function getArguments()
+ {
+ return [
+ ['connection', InputArgument::OPTIONAL, 'The name of connection', null],
+ ];
+ }
+
+ /**
+ * Get the console command options.
+ *
+ * @return array
+ */
+ protected function getOptions()
+ {
+ return [
+ ['queue', null, InputOption::VALUE_OPTIONAL, 'The queue to listen on'],
+
+ ['daemon', null, InputOption::VALUE_NONE, 'Run the worker in daemon mode'],
+
+ ['delay', null, InputOption::VALUE_OPTIONAL, 'Amount of time to delay failed jobs', 0],
+
+ ['force', null, InputOption::VALUE_NONE, 'Force the worker to run even in maintenance mode'],
+
+ ['memory', null, InputOption::VALUE_OPTIONAL, 'The memory limit in megabytes', 128],
+
+ ['sleep', null, InputOption::VALUE_OPTIONAL, 'Number of seconds to sleep when no job is available', 3],
+
+ ['tries', null, InputOption::VALUE_OPTIONAL, 'Number of times to attempt a job before logging it failed', 0],
+ ];
+ }
+}
diff --git a/vendor/illuminate/queue/Console/stubs/failed_jobs.stub b/vendor/illuminate/queue/Console/stubs/failed_jobs.stub
new file mode 100644
index 00000000..06d00bd7
--- /dev/null
+++ b/vendor/illuminate/queue/Console/stubs/failed_jobs.stub
@@ -0,0 +1,33 @@
+increments('id');
+ $table->text('connection');
+ $table->text('queue');
+ $table->longText('payload');
+ $table->timestamp('failed_at')->useCurrent();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('{{table}}');
+ }
+}
diff --git a/vendor/illuminate/queue/Console/stubs/jobs.stub b/vendor/illuminate/queue/Console/stubs/jobs.stub
new file mode 100644
index 00000000..18666691
--- /dev/null
+++ b/vendor/illuminate/queue/Console/stubs/jobs.stub
@@ -0,0 +1,37 @@
+bigIncrements('id');
+ $table->string('queue');
+ $table->longText('payload');
+ $table->tinyInteger('attempts')->unsigned();
+ $table->tinyInteger('reserved')->unsigned();
+ $table->unsignedInteger('reserved_at')->nullable();
+ $table->unsignedInteger('available_at');
+ $table->unsignedInteger('created_at');
+ $table->index(['queue', 'reserved', 'reserved_at']);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('{{table}}');
+ }
+}
diff --git a/vendor/illuminate/queue/ConsoleServiceProvider.php b/vendor/illuminate/queue/ConsoleServiceProvider.php
new file mode 100644
index 00000000..0a81e1e1
--- /dev/null
+++ b/vendor/illuminate/queue/ConsoleServiceProvider.php
@@ -0,0 +1,71 @@
+app->singleton('command.queue.table', function ($app) {
+ return new TableCommand($app['files'], $app['composer']);
+ });
+
+ $this->app->singleton('command.queue.failed', function () {
+ return new ListFailedCommand;
+ });
+
+ $this->app->singleton('command.queue.retry', function () {
+ return new RetryCommand;
+ });
+
+ $this->app->singleton('command.queue.forget', function () {
+ return new ForgetFailedCommand;
+ });
+
+ $this->app->singleton('command.queue.flush', function () {
+ return new FlushFailedCommand;
+ });
+
+ $this->app->singleton('command.queue.failed-table', function ($app) {
+ return new FailedTableCommand($app['files'], $app['composer']);
+ });
+
+ $this->commands(
+ 'command.queue.table', 'command.queue.failed', 'command.queue.retry',
+ 'command.queue.forget', 'command.queue.flush', 'command.queue.failed-table'
+ );
+ }
+
+ /**
+ * Get the services provided by the provider.
+ *
+ * @return array
+ */
+ public function provides()
+ {
+ return [
+ 'command.queue.table', 'command.queue.failed', 'command.queue.retry',
+ 'command.queue.forget', 'command.queue.flush', 'command.queue.failed-table',
+ ];
+ }
+}
diff --git a/vendor/illuminate/queue/DatabaseQueue.php b/vendor/illuminate/queue/DatabaseQueue.php
new file mode 100644
index 00000000..7aa6db81
--- /dev/null
+++ b/vendor/illuminate/queue/DatabaseQueue.php
@@ -0,0 +1,323 @@
+table = $table;
+ $this->expire = $expire;
+ $this->default = $default;
+ $this->database = $database;
+ }
+
+ /**
+ * Push a new job onto the queue.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function push($job, $data = '', $queue = null)
+ {
+ return $this->pushToDatabase(0, $queue, $this->createPayload($job, $data));
+ }
+
+ /**
+ * Push a raw payload onto the queue.
+ *
+ * @param string $payload
+ * @param string $queue
+ * @param array $options
+ * @return mixed
+ */
+ public function pushRaw($payload, $queue = null, array $options = [])
+ {
+ return $this->pushToDatabase(0, $queue, $payload);
+ }
+
+ /**
+ * Push a new job onto the queue after a delay.
+ *
+ * @param \DateTime|int $delay
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return void
+ */
+ public function later($delay, $job, $data = '', $queue = null)
+ {
+ return $this->pushToDatabase($delay, $queue, $this->createPayload($job, $data));
+ }
+
+ /**
+ * Push an array of jobs onto the queue.
+ *
+ * @param array $jobs
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function bulk($jobs, $data = '', $queue = null)
+ {
+ $queue = $this->getQueue($queue);
+
+ $availableAt = $this->getAvailableAt(0);
+
+ $records = array_map(function ($job) use ($queue, $data, $availableAt) {
+ return $this->buildDatabaseRecord(
+ $queue, $this->createPayload($job, $data), $availableAt
+ );
+ }, (array) $jobs);
+
+ return $this->database->table($this->table)->insert($records);
+ }
+
+ /**
+ * Release a reserved job back onto the queue.
+ *
+ * @param string $queue
+ * @param \StdClass $job
+ * @param int $delay
+ * @return mixed
+ */
+ public function release($queue, $job, $delay)
+ {
+ return $this->pushToDatabase($delay, $queue, $job->payload, $job->attempts);
+ }
+
+ /**
+ * Push a raw payload to the database with a given delay.
+ *
+ * @param \DateTime|int $delay
+ * @param string|null $queue
+ * @param string $payload
+ * @param int $attempts
+ * @return mixed
+ */
+ protected function pushToDatabase($delay, $queue, $payload, $attempts = 0)
+ {
+ $attributes = $this->buildDatabaseRecord(
+ $this->getQueue($queue), $payload, $this->getAvailableAt($delay), $attempts
+ );
+
+ return $this->database->table($this->table)->insertGetId($attributes);
+ }
+
+ /**
+ * Pop the next job off of the queue.
+ *
+ * @param string $queue
+ * @return \Illuminate\Contracts\Queue\Job|null
+ */
+ public function pop($queue = null)
+ {
+ $queue = $this->getQueue($queue);
+
+ if (! is_null($this->expire)) {
+ $this->releaseJobsThatHaveBeenReservedTooLong($queue);
+ }
+
+ if ($job = $this->getNextAvailableJob($queue)) {
+ $this->markJobAsReserved($job->id);
+
+ $this->database->commit();
+
+ return new DatabaseJob(
+ $this->container, $this, $job, $queue
+ );
+ }
+
+ $this->database->commit();
+ }
+
+ /**
+ * Release the jobs that have been reserved for too long.
+ *
+ * @param string $queue
+ * @return void
+ */
+ protected function releaseJobsThatHaveBeenReservedTooLong($queue)
+ {
+ $expired = Carbon::now()->subSeconds($this->expire)->getTimestamp();
+
+ $this->database->table($this->table)
+ ->where('queue', $this->getQueue($queue))
+ ->where('reserved', 1)
+ ->where('reserved_at', '<=', $expired)
+ ->update([
+ 'reserved' => 0,
+ 'reserved_at' => null,
+ 'attempts' => new Expression('attempts + 1'),
+ ]);
+ }
+
+ /**
+ * Get the next available job for the queue.
+ *
+ * @param string|null $queue
+ * @return \StdClass|null
+ */
+ protected function getNextAvailableJob($queue)
+ {
+ $this->database->beginTransaction();
+
+ $job = $this->database->table($this->table)
+ ->lockForUpdate()
+ ->where('queue', $this->getQueue($queue))
+ ->where('reserved', 0)
+ ->where('available_at', '<=', $this->getTime())
+ ->orderBy('id', 'asc')
+ ->first();
+
+ return $job ? (object) $job : null;
+ }
+
+ /**
+ * Mark the given job ID as reserved.
+ *
+ * @param string $id
+ * @return void
+ */
+ protected function markJobAsReserved($id)
+ {
+ $this->database->table($this->table)->where('id', $id)->update([
+ 'reserved' => 1, 'reserved_at' => $this->getTime(),
+ ]);
+ }
+
+ /**
+ * Delete a reserved job from the queue.
+ *
+ * @param string $queue
+ * @param string $id
+ * @return void
+ */
+ public function deleteReserved($queue, $id)
+ {
+ $this->database->table($this->table)->where('id', $id)->delete();
+ }
+
+ /**
+ * Get the "available at" UNIX timestamp.
+ *
+ * @param \DateTime|int $delay
+ * @return int
+ */
+ protected function getAvailableAt($delay)
+ {
+ $availableAt = $delay instanceof DateTime ? $delay : Carbon::now()->addSeconds($delay);
+
+ return $availableAt->getTimestamp();
+ }
+
+ /**
+ * Create an array to insert for the given job.
+ *
+ * @param string|null $queue
+ * @param string $payload
+ * @param int $availableAt
+ * @param int $attempts
+ * @return array
+ */
+ protected function buildDatabaseRecord($queue, $payload, $availableAt, $attempts = 0)
+ {
+ return [
+ 'queue' => $queue,
+ 'payload' => $payload,
+ 'attempts' => $attempts,
+ 'reserved' => 0,
+ 'reserved_at' => null,
+ 'available_at' => $availableAt,
+ 'created_at' => $this->getTime(),
+ ];
+ }
+
+ /**
+ * Get the queue or return the default.
+ *
+ * @param string|null $queue
+ * @return string
+ */
+ protected function getQueue($queue)
+ {
+ return $queue ?: $this->default;
+ }
+
+ /**
+ * Get the underlying database instance.
+ *
+ * @return \Illuminate\Database\Connection
+ */
+ public function getDatabase()
+ {
+ return $this->database;
+ }
+
+ /**
+ * Get the expiration time in seconds.
+ *
+ * @return int|null
+ */
+ public function getExpire()
+ {
+ return $this->expire;
+ }
+
+ /**
+ * Set the expiration time in seconds.
+ *
+ * @param int|null $seconds
+ * @return void
+ */
+ public function setExpire($seconds)
+ {
+ $this->expire = $seconds;
+ }
+}
diff --git a/vendor/illuminate/queue/Failed/DatabaseFailedJobProvider.php b/vendor/illuminate/queue/Failed/DatabaseFailedJobProvider.php
new file mode 100644
index 00000000..57586278
--- /dev/null
+++ b/vendor/illuminate/queue/Failed/DatabaseFailedJobProvider.php
@@ -0,0 +1,112 @@
+table = $table;
+ $this->resolver = $resolver;
+ $this->database = $database;
+ }
+
+ /**
+ * Log a failed job into storage.
+ *
+ * @param string $connection
+ * @param string $queue
+ * @param string $payload
+ * @return void
+ */
+ public function log($connection, $queue, $payload)
+ {
+ $failed_at = Carbon::now();
+
+ $this->getTable()->insert(compact('connection', 'queue', 'payload', 'failed_at'));
+ }
+
+ /**
+ * Get a list of all of the failed jobs.
+ *
+ * @return array
+ */
+ public function all()
+ {
+ return $this->getTable()->orderBy('id', 'desc')->get();
+ }
+
+ /**
+ * Get a single failed job.
+ *
+ * @param mixed $id
+ * @return array
+ */
+ public function find($id)
+ {
+ return $this->getTable()->find($id);
+ }
+
+ /**
+ * Delete a single failed job from storage.
+ *
+ * @param mixed $id
+ * @return bool
+ */
+ public function forget($id)
+ {
+ return $this->getTable()->where('id', $id)->delete() > 0;
+ }
+
+ /**
+ * Flush all of the failed jobs from storage.
+ *
+ * @return void
+ */
+ public function flush()
+ {
+ $this->getTable()->delete();
+ }
+
+ /**
+ * Get a new query builder instance for the table.
+ *
+ * @return \Illuminate\Database\Query\Builder
+ */
+ protected function getTable()
+ {
+ return $this->resolver->connection($this->database)->table($this->table);
+ }
+}
diff --git a/vendor/illuminate/queue/Failed/FailedJobProviderInterface.php b/vendor/illuminate/queue/Failed/FailedJobProviderInterface.php
new file mode 100644
index 00000000..1b207c09
--- /dev/null
+++ b/vendor/illuminate/queue/Failed/FailedJobProviderInterface.php
@@ -0,0 +1,46 @@
+crypt = $crypt;
+ }
+
+ /**
+ * Fire the Closure based queue job.
+ *
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @param array $data
+ * @return void
+ */
+ public function fire($job, $data)
+ {
+ $closure = unserialize($this->crypt->decrypt($data['closure']));
+
+ $closure($job);
+ }
+}
diff --git a/vendor/illuminate/queue/InteractsWithQueue.php b/vendor/illuminate/queue/InteractsWithQueue.php
new file mode 100644
index 00000000..bf1e021a
--- /dev/null
+++ b/vendor/illuminate/queue/InteractsWithQueue.php
@@ -0,0 +1,63 @@
+job) {
+ return $this->job->delete();
+ }
+ }
+
+ /**
+ * Release the job back into the queue.
+ *
+ * @param int $delay
+ * @return void
+ */
+ public function release($delay = 0)
+ {
+ if ($this->job) {
+ return $this->job->release($delay);
+ }
+ }
+
+ /**
+ * Get the number of times the job has been attempted.
+ *
+ * @return int
+ */
+ public function attempts()
+ {
+ return $this->job ? $this->job->attempts() : 1;
+ }
+
+ /**
+ * Set the base queue job instance.
+ *
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @return $this
+ */
+ public function setJob(JobContract $job)
+ {
+ $this->job = $job;
+
+ return $this;
+ }
+}
diff --git a/vendor/illuminate/queue/IronQueue.php b/vendor/illuminate/queue/IronQueue.php
new file mode 100644
index 00000000..68318890
--- /dev/null
+++ b/vendor/illuminate/queue/IronQueue.php
@@ -0,0 +1,263 @@
+iron = $iron;
+ $this->request = $request;
+ $this->default = $default;
+ $this->shouldEncrypt = $shouldEncrypt;
+ }
+
+ /**
+ * Push a new job onto the queue.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function push($job, $data = '', $queue = null)
+ {
+ return $this->pushRaw($this->createPayload($job, $data, $queue), $queue);
+ }
+
+ /**
+ * Push a raw payload onto the queue.
+ *
+ * @param string $payload
+ * @param string $queue
+ * @param array $options
+ * @return mixed
+ */
+ public function pushRaw($payload, $queue = null, array $options = [])
+ {
+ if ($this->shouldEncrypt) {
+ $payload = $this->crypt->encrypt($payload);
+ }
+
+ return $this->iron->postMessage($this->getQueue($queue), $payload, $options)->id;
+ }
+
+ /**
+ * Push a raw payload onto the queue after encrypting the payload.
+ *
+ * @param string $payload
+ * @param string $queue
+ * @param int $delay
+ * @return mixed
+ */
+ public function recreate($payload, $queue, $delay)
+ {
+ $options = ['delay' => $this->getSeconds($delay)];
+
+ return $this->pushRaw($payload, $queue, $options);
+ }
+
+ /**
+ * Push a new job onto the queue after a delay.
+ *
+ * @param \DateTime|int $delay
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function later($delay, $job, $data = '', $queue = null)
+ {
+ $delay = $this->getSeconds($delay);
+
+ $payload = $this->createPayload($job, $data, $queue);
+
+ return $this->pushRaw($payload, $queue, compact('delay'));
+ }
+
+ /**
+ * Pop the next job off of the queue.
+ *
+ * @param string $queue
+ * @return \Illuminate\Contracts\Queue\Job|null
+ */
+ public function pop($queue = null)
+ {
+ $queue = $this->getQueue($queue);
+
+ $job = $this->iron->getMessage($queue);
+
+ // If we were able to pop a message off of the queue, we will need to decrypt
+ // the message body, as all Iron.io messages are encrypted, since the push
+ // queues will be a security hazard to unsuspecting developers using it.
+ if (! is_null($job)) {
+ $job->body = $this->parseJobBody($job->body);
+
+ return new IronJob($this->container, $this, $job);
+ }
+ }
+
+ /**
+ * Delete a message from the Iron queue.
+ *
+ * @param string $queue
+ * @param string $id
+ * @return void
+ */
+ public function deleteMessage($queue, $id)
+ {
+ $this->iron->deleteMessage($queue, $id);
+ }
+
+ /**
+ * Marshal a push queue request and fire the job.
+ *
+ * @return \Illuminate\Http\Response
+ *
+ * @deprecated since version 5.1.
+ */
+ public function marshal()
+ {
+ $this->createPushedIronJob($this->marshalPushedJob())->fire();
+
+ return new Response('OK');
+ }
+
+ /**
+ * Marshal out the pushed job and payload.
+ *
+ * @return object
+ */
+ protected function marshalPushedJob()
+ {
+ $r = $this->request;
+
+ $body = $this->parseJobBody($r->getContent());
+
+ return (object) [
+ 'id' => $r->header('iron-message-id'), 'body' => $body, 'pushed' => true,
+ ];
+ }
+
+ /**
+ * Create a new IronJob for a pushed job.
+ *
+ * @param object $job
+ * @return \Illuminate\Queue\Jobs\IronJob
+ */
+ protected function createPushedIronJob($job)
+ {
+ return new IronJob($this->container, $this, $job, true);
+ }
+
+ /**
+ * Create a payload string from the given job and data.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return string
+ */
+ protected function createPayload($job, $data = '', $queue = null)
+ {
+ $payload = $this->setMeta(parent::createPayload($job, $data), 'attempts', 1);
+
+ return $this->setMeta($payload, 'queue', $this->getQueue($queue));
+ }
+
+ /**
+ * Parse the job body for firing.
+ *
+ * @param string $body
+ * @return string
+ */
+ protected function parseJobBody($body)
+ {
+ return $this->shouldEncrypt ? $this->crypt->decrypt($body) : $body;
+ }
+
+ /**
+ * Get the queue or return the default.
+ *
+ * @param string|null $queue
+ * @return string
+ */
+ public function getQueue($queue)
+ {
+ return $queue ?: $this->default;
+ }
+
+ /**
+ * Get the underlying IronMQ instance.
+ *
+ * @return \IronMQ\IronMQ
+ */
+ public function getIron()
+ {
+ return $this->iron;
+ }
+
+ /**
+ * Get the request instance.
+ *
+ * @return \Illuminate\Http\Request
+ */
+ public function getRequest()
+ {
+ return $this->request;
+ }
+
+ /**
+ * Set the request instance.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @return void
+ */
+ public function setRequest(Request $request)
+ {
+ $this->request = $request;
+ }
+}
diff --git a/vendor/illuminate/queue/Jobs/BeanstalkdJob.php b/vendor/illuminate/queue/Jobs/BeanstalkdJob.php
new file mode 100644
index 00000000..be245b76
--- /dev/null
+++ b/vendor/illuminate/queue/Jobs/BeanstalkdJob.php
@@ -0,0 +1,156 @@
+job = $job;
+ $this->queue = $queue;
+ $this->container = $container;
+ $this->pheanstalk = $pheanstalk;
+ }
+
+ /**
+ * Fire the job.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $this->resolveAndFire(json_decode($this->getRawBody(), true));
+ }
+
+ /**
+ * Get the raw body string for the job.
+ *
+ * @return string
+ */
+ public function getRawBody()
+ {
+ return $this->job->getData();
+ }
+
+ /**
+ * Delete the job from the queue.
+ *
+ * @return void
+ */
+ public function delete()
+ {
+ parent::delete();
+
+ $this->pheanstalk->delete($this->job);
+ }
+
+ /**
+ * Release the job back into the queue.
+ *
+ * @param int $delay
+ * @return void
+ */
+ public function release($delay = 0)
+ {
+ parent::release($delay);
+
+ $priority = Pheanstalk::DEFAULT_PRIORITY;
+
+ $this->pheanstalk->release($this->job, $priority, $delay);
+ }
+
+ /**
+ * Bury the job in the queue.
+ *
+ * @return void
+ */
+ public function bury()
+ {
+ parent::release();
+
+ $this->pheanstalk->bury($this->job);
+ }
+
+ /**
+ * Get the number of times the job has been attempted.
+ *
+ * @return int
+ */
+ public function attempts()
+ {
+ $stats = $this->pheanstalk->statsJob($this->job);
+
+ return (int) $stats->reserves;
+ }
+
+ /**
+ * Get the job identifier.
+ *
+ * @return string
+ */
+ public function getJobId()
+ {
+ return $this->job->getId();
+ }
+
+ /**
+ * Get the IoC container instance.
+ *
+ * @return \Illuminate\Container\Container
+ */
+ public function getContainer()
+ {
+ return $this->container;
+ }
+
+ /**
+ * Get the underlying Pheanstalk instance.
+ *
+ * @return \Pheanstalk\Pheanstalk
+ */
+ public function getPheanstalk()
+ {
+ return $this->pheanstalk;
+ }
+
+ /**
+ * Get the underlying Pheanstalk job.
+ *
+ * @return \Pheanstalk\Job
+ */
+ public function getPheanstalkJob()
+ {
+ return $this->job;
+ }
+}
diff --git a/vendor/illuminate/queue/Jobs/DatabaseJob.php b/vendor/illuminate/queue/Jobs/DatabaseJob.php
new file mode 100644
index 00000000..c60eed49
--- /dev/null
+++ b/vendor/illuminate/queue/Jobs/DatabaseJob.php
@@ -0,0 +1,139 @@
+job = $job;
+ $this->queue = $queue;
+ $this->database = $database;
+ $this->container = $container;
+ $this->job->attempts = $this->job->attempts + 1;
+ }
+
+ /**
+ * Fire the job.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $this->resolveAndFire(json_decode($this->job->payload, true));
+ }
+
+ /**
+ * Delete the job from the queue.
+ *
+ * @return void
+ */
+ public function delete()
+ {
+ parent::delete();
+
+ $this->database->deleteReserved($this->queue, $this->job->id);
+ }
+
+ /**
+ * Release the job back into the queue.
+ *
+ * @param int $delay
+ * @return void
+ */
+ public function release($delay = 0)
+ {
+ parent::release($delay);
+
+ $this->delete();
+
+ $this->database->release($this->queue, $this->job, $delay);
+ }
+
+ /**
+ * Get the number of times the job has been attempted.
+ *
+ * @return int
+ */
+ public function attempts()
+ {
+ return (int) $this->job->attempts;
+ }
+
+ /**
+ * Get the job identifier.
+ *
+ * @return string
+ */
+ public function getJobId()
+ {
+ return $this->job->id;
+ }
+
+ /**
+ * Get the raw body string for the job.
+ *
+ * @return string
+ */
+ public function getRawBody()
+ {
+ return $this->job->payload;
+ }
+
+ /**
+ * Get the IoC container instance.
+ *
+ * @return \Illuminate\Container\Container
+ */
+ public function getContainer()
+ {
+ return $this->container;
+ }
+
+ /**
+ * Get the underlying queue driver instance.
+ *
+ * @return \Illuminate\Queue\DatabaseQueue
+ */
+ public function getDatabaseQueue()
+ {
+ return $this->database;
+ }
+
+ /**
+ * Get the underlying database job.
+ *
+ * @return \StdClass
+ */
+ public function getDatabaseJob()
+ {
+ return $this->job;
+ }
+}
diff --git a/vendor/illuminate/queue/Jobs/IronJob.php b/vendor/illuminate/queue/Jobs/IronJob.php
new file mode 100644
index 00000000..6793bcd7
--- /dev/null
+++ b/vendor/illuminate/queue/Jobs/IronJob.php
@@ -0,0 +1,180 @@
+job = $job;
+ $this->iron = $iron;
+ $this->pushed = $pushed;
+ $this->container = $container;
+ }
+
+ /**
+ * Fire the job.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $this->resolveAndFire(json_decode($this->getRawBody(), true));
+ }
+
+ /**
+ * Get the raw body string for the job.
+ *
+ * @return string
+ */
+ public function getRawBody()
+ {
+ return $this->job->body;
+ }
+
+ /**
+ * Delete the job from the queue.
+ *
+ * @return void
+ */
+ public function delete()
+ {
+ parent::delete();
+
+ if (isset($this->job->pushed)) {
+ return;
+ }
+
+ $this->iron->deleteMessage($this->getQueue(), $this->job->id);
+ }
+
+ /**
+ * Release the job back into the queue.
+ *
+ * @param int $delay
+ * @return void
+ */
+ public function release($delay = 0)
+ {
+ parent::release($delay);
+
+ if (! $this->pushed) {
+ $this->delete();
+ }
+
+ $this->recreateJob($delay);
+ }
+
+ /**
+ * Release a pushed job back onto the queue.
+ *
+ * @param int $delay
+ * @return void
+ */
+ protected function recreateJob($delay)
+ {
+ $payload = json_decode($this->job->body, true);
+
+ Arr::set($payload, 'attempts', Arr::get($payload, 'attempts', 1) + 1);
+
+ $this->iron->recreate(json_encode($payload), $this->getQueue(), $delay);
+ }
+
+ /**
+ * Get the number of times the job has been attempted.
+ *
+ * @return int
+ */
+ public function attempts()
+ {
+ return Arr::get(json_decode($this->job->body, true), 'attempts', 1);
+ }
+
+ /**
+ * Get the job identifier.
+ *
+ * @return string
+ */
+ public function getJobId()
+ {
+ return $this->job->id;
+ }
+
+ /**
+ * Get the IoC container instance.
+ *
+ * @return \Illuminate\Container\Container
+ */
+ public function getContainer()
+ {
+ return $this->container;
+ }
+
+ /**
+ * Get the underlying Iron queue instance.
+ *
+ * @return \Illuminate\Queue\IronQueue
+ */
+ public function getIron()
+ {
+ return $this->iron;
+ }
+
+ /**
+ * Get the underlying IronMQ job.
+ *
+ * @return array
+ */
+ public function getIronJob()
+ {
+ return $this->job;
+ }
+
+ /**
+ * Get the name of the queue the job belongs to.
+ *
+ * @return string
+ */
+ public function getQueue()
+ {
+ return Arr::get(json_decode($this->job->body, true), 'queue');
+ }
+}
diff --git a/vendor/illuminate/queue/Jobs/Job.php b/vendor/illuminate/queue/Jobs/Job.php
new file mode 100644
index 00000000..304bc9dd
--- /dev/null
+++ b/vendor/illuminate/queue/Jobs/Job.php
@@ -0,0 +1,270 @@
+deleted = true;
+ }
+
+ /**
+ * Determine if the job has been deleted.
+ *
+ * @return bool
+ */
+ public function isDeleted()
+ {
+ return $this->deleted;
+ }
+
+ /**
+ * Release the job back into the queue.
+ *
+ * @param int $delay
+ * @return void
+ */
+ public function release($delay = 0)
+ {
+ $this->released = true;
+ }
+
+ /**
+ * Determine if the job was released back into the queue.
+ *
+ * @return bool
+ */
+ public function isReleased()
+ {
+ return $this->released;
+ }
+
+ /**
+ * Determine if the job has been deleted or released.
+ *
+ * @return bool
+ */
+ public function isDeletedOrReleased()
+ {
+ return $this->isDeleted() || $this->isReleased();
+ }
+
+ /**
+ * Get the number of times the job has been attempted.
+ *
+ * @return int
+ */
+ abstract public function attempts();
+
+ /**
+ * Get the raw body string for the job.
+ *
+ * @return string
+ */
+ abstract public function getRawBody();
+
+ /**
+ * Resolve and fire the job handler method.
+ *
+ * @param array $payload
+ * @return void
+ */
+ protected function resolveAndFire(array $payload)
+ {
+ list($class, $method) = $this->parseJob($payload['job']);
+
+ $this->instance = $this->resolve($class);
+
+ $this->instance->{$method}($this, $this->resolveQueueableEntities($payload['data']));
+ }
+
+ /**
+ * Parse the job declaration into class and method.
+ *
+ * @param string $job
+ * @return array
+ */
+ protected function parseJob($job)
+ {
+ $segments = explode('@', $job);
+
+ return count($segments) > 1 ? $segments : [$segments[0], 'fire'];
+ }
+
+ /**
+ * Resolve the given job handler.
+ *
+ * @param string $class
+ * @return mixed
+ */
+ protected function resolve($class)
+ {
+ return $this->container->make($class);
+ }
+
+ /**
+ * Resolve all of the queueable entities in the given payload.
+ *
+ * @param mixed $data
+ * @return mixed
+ */
+ protected function resolveQueueableEntities($data)
+ {
+ if (is_string($data)) {
+ return $this->resolveQueueableEntity($data);
+ }
+
+ if (is_array($data)) {
+ $data = array_map(function ($d) {
+ if (is_array($d)) {
+ return $this->resolveQueueableEntities($d);
+ }
+
+ return $this->resolveQueueableEntity($d);
+ }, $data);
+ }
+
+ return $data;
+ }
+
+ /**
+ * Resolve a single queueable entity from the resolver.
+ *
+ * @param mixed $value
+ * @return \Illuminate\Contracts\Queue\QueueableEntity
+ */
+ protected function resolveQueueableEntity($value)
+ {
+ if (is_string($value) && Str::startsWith($value, '::entity::')) {
+ list($marker, $type, $id) = explode('|', $value, 3);
+
+ return $this->getEntityResolver()->resolve($type, $id);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Call the failed method on the job instance.
+ *
+ * @return void
+ */
+ public function failed()
+ {
+ $payload = json_decode($this->getRawBody(), true);
+
+ list($class, $method) = $this->parseJob($payload['job']);
+
+ $this->instance = $this->resolve($class);
+
+ if (method_exists($this->instance, 'failed')) {
+ $this->instance->failed($this->resolveQueueableEntities($payload['data']));
+ }
+ }
+
+ /**
+ * Get an entity resolver instance.
+ *
+ * @return \Illuminate\Contracts\Queue\EntityResolver
+ */
+ protected function getEntityResolver()
+ {
+ return $this->container->make('Illuminate\Contracts\Queue\EntityResolver');
+ }
+
+ /**
+ * Calculate the number of seconds with the given delay.
+ *
+ * @param \DateTime|int $delay
+ * @return int
+ */
+ protected function getSeconds($delay)
+ {
+ if ($delay instanceof DateTime) {
+ return max(0, $delay->getTimestamp() - $this->getTime());
+ }
+
+ return (int) $delay;
+ }
+
+ /**
+ * Get the current system time.
+ *
+ * @return int
+ */
+ protected function getTime()
+ {
+ return time();
+ }
+
+ /**
+ * Get the name of the queued job class.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return json_decode($this->getRawBody(), true)['job'];
+ }
+
+ /**
+ * Get the name of the queue the job belongs to.
+ *
+ * @return string
+ */
+ public function getQueue()
+ {
+ return $this->queue;
+ }
+}
diff --git a/vendor/illuminate/queue/Jobs/RedisJob.php b/vendor/illuminate/queue/Jobs/RedisJob.php
new file mode 100644
index 00000000..af9ca978
--- /dev/null
+++ b/vendor/illuminate/queue/Jobs/RedisJob.php
@@ -0,0 +1,139 @@
+job = $job;
+ $this->redis = $redis;
+ $this->queue = $queue;
+ $this->container = $container;
+ }
+
+ /**
+ * Fire the job.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $this->resolveAndFire(json_decode($this->getRawBody(), true));
+ }
+
+ /**
+ * Get the raw body string for the job.
+ *
+ * @return string
+ */
+ public function getRawBody()
+ {
+ return $this->job;
+ }
+
+ /**
+ * Delete the job from the queue.
+ *
+ * @return void
+ */
+ public function delete()
+ {
+ parent::delete();
+
+ $this->redis->deleteReserved($this->queue, $this->job);
+ }
+
+ /**
+ * Release the job back into the queue.
+ *
+ * @param int $delay
+ * @return void
+ */
+ public function release($delay = 0)
+ {
+ parent::release($delay);
+
+ $this->delete();
+
+ $this->redis->release($this->queue, $this->job, $delay, $this->attempts() + 1);
+ }
+
+ /**
+ * Get the number of times the job has been attempted.
+ *
+ * @return int
+ */
+ public function attempts()
+ {
+ return Arr::get(json_decode($this->job, true), 'attempts');
+ }
+
+ /**
+ * Get the job identifier.
+ *
+ * @return string
+ */
+ public function getJobId()
+ {
+ return Arr::get(json_decode($this->job, true), 'id');
+ }
+
+ /**
+ * Get the IoC container instance.
+ *
+ * @return \Illuminate\Container\Container
+ */
+ public function getContainer()
+ {
+ return $this->container;
+ }
+
+ /**
+ * Get the underlying queue driver instance.
+ *
+ * @return \Illuminate\Redis\Database
+ */
+ public function getRedisQueue()
+ {
+ return $this->redis;
+ }
+
+ /**
+ * Get the underlying Redis job.
+ *
+ * @return string
+ */
+ public function getRedisJob()
+ {
+ return $this->job;
+ }
+}
diff --git a/vendor/illuminate/queue/Jobs/SqsJob.php b/vendor/illuminate/queue/Jobs/SqsJob.php
new file mode 100644
index 00000000..b676a525
--- /dev/null
+++ b/vendor/illuminate/queue/Jobs/SqsJob.php
@@ -0,0 +1,147 @@
+sqs = $sqs;
+ $this->job = $job;
+ $this->queue = $queue;
+ $this->container = $container;
+ }
+
+ /**
+ * Fire the job.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $this->resolveAndFire(json_decode($this->getRawBody(), true));
+ }
+
+ /**
+ * Get the raw body string for the job.
+ *
+ * @return string
+ */
+ public function getRawBody()
+ {
+ return $this->job['Body'];
+ }
+
+ /**
+ * Delete the job from the queue.
+ *
+ * @return void
+ */
+ public function delete()
+ {
+ parent::delete();
+
+ $this->sqs->deleteMessage([
+
+ 'QueueUrl' => $this->queue, 'ReceiptHandle' => $this->job['ReceiptHandle'],
+
+ ]);
+ }
+
+ /**
+ * Release the job back into the queue.
+ *
+ * @param int $delay
+ * @return void
+ */
+ public function release($delay = 0)
+ {
+ parent::release($delay);
+
+ $this->sqs->changeMessageVisibility([
+ 'QueueUrl' => $this->queue,
+ 'ReceiptHandle' => $this->job['ReceiptHandle'],
+ 'VisibilityTimeout' => $delay,
+ ]);
+ }
+
+ /**
+ * Get the number of times the job has been attempted.
+ *
+ * @return int
+ */
+ public function attempts()
+ {
+ return (int) $this->job['Attributes']['ApproximateReceiveCount'];
+ }
+
+ /**
+ * Get the job identifier.
+ *
+ * @return string
+ */
+ public function getJobId()
+ {
+ return $this->job['MessageId'];
+ }
+
+ /**
+ * Get the IoC container instance.
+ *
+ * @return \Illuminate\Container\Container
+ */
+ public function getContainer()
+ {
+ return $this->container;
+ }
+
+ /**
+ * Get the underlying SQS client instance.
+ *
+ * @return \Aws\Sqs\SqsClient
+ */
+ public function getSqs()
+ {
+ return $this->sqs;
+ }
+
+ /**
+ * Get the underlying raw SQS job.
+ *
+ * @return array
+ */
+ public function getSqsJob()
+ {
+ return $this->job;
+ }
+}
diff --git a/vendor/illuminate/queue/Jobs/SyncJob.php b/vendor/illuminate/queue/Jobs/SyncJob.php
new file mode 100644
index 00000000..fe7df179
--- /dev/null
+++ b/vendor/illuminate/queue/Jobs/SyncJob.php
@@ -0,0 +1,87 @@
+payload = $payload;
+ $this->container = $container;
+ }
+
+ /**
+ * Fire the job.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $this->resolveAndFire(json_decode($this->payload, true));
+ }
+
+ /**
+ * Get the raw body string for the job.
+ *
+ * @return string
+ */
+ public function getRawBody()
+ {
+ return $this->payload;
+ }
+
+ /**
+ * Release the job back into the queue.
+ *
+ * @param int $delay
+ * @return void
+ */
+ public function release($delay = 0)
+ {
+ parent::release($delay);
+ }
+
+ /**
+ * Get the number of times the job has been attempted.
+ *
+ * @return int
+ */
+ public function attempts()
+ {
+ return 1;
+ }
+
+ /**
+ * Get the job identifier.
+ *
+ * @return string
+ */
+ public function getJobId()
+ {
+ return '';
+ }
+}
diff --git a/vendor/illuminate/queue/Listener.php b/vendor/illuminate/queue/Listener.php
new file mode 100644
index 00000000..b19d46c4
--- /dev/null
+++ b/vendor/illuminate/queue/Listener.php
@@ -0,0 +1,265 @@
+commandPath = $commandPath;
+ $this->workerCommand = $this->buildWorkerCommand();
+ }
+
+ /**
+ * Build the environment specific worker command.
+ *
+ * @return string
+ */
+ protected function buildWorkerCommand()
+ {
+ $binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
+
+ if (defined('HHVM_VERSION')) {
+ $binary .= ' --php';
+ }
+
+ if (defined('ARTISAN_BINARY')) {
+ $artisan = ProcessUtils::escapeArgument(ARTISAN_BINARY);
+ } else {
+ $artisan = 'artisan';
+ }
+
+ $command = 'queue:work %s --queue=%s --delay=%s --memory=%s --sleep=%s --tries=%s';
+
+ return "{$binary} {$artisan} {$command}";
+ }
+
+ /**
+ * Listen to the given queue connection.
+ *
+ * @param string $connection
+ * @param string $queue
+ * @param string $delay
+ * @param string $memory
+ * @param int $timeout
+ * @return void
+ */
+ public function listen($connection, $queue, $delay, $memory, $timeout = 60)
+ {
+ $process = $this->makeProcess($connection, $queue, $delay, $memory, $timeout);
+
+ while (true) {
+ $this->runProcess($process, $memory);
+ }
+ }
+
+ /**
+ * Run the given process.
+ *
+ * @param \Symfony\Component\Process\Process $process
+ * @param int $memory
+ * @return void
+ */
+ public function runProcess(Process $process, $memory)
+ {
+ $process->run(function ($type, $line) {
+ $this->handleWorkerOutput($type, $line);
+ });
+
+ // Once we have run the job we'll go check if the memory limit has been
+ // exceeded for the script. If it has, we will kill this script so a
+ // process manager will restart this with a clean slate of memory.
+ if ($this->memoryExceeded($memory)) {
+ $this->stop();
+ }
+ }
+
+ /**
+ * Create a new Symfony process for the worker.
+ *
+ * @param string $connection
+ * @param string $queue
+ * @param int $delay
+ * @param int $memory
+ * @param int $timeout
+ * @return \Symfony\Component\Process\Process
+ */
+ public function makeProcess($connection, $queue, $delay, $memory, $timeout)
+ {
+ $string = $this->workerCommand;
+
+ // If the environment is set, we will append it to the command string so the
+ // workers will run under the specified environment. Otherwise, they will
+ // just run under the production environment which is not always right.
+ if (isset($this->environment)) {
+ $string .= ' --env='.ProcessUtils::escapeArgument($this->environment);
+ }
+
+ // Next, we will just format out the worker commands with all of the various
+ // options available for the command. This will produce the final command
+ // line that we will pass into a Symfony process object for processing.
+ $command = sprintf(
+ $string,
+ ProcessUtils::escapeArgument($connection),
+ ProcessUtils::escapeArgument($queue),
+ $delay,
+ $memory,
+ $this->sleep,
+ $this->maxTries
+ );
+
+ return new Process($command, $this->commandPath, null, null, $timeout);
+ }
+
+ /**
+ * Handle output from the worker process.
+ *
+ * @param int $type
+ * @param string $line
+ * @return void
+ */
+ protected function handleWorkerOutput($type, $line)
+ {
+ if (isset($this->outputHandler)) {
+ call_user_func($this->outputHandler, $type, $line);
+ }
+ }
+
+ /**
+ * Determine if the memory limit has been exceeded.
+ *
+ * @param int $memoryLimit
+ * @return bool
+ */
+ public function memoryExceeded($memoryLimit)
+ {
+ return (memory_get_usage() / 1024 / 1024) >= $memoryLimit;
+ }
+
+ /**
+ * Stop listening and bail out of the script.
+ *
+ * @return void
+ */
+ public function stop()
+ {
+ die;
+ }
+
+ /**
+ * Set the output handler callback.
+ *
+ * @param \Closure $outputHandler
+ * @return void
+ */
+ public function setOutputHandler(Closure $outputHandler)
+ {
+ $this->outputHandler = $outputHandler;
+ }
+
+ /**
+ * Get the current listener environment.
+ *
+ * @return string
+ */
+ public function getEnvironment()
+ {
+ return $this->environment;
+ }
+
+ /**
+ * Set the current environment.
+ *
+ * @param string $environment
+ * @return void
+ */
+ public function setEnvironment($environment)
+ {
+ $this->environment = $environment;
+ }
+
+ /**
+ * Get the amount of seconds to wait before polling the queue.
+ *
+ * @return int
+ */
+ public function getSleep()
+ {
+ return $this->sleep;
+ }
+
+ /**
+ * Set the amount of seconds to wait before polling the queue.
+ *
+ * @param int $sleep
+ * @return void
+ */
+ public function setSleep($sleep)
+ {
+ $this->sleep = $sleep;
+ }
+
+ /**
+ * Set the amount of times to try a job before logging it failed.
+ *
+ * @param int $tries
+ * @return void
+ */
+ public function setMaxTries($tries)
+ {
+ $this->maxTries = $tries;
+ }
+}
diff --git a/vendor/illuminate/queue/NullQueue.php b/vendor/illuminate/queue/NullQueue.php
new file mode 100644
index 00000000..bdef6cc4
--- /dev/null
+++ b/vendor/illuminate/queue/NullQueue.php
@@ -0,0 +1,59 @@
+push($job, $data, $queue);
+ }
+
+ /**
+ * Push a new job onto the queue after a delay.
+ *
+ * @param string $queue
+ * @param \DateTime|int $delay
+ * @param string $job
+ * @param mixed $data
+ * @return mixed
+ */
+ public function laterOn($queue, $delay, $job, $data = '')
+ {
+ return $this->later($delay, $job, $data, $queue);
+ }
+
+ /**
+ * Marshal a push queue request and fire the job.
+ *
+ * @throws \RuntimeException
+ *
+ * @deprecated since version 5.1.
+ */
+ public function marshal()
+ {
+ throw new RuntimeException('Push queues only supported by Iron.');
+ }
+
+ /**
+ * Push an array of jobs onto the queue.
+ *
+ * @param array $jobs
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function bulk($jobs, $data = '', $queue = null)
+ {
+ foreach ((array) $jobs as $job) {
+ $this->push($job, $data, $queue);
+ }
+ }
+
+ /**
+ * Create a payload string from the given job and data.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return string
+ */
+ protected function createPayload($job, $data = '', $queue = null)
+ {
+ if ($job instanceof Closure) {
+ return json_encode($this->createClosurePayload($job, $data));
+ } elseif (is_object($job)) {
+ return json_encode([
+ 'job' => 'Illuminate\Queue\CallQueuedHandler@call',
+ 'data' => ['command' => serialize(clone $job)],
+ ]);
+ }
+
+ return json_encode($this->createPlainPayload($job, $data));
+ }
+
+ /**
+ * Create a typical, "plain" queue payload array.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @return array
+ */
+ protected function createPlainPayload($job, $data)
+ {
+ return ['job' => $job, 'data' => $this->prepareQueueableEntities($data)];
+ }
+
+ /**
+ * Prepare any queueable entities for storage in the queue.
+ *
+ * @param mixed $data
+ * @return mixed
+ */
+ protected function prepareQueueableEntities($data)
+ {
+ if ($data instanceof QueueableEntity) {
+ return $this->prepareQueueableEntity($data);
+ }
+
+ if (is_array($data)) {
+ $data = array_map(function ($d) {
+ if (is_array($d)) {
+ return $this->prepareQueueableEntities($d);
+ }
+
+ return $this->prepareQueueableEntity($d);
+ }, $data);
+ }
+
+ return $data;
+ }
+
+ /**
+ * Prepare a single queueable entity for storage on the queue.
+ *
+ * @param mixed $value
+ * @return mixed
+ */
+ protected function prepareQueueableEntity($value)
+ {
+ if ($value instanceof QueueableEntity) {
+ return '::entity::|'.get_class($value).'|'.$value->getQueueableId();
+ }
+
+ return $value;
+ }
+
+ /**
+ * Create a payload string for the given Closure job.
+ *
+ * @param \Closure $job
+ * @param mixed $data
+ * @return string
+ */
+ protected function createClosurePayload($job, $data)
+ {
+ $closure = $this->crypt->encrypt((new Serializer)->serialize($job));
+
+ return ['job' => 'IlluminateQueueClosure', 'data' => compact('closure')];
+ }
+
+ /**
+ * Set additional meta on a payload string.
+ *
+ * @param string $payload
+ * @param string $key
+ * @param string $value
+ * @return string
+ */
+ protected function setMeta($payload, $key, $value)
+ {
+ $payload = json_decode($payload, true);
+
+ return json_encode(Arr::set($payload, $key, $value));
+ }
+
+ /**
+ * Calculate the number of seconds with the given delay.
+ *
+ * @param \DateTime|int $delay
+ * @return int
+ */
+ protected function getSeconds($delay)
+ {
+ if ($delay instanceof DateTime) {
+ return max(0, $delay->getTimestamp() - $this->getTime());
+ }
+
+ return (int) $delay;
+ }
+
+ /**
+ * Get the current UNIX timestamp.
+ *
+ * @return int
+ */
+ protected function getTime()
+ {
+ return time();
+ }
+
+ /**
+ * Set the IoC container instance.
+ *
+ * @param \Illuminate\Container\Container $container
+ * @return void
+ */
+ public function setContainer(Container $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * Set the encrypter instance.
+ *
+ * @param \Illuminate\Contracts\Encryption\Encrypter $crypt
+ * @return void
+ */
+ public function setEncrypter(EncrypterContract $crypt)
+ {
+ $this->crypt = $crypt;
+ }
+}
diff --git a/vendor/illuminate/queue/QueueManager.php b/vendor/illuminate/queue/QueueManager.php
new file mode 100644
index 00000000..cf91bbd9
--- /dev/null
+++ b/vendor/illuminate/queue/QueueManager.php
@@ -0,0 +1,243 @@
+app = $app;
+ }
+
+ /**
+ * Register an event listener for the after job event.
+ *
+ * @param mixed $callback
+ * @return void
+ */
+ public function after($callback)
+ {
+ $this->app['events']->listen('illuminate.queue.after', $callback);
+ }
+
+ /**
+ * Register an event listener for the daemon queue loop.
+ *
+ * @param mixed $callback
+ * @return void
+ */
+ public function looping($callback)
+ {
+ $this->app['events']->listen('illuminate.queue.looping', $callback);
+ }
+
+ /**
+ * Register an event listener for the failed job event.
+ *
+ * @param mixed $callback
+ * @return void
+ */
+ public function failing($callback)
+ {
+ $this->app['events']->listen('illuminate.queue.failed', $callback);
+ }
+
+ /**
+ * Register an event listener for the daemon queue stopping.
+ *
+ * @param mixed $callback
+ * @return void
+ */
+ public function stopping($callback)
+ {
+ $this->app['events']->listen('illuminate.queue.stopping', $callback);
+ }
+
+ /**
+ * Determine if the driver is connected.
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function connected($name = null)
+ {
+ return isset($this->connections[$name ?: $this->getDefaultDriver()]);
+ }
+
+ /**
+ * Resolve a queue connection instance.
+ *
+ * @param string $name
+ * @return \Illuminate\Contracts\Queue\Queue
+ */
+ public function connection($name = null)
+ {
+ $name = $name ?: $this->getDefaultDriver();
+
+ // If the connection has not been resolved yet we will resolve it now as all
+ // of the connections are resolved when they are actually needed so we do
+ // not make any unnecessary connection to the various queue end-points.
+ if (! isset($this->connections[$name])) {
+ $this->connections[$name] = $this->resolve($name);
+
+ $this->connections[$name]->setContainer($this->app);
+
+ $this->connections[$name]->setEncrypter($this->app['encrypter']);
+ }
+
+ return $this->connections[$name];
+ }
+
+ /**
+ * Resolve a queue connection.
+ *
+ * @param string $name
+ * @return \Illuminate\Contracts\Queue\Queue
+ */
+ protected function resolve($name)
+ {
+ $config = $this->getConfig($name);
+
+ return $this->getConnector($config['driver'])->connect($config);
+ }
+
+ /**
+ * Get the connector for a given driver.
+ *
+ * @param string $driver
+ * @return \Illuminate\Queue\Connectors\ConnectorInterface
+ *
+ * @throws \InvalidArgumentException
+ */
+ protected function getConnector($driver)
+ {
+ if (isset($this->connectors[$driver])) {
+ return call_user_func($this->connectors[$driver]);
+ }
+
+ throw new InvalidArgumentException("No connector for [$driver]");
+ }
+
+ /**
+ * Add a queue connection resolver.
+ *
+ * @param string $driver
+ * @param \Closure $resolver
+ * @return void
+ */
+ public function extend($driver, Closure $resolver)
+ {
+ return $this->addConnector($driver, $resolver);
+ }
+
+ /**
+ * Add a queue connection resolver.
+ *
+ * @param string $driver
+ * @param \Closure $resolver
+ * @return void
+ */
+ public function addConnector($driver, Closure $resolver)
+ {
+ $this->connectors[$driver] = $resolver;
+ }
+
+ /**
+ * Get the queue connection configuration.
+ *
+ * @param string $name
+ * @return array
+ */
+ protected function getConfig($name)
+ {
+ return $this->app['config']["queue.connections.{$name}"];
+ }
+
+ /**
+ * Get the name of the default queue connection.
+ *
+ * @return string
+ */
+ public function getDefaultDriver()
+ {
+ return $this->app['config']['queue.default'];
+ }
+
+ /**
+ * Set the name of the default queue connection.
+ *
+ * @param string $name
+ * @return void
+ */
+ public function setDefaultDriver($name)
+ {
+ $this->app['config']['queue.default'] = $name;
+ }
+
+ /**
+ * Get the full name for the given connection.
+ *
+ * @param string $connection
+ * @return string
+ */
+ public function getName($connection = null)
+ {
+ return $connection ?: $this->getDefaultDriver();
+ }
+
+ /**
+ * Determine if the application is in maintenance mode.
+ *
+ * @return bool
+ */
+ public function isDownForMaintenance()
+ {
+ return $this->app->isDownForMaintenance();
+ }
+
+ /**
+ * Dynamically pass calls to the default connection.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return mixed
+ */
+ public function __call($method, $parameters)
+ {
+ $callable = [$this->connection(), $method];
+
+ return call_user_func_array($callable, $parameters);
+ }
+}
diff --git a/vendor/illuminate/queue/QueueServiceProvider.php b/vendor/illuminate/queue/QueueServiceProvider.php
new file mode 100644
index 00000000..bf61e06a
--- /dev/null
+++ b/vendor/illuminate/queue/QueueServiceProvider.php
@@ -0,0 +1,326 @@
+registerManager();
+
+ $this->registerWorker();
+
+ $this->registerListener();
+
+ $this->registerSubscriber();
+
+ $this->registerFailedJobServices();
+
+ $this->registerQueueClosure();
+ }
+
+ /**
+ * Register the queue manager.
+ *
+ * @return void
+ */
+ protected function registerManager()
+ {
+ $this->app->singleton('queue', function ($app) {
+ // Once we have an instance of the queue manager, we will register the various
+ // resolvers for the queue connectors. These connectors are responsible for
+ // creating the classes that accept queue configs and instantiate queues.
+ $manager = new QueueManager($app);
+
+ $this->registerConnectors($manager);
+
+ return $manager;
+ });
+
+ $this->app->singleton('queue.connection', function ($app) {
+ return $app['queue']->connection();
+ });
+ }
+
+ /**
+ * Register the queue worker.
+ *
+ * @return void
+ */
+ protected function registerWorker()
+ {
+ $this->registerWorkCommand();
+
+ $this->registerRestartCommand();
+
+ $this->app->singleton('queue.worker', function ($app) {
+ return new Worker($app['queue'], $app['queue.failer'], $app['events']);
+ });
+ }
+
+ /**
+ * Register the queue worker console command.
+ *
+ * @return void
+ */
+ protected function registerWorkCommand()
+ {
+ $this->app->singleton('command.queue.work', function ($app) {
+ return new WorkCommand($app['queue.worker']);
+ });
+
+ $this->commands('command.queue.work');
+ }
+
+ /**
+ * Register the queue listener.
+ *
+ * @return void
+ */
+ protected function registerListener()
+ {
+ $this->registerListenCommand();
+
+ $this->app->singleton('queue.listener', function ($app) {
+ return new Listener($app->basePath());
+ });
+ }
+
+ /**
+ * Register the queue listener console command.
+ *
+ * @return void
+ */
+ protected function registerListenCommand()
+ {
+ $this->app->singleton('command.queue.listen', function ($app) {
+ return new ListenCommand($app['queue.listener']);
+ });
+
+ $this->commands('command.queue.listen');
+ }
+
+ /**
+ * Register the queue restart console command.
+ *
+ * @return void
+ */
+ public function registerRestartCommand()
+ {
+ $this->app->singleton('command.queue.restart', function () {
+ return new RestartCommand;
+ });
+
+ $this->commands('command.queue.restart');
+ }
+
+ /**
+ * Register the push queue subscribe command.
+ *
+ * @return void
+ */
+ protected function registerSubscriber()
+ {
+ $this->app->singleton('command.queue.subscribe', function () {
+ return new SubscribeCommand;
+ });
+
+ $this->commands('command.queue.subscribe');
+ }
+
+ /**
+ * Register the connectors on the queue manager.
+ *
+ * @param \Illuminate\Queue\QueueManager $manager
+ * @return void
+ */
+ public function registerConnectors($manager)
+ {
+ foreach (['Null', 'Sync', 'Database', 'Beanstalkd', 'Redis', 'Sqs', 'Iron'] as $connector) {
+ $this->{"register{$connector}Connector"}($manager);
+ }
+ }
+
+ /**
+ * Register the Null queue connector.
+ *
+ * @param \Illuminate\Queue\QueueManager $manager
+ * @return void
+ */
+ protected function registerNullConnector($manager)
+ {
+ $manager->addConnector('null', function () {
+ return new NullConnector;
+ });
+ }
+
+ /**
+ * Register the Sync queue connector.
+ *
+ * @param \Illuminate\Queue\QueueManager $manager
+ * @return void
+ */
+ protected function registerSyncConnector($manager)
+ {
+ $manager->addConnector('sync', function () {
+ return new SyncConnector;
+ });
+ }
+
+ /**
+ * Register the Beanstalkd queue connector.
+ *
+ * @param \Illuminate\Queue\QueueManager $manager
+ * @return void
+ */
+ protected function registerBeanstalkdConnector($manager)
+ {
+ $manager->addConnector('beanstalkd', function () {
+ return new BeanstalkdConnector;
+ });
+ }
+
+ /**
+ * Register the database queue connector.
+ *
+ * @param \Illuminate\Queue\QueueManager $manager
+ * @return void
+ */
+ protected function registerDatabaseConnector($manager)
+ {
+ $manager->addConnector('database', function () {
+ return new DatabaseConnector($this->app['db']);
+ });
+ }
+
+ /**
+ * Register the Redis queue connector.
+ *
+ * @param \Illuminate\Queue\QueueManager $manager
+ * @return void
+ */
+ protected function registerRedisConnector($manager)
+ {
+ $app = $this->app;
+
+ $manager->addConnector('redis', function () use ($app) {
+ return new RedisConnector($app['redis']);
+ });
+ }
+
+ /**
+ * Register the Amazon SQS queue connector.
+ *
+ * @param \Illuminate\Queue\QueueManager $manager
+ * @return void
+ */
+ protected function registerSqsConnector($manager)
+ {
+ $manager->addConnector('sqs', function () {
+ return new SqsConnector;
+ });
+ }
+
+ /**
+ * Register the IronMQ queue connector.
+ *
+ * @param \Illuminate\Queue\QueueManager $manager
+ * @return void
+ */
+ protected function registerIronConnector($manager)
+ {
+ $app = $this->app;
+
+ $manager->addConnector('iron', function () use ($app) {
+ return new IronConnector($app['encrypter'], $app['request']);
+ });
+
+ $this->registerIronRequestBinder();
+ }
+
+ /**
+ * Register the request rebinding event for the Iron queue.
+ *
+ * @return void
+ */
+ protected function registerIronRequestBinder()
+ {
+ $this->app->rebinding('request', function ($app, $request) {
+ if ($app['queue']->connected('iron')) {
+ $app['queue']->connection('iron')->setRequest($request);
+ }
+ });
+ }
+
+ /**
+ * Register the failed job services.
+ *
+ * @return void
+ */
+ protected function registerFailedJobServices()
+ {
+ $this->app->singleton('queue.failer', function ($app) {
+ $config = $app['config']['queue.failed'];
+
+ if (isset($config['table'])) {
+ return new DatabaseFailedJobProvider($app['db'], $config['database'], $config['table']);
+ } else {
+ return new NullFailedJobProvider;
+ }
+ });
+ }
+
+ /**
+ * Register the Illuminate queued closure job.
+ *
+ * @return void
+ */
+ protected function registerQueueClosure()
+ {
+ $this->app->singleton('IlluminateQueueClosure', function ($app) {
+ return new IlluminateQueueClosure($app['encrypter']);
+ });
+ }
+
+ /**
+ * Get the services provided by the provider.
+ *
+ * @return array
+ */
+ public function provides()
+ {
+ return [
+ 'queue', 'queue.worker', 'queue.listener', 'queue.failer',
+ 'command.queue.work', 'command.queue.listen', 'command.queue.restart',
+ 'command.queue.subscribe', 'queue.connection',
+ ];
+ }
+}
diff --git a/vendor/illuminate/queue/README.md b/vendor/illuminate/queue/README.md
new file mode 100644
index 00000000..e6a715bc
--- /dev/null
+++ b/vendor/illuminate/queue/README.md
@@ -0,0 +1,34 @@
+## Illuminate Queue
+
+The Laravel Queue component provides a unified API across a variety of different queue services. Queues allow you to defer the processing of a time consuming task, such as sending an e-mail, until a later time, thus drastically speeding up the web requests to your application.
+
+### Usage Instructions
+
+First, create a new Queue `Capsule` manager instance. Similar to the "Capsule" provided for the Eloquent ORM, the queue Capsule aims to make configuring the library for usage outside of the Laravel framework as easy as possible.
+
+```PHP
+use Illuminate\Queue\Capsule\Manager as Queue;
+
+$queue = new Queue;
+
+$queue->addConnection([
+ 'driver' => 'beanstalkd',
+ 'host' => 'localhost',
+ 'queue' => 'default',
+]);
+
+// Make this Capsule instance available globally via static methods... (optional)
+$queue->setAsGlobal();
+```
+
+Once the Capsule instance has been registered. You may use it like so:
+
+```PHP
+// As an instance...
+$queue->push('SendEmail', array('message' => $message));
+
+// If setAsGlobal has been called...
+Queue::push('SendEmail', array('message' => $message));
+```
+
+For further documentation on using the queue, consult the [Laravel framework documentation](http://laravel.com/docs).
diff --git a/vendor/illuminate/queue/RedisQueue.php b/vendor/illuminate/queue/RedisQueue.php
new file mode 100644
index 00000000..acd36ab2
--- /dev/null
+++ b/vendor/illuminate/queue/RedisQueue.php
@@ -0,0 +1,319 @@
+redis = $redis;
+ $this->default = $default;
+ $this->connection = $connection;
+ }
+
+ /**
+ * Push a new job onto the queue.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function push($job, $data = '', $queue = null)
+ {
+ return $this->pushRaw($this->createPayload($job, $data), $queue);
+ }
+
+ /**
+ * Push a raw payload onto the queue.
+ *
+ * @param string $payload
+ * @param string $queue
+ * @param array $options
+ * @return mixed
+ */
+ public function pushRaw($payload, $queue = null, array $options = [])
+ {
+ $this->getConnection()->rpush($this->getQueue($queue), $payload);
+
+ return Arr::get(json_decode($payload, true), 'id');
+ }
+
+ /**
+ * Push a new job onto the queue after a delay.
+ *
+ * @param \DateTime|int $delay
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function later($delay, $job, $data = '', $queue = null)
+ {
+ $payload = $this->createPayload($job, $data);
+
+ $delay = $this->getSeconds($delay);
+
+ $this->getConnection()->zadd($this->getQueue($queue).':delayed', $this->getTime() + $delay, $payload);
+
+ return Arr::get(json_decode($payload, true), 'id');
+ }
+
+ /**
+ * Release a reserved job back onto the queue.
+ *
+ * @param string $queue
+ * @param string $payload
+ * @param int $delay
+ * @param int $attempts
+ * @return void
+ */
+ public function release($queue, $payload, $delay, $attempts)
+ {
+ $payload = $this->setMeta($payload, 'attempts', $attempts);
+
+ $this->getConnection()->zadd($this->getQueue($queue).':delayed', $this->getTime() + $delay, $payload);
+ }
+
+ /**
+ * Pop the next job off of the queue.
+ *
+ * @param string $queue
+ * @return \Illuminate\Contracts\Queue\Job|null
+ */
+ public function pop($queue = null)
+ {
+ $original = $queue ?: $this->default;
+
+ $queue = $this->getQueue($queue);
+
+ if (! is_null($this->expire)) {
+ $this->migrateAllExpiredJobs($queue);
+ }
+
+ $job = $this->getConnection()->lpop($queue);
+
+ if (! is_null($job)) {
+ $this->getConnection()->zadd($queue.':reserved', $this->getTime() + $this->expire, $job);
+
+ return new RedisJob($this->container, $this, $job, $original);
+ }
+ }
+
+ /**
+ * Delete a reserved job from the queue.
+ *
+ * @param string $queue
+ * @param string $job
+ * @return void
+ */
+ public function deleteReserved($queue, $job)
+ {
+ $this->getConnection()->zrem($this->getQueue($queue).':reserved', $job);
+ }
+
+ /**
+ * Migrate all of the waiting jobs in the queue.
+ *
+ * @param string $queue
+ * @return void
+ */
+ protected function migrateAllExpiredJobs($queue)
+ {
+ $this->migrateExpiredJobs($queue.':delayed', $queue);
+
+ $this->migrateExpiredJobs($queue.':reserved', $queue);
+ }
+
+ /**
+ * Migrate the delayed jobs that are ready to the regular queue.
+ *
+ * @param string $from
+ * @param string $to
+ * @return void
+ */
+ public function migrateExpiredJobs($from, $to)
+ {
+ $options = ['cas' => true, 'watch' => $from, 'retry' => 10];
+
+ $this->getConnection()->transaction($options, function ($transaction) use ($from, $to) {
+ // First we need to get all of jobs that have expired based on the current time
+ // so that we can push them onto the main queue. After we get them we simply
+ // remove them from this "delay" queues. All of this within a transaction.
+ $jobs = $this->getExpiredJobs(
+ $transaction, $from, $time = $this->getTime()
+ );
+
+ // If we actually found any jobs, we will remove them from the old queue and we
+ // will insert them onto the new (ready) "queue". This means they will stand
+ // ready to be processed by the queue worker whenever their turn comes up.
+ if (count($jobs) > 0) {
+ $this->removeExpiredJobs($transaction, $from, $time);
+
+ $this->pushExpiredJobsOntoNewQueue($transaction, $to, $jobs);
+ }
+ });
+ }
+
+ /**
+ * Get the expired jobs from a given queue.
+ *
+ * @param \Predis\Transaction\MultiExec $transaction
+ * @param string $from
+ * @param int $time
+ * @return array
+ */
+ protected function getExpiredJobs($transaction, $from, $time)
+ {
+ return $transaction->zrangebyscore($from, '-inf', $time);
+ }
+
+ /**
+ * Remove the expired jobs from a given queue.
+ *
+ * @param \Predis\Transaction\MultiExec $transaction
+ * @param string $from
+ * @param int $time
+ * @return void
+ */
+ protected function removeExpiredJobs($transaction, $from, $time)
+ {
+ $transaction->multi();
+
+ $transaction->zremrangebyscore($from, '-inf', $time);
+ }
+
+ /**
+ * Push all of the given jobs onto another queue.
+ *
+ * @param \Predis\Transaction\MultiExec $transaction
+ * @param string $to
+ * @param array $jobs
+ * @return void
+ */
+ protected function pushExpiredJobsOntoNewQueue($transaction, $to, $jobs)
+ {
+ call_user_func_array([$transaction, 'rpush'], array_merge([$to], $jobs));
+ }
+
+ /**
+ * Create a payload string from the given job and data.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return string
+ */
+ protected function createPayload($job, $data = '', $queue = null)
+ {
+ $payload = parent::createPayload($job, $data);
+
+ $payload = $this->setMeta($payload, 'id', $this->getRandomId());
+
+ return $this->setMeta($payload, 'attempts', 1);
+ }
+
+ /**
+ * Get a random ID string.
+ *
+ * @return string
+ */
+ protected function getRandomId()
+ {
+ return Str::random(32);
+ }
+
+ /**
+ * Get the queue or return the default.
+ *
+ * @param string|null $queue
+ * @return string
+ */
+ protected function getQueue($queue)
+ {
+ return 'queues:'.($queue ?: $this->default);
+ }
+
+ /**
+ * Get the connection for the queue.
+ *
+ * @return \Predis\ClientInterface
+ */
+ protected function getConnection()
+ {
+ return $this->redis->connection($this->connection);
+ }
+
+ /**
+ * Get the underlying Redis instance.
+ *
+ * @return \Illuminate\Redis\Database
+ */
+ public function getRedis()
+ {
+ return $this->redis;
+ }
+
+ /**
+ * Get the expiration time in seconds.
+ *
+ * @return int|null
+ */
+ public function getExpire()
+ {
+ return $this->expire;
+ }
+
+ /**
+ * Set the expiration time in seconds.
+ *
+ * @param int|null $seconds
+ * @return void
+ */
+ public function setExpire($seconds)
+ {
+ $this->expire = $seconds;
+ }
+}
diff --git a/vendor/illuminate/queue/SerializesModels.php b/vendor/illuminate/queue/SerializesModels.php
new file mode 100644
index 00000000..9ad9cf79
--- /dev/null
+++ b/vendor/illuminate/queue/SerializesModels.php
@@ -0,0 +1,83 @@
+getProperties();
+
+ foreach ($properties as $property) {
+ $property->setValue($this, $this->getSerializedPropertyValue(
+ $this->getPropertyValue($property)
+ ));
+ }
+
+ return array_map(function ($p) {
+ return $p->getName();
+ }, $properties);
+ }
+
+ /**
+ * Restore the model after serialization.
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ foreach ((new ReflectionClass($this))->getProperties() as $property) {
+ $property->setValue($this, $this->getRestoredPropertyValue(
+ $this->getPropertyValue($property)
+ ));
+ }
+ }
+
+ /**
+ * Get the property value prepared for serialization.
+ *
+ * @param mixed $value
+ * @return mixed
+ */
+ protected function getSerializedPropertyValue($value)
+ {
+ return $value instanceof QueueableEntity
+ ? new ModelIdentifier(get_class($value), $value->getQueueableId()) : $value;
+ }
+
+ /**
+ * Get the restored property value after deserialization.
+ *
+ * @param mixed $value
+ * @return mixed
+ */
+ protected function getRestoredPropertyValue($value)
+ {
+ return $value instanceof ModelIdentifier
+ ? (new $value->class)->newQuery()->useWritePdo()->findOrFail($value->id)
+ : $value;
+ }
+
+ /**
+ * Get the property value for the given property.
+ *
+ * @param \ReflectionProperty $property
+ * @return mixed
+ */
+ protected function getPropertyValue(ReflectionProperty $property)
+ {
+ $property->setAccessible(true);
+
+ return $property->getValue($this);
+ }
+}
diff --git a/vendor/illuminate/queue/SqsQueue.php b/vendor/illuminate/queue/SqsQueue.php
new file mode 100644
index 00000000..77609d11
--- /dev/null
+++ b/vendor/illuminate/queue/SqsQueue.php
@@ -0,0 +1,165 @@
+sqs = $sqs;
+ $this->prefix = $prefix;
+ $this->default = $default;
+ }
+
+ /**
+ * Push a new job onto the queue.
+ *
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function push($job, $data = '', $queue = null)
+ {
+ return $this->pushRaw($this->createPayload($job, $data), $queue);
+ }
+
+ /**
+ * Push a raw payload onto the queue.
+ *
+ * @param string $payload
+ * @param string $queue
+ * @param array $options
+ * @return mixed
+ */
+ public function pushRaw($payload, $queue = null, array $options = [])
+ {
+ $response = $this->sqs->sendMessage(['QueueUrl' => $this->getQueue($queue), 'MessageBody' => $payload]);
+
+ return $response->get('MessageId');
+ }
+
+ /**
+ * Push a new job onto the queue after a delay.
+ *
+ * @param \DateTime|int $delay
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function later($delay, $job, $data = '', $queue = null)
+ {
+ $payload = $this->createPayload($job, $data);
+
+ $delay = $this->getSeconds($delay);
+
+ return $this->sqs->sendMessage([
+ 'QueueUrl' => $this->getQueue($queue), 'MessageBody' => $payload, 'DelaySeconds' => $delay,
+
+ ])->get('MessageId');
+ }
+
+ /**
+ * Pop the next job off of the queue.
+ *
+ * @param string $queue
+ * @return \Illuminate\Contracts\Queue\Job|null
+ */
+ public function pop($queue = null)
+ {
+ $queue = $this->getQueue($queue);
+
+ $response = $this->sqs->receiveMessage(
+ ['QueueUrl' => $queue, 'AttributeNames' => ['ApproximateReceiveCount']]
+ );
+
+ if (count($response['Messages']) > 0) {
+ if ($this->jobCreator) {
+ return call_user_func($this->jobCreator, $this->container, $this->sqs, $queue, $response);
+ } else {
+ return new SqsJob($this->container, $this->sqs, $queue, $response['Messages'][0]);
+ }
+ }
+ }
+
+ /**
+ * Define the job creator callback for the connection.
+ *
+ * @param callable $callback
+ * @return $this
+ */
+ public function createJobsUsing(callable $callback)
+ {
+ $this->jobCreator = $callback;
+
+ return $this;
+ }
+
+ /**
+ * Get the queue or return the default.
+ *
+ * @param string|null $queue
+ * @return string
+ */
+ public function getQueue($queue)
+ {
+ $queue = $queue ?: $this->default;
+
+ if (filter_var($queue, FILTER_VALIDATE_URL) !== false) {
+ return $queue;
+ }
+
+ return rtrim($this->prefix, '/').'/'.($queue);
+ }
+
+ /**
+ * Get the underlying SQS instance.
+ *
+ * @return \Aws\Sqs\SqsClient
+ */
+ public function getSqs()
+ {
+ return $this->sqs;
+ }
+}
diff --git a/vendor/illuminate/queue/SyncQueue.php b/vendor/illuminate/queue/SyncQueue.php
new file mode 100644
index 00000000..de8db22a
--- /dev/null
+++ b/vendor/illuminate/queue/SyncQueue.php
@@ -0,0 +1,134 @@
+resolveJob($this->createPayload($job, $data, $queue));
+
+ try {
+ $queueJob->fire();
+
+ $this->raiseAfterJobEvent($queueJob);
+ } catch (Exception $e) {
+ $this->handleFailedJob($queueJob);
+
+ throw $e;
+ } catch (Throwable $e) {
+ $this->handleFailedJob($queueJob);
+
+ throw $e;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Push a raw payload onto the queue.
+ *
+ * @param string $payload
+ * @param string $queue
+ * @param array $options
+ * @return mixed
+ */
+ public function pushRaw($payload, $queue = null, array $options = [])
+ {
+ //
+ }
+
+ /**
+ * Push a new job onto the queue after a delay.
+ *
+ * @param \DateTime|int $delay
+ * @param string $job
+ * @param mixed $data
+ * @param string $queue
+ * @return mixed
+ */
+ public function later($delay, $job, $data = '', $queue = null)
+ {
+ return $this->push($job, $data, $queue);
+ }
+
+ /**
+ * Pop the next job off of the queue.
+ *
+ * @param string $queue
+ * @return \Illuminate\Contracts\Queue\Job|null
+ */
+ public function pop($queue = null)
+ {
+ //
+ }
+
+ /**
+ * Resolve a Sync job instance.
+ *
+ * @param string $payload
+ * @return \Illuminate\Queue\Jobs\SyncJob
+ */
+ protected function resolveJob($payload)
+ {
+ return new SyncJob($this->container, $payload);
+ }
+
+ /**
+ * Raise the after queue job event.
+ *
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @return void
+ */
+ protected function raiseAfterJobEvent(Job $job)
+ {
+ $data = json_decode($job->getRawBody(), true);
+
+ if ($this->container->bound('events')) {
+ $this->container['events']->fire('illuminate.queue.after', ['sync', $job, $data]);
+ }
+ }
+
+ /**
+ * Handle the failed job.
+ *
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @return array
+ */
+ protected function handleFailedJob(Job $job)
+ {
+ $job->failed();
+
+ $this->raiseFailedJobEvent($job);
+ }
+
+ /**
+ * Raise the failed queue job event.
+ *
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @return void
+ */
+ protected function raiseFailedJobEvent(Job $job)
+ {
+ $data = json_decode($job->getRawBody(), true);
+
+ if ($this->container->bound('events')) {
+ $this->container['events']->fire('illuminate.queue.failed', ['sync', $job, $data]);
+ }
+ }
+}
diff --git a/vendor/illuminate/queue/Worker.php b/vendor/illuminate/queue/Worker.php
new file mode 100644
index 00000000..7f653374
--- /dev/null
+++ b/vendor/illuminate/queue/Worker.php
@@ -0,0 +1,384 @@
+failer = $failer;
+ $this->events = $events;
+ $this->manager = $manager;
+ }
+
+ /**
+ * Listen to the given queue in a loop.
+ *
+ * @param string $connectionName
+ * @param string $queue
+ * @param int $delay
+ * @param int $memory
+ * @param int $sleep
+ * @param int $maxTries
+ * @return array
+ */
+ public function daemon($connectionName, $queue = null, $delay = 0, $memory = 128, $sleep = 3, $maxTries = 0)
+ {
+ $lastRestart = $this->getTimestampOfLastQueueRestart();
+
+ while (true) {
+ if ($this->daemonShouldRun()) {
+ $this->runNextJobForDaemon(
+ $connectionName, $queue, $delay, $sleep, $maxTries
+ );
+ } else {
+ $this->sleep($sleep);
+ }
+
+ if ($this->memoryExceeded($memory) || $this->queueShouldRestart($lastRestart)) {
+ $this->stop();
+ }
+ }
+ }
+
+ /**
+ * Run the next job for the daemon worker.
+ *
+ * @param string $connectionName
+ * @param string $queue
+ * @param int $delay
+ * @param int $sleep
+ * @param int $maxTries
+ * @return void
+ */
+ protected function runNextJobForDaemon($connectionName, $queue, $delay, $sleep, $maxTries)
+ {
+ try {
+ $this->pop($connectionName, $queue, $delay, $sleep, $maxTries);
+ } catch (Exception $e) {
+ if ($this->exceptions) {
+ $this->exceptions->report($e);
+ }
+ } catch (Throwable $e) {
+ if ($this->exceptions) {
+ $this->exceptions->report(new FatalThrowableError($e));
+ }
+ }
+ }
+
+ /**
+ * Determine if the daemon should process on this iteration.
+ *
+ * @return bool
+ */
+ protected function daemonShouldRun()
+ {
+ if ($this->manager->isDownForMaintenance()) {
+ return false;
+ }
+
+ return $this->events->until('illuminate.queue.looping') !== false;
+ }
+
+ /**
+ * Listen to the given queue.
+ *
+ * @param string $connectionName
+ * @param string $queue
+ * @param int $delay
+ * @param int $sleep
+ * @param int $maxTries
+ * @return array
+ */
+ public function pop($connectionName, $queue = null, $delay = 0, $sleep = 3, $maxTries = 0)
+ {
+ $connection = $this->manager->connection($connectionName);
+
+ $job = $this->getNextJob($connection, $queue);
+
+ // If we're able to pull a job off of the stack, we will process it and
+ // then immediately return back out. If there is no job on the queue
+ // we will "sleep" the worker for the specified number of seconds.
+ if (! is_null($job)) {
+ return $this->process(
+ $this->manager->getName($connectionName), $job, $maxTries, $delay
+ );
+ }
+
+ $this->sleep($sleep);
+
+ return ['job' => null, 'failed' => false];
+ }
+
+ /**
+ * Get the next job from the queue connection.
+ *
+ * @param \Illuminate\Contracts\Queue\Queue $connection
+ * @param string $queue
+ * @return \Illuminate\Contracts\Queue\Job|null
+ */
+ protected function getNextJob($connection, $queue)
+ {
+ if (is_null($queue)) {
+ return $connection->pop();
+ }
+
+ foreach (explode(',', $queue) as $queue) {
+ if (! is_null($job = $connection->pop($queue))) {
+ return $job;
+ }
+ }
+ }
+
+ /**
+ * Process a given job from the queue.
+ *
+ * @param string $connection
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @param int $maxTries
+ * @param int $delay
+ * @return array|null
+ *
+ * @throws \Throwable
+ */
+ public function process($connection, Job $job, $maxTries = 0, $delay = 0)
+ {
+ if ($maxTries > 0 && $job->attempts() > $maxTries) {
+ return $this->logFailedJob($connection, $job);
+ }
+
+ try {
+ // First we will fire off the job. Once it is done we will see if it will
+ // be auto-deleted after processing and if so we will go ahead and run
+ // the delete method on the job. Otherwise we will just keep moving.
+ $job->fire();
+
+ $this->raiseAfterJobEvent($connection, $job);
+
+ return ['job' => $job, 'failed' => false];
+ } catch (Exception $e) {
+ // If we catch an exception, we will attempt to release the job back onto
+ // the queue so it is not lost. This will let is be retried at a later
+ // time by another listener (or the same one). We will do that here.
+ if (! $job->isDeleted()) {
+ $job->release($delay);
+ }
+
+ throw $e;
+ } catch (Throwable $e) {
+ if (! $job->isDeleted()) {
+ $job->release($delay);
+ }
+
+ throw $e;
+ }
+ }
+
+ /**
+ * Raise the after queue job event.
+ *
+ * @param string $connection
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @return void
+ */
+ protected function raiseAfterJobEvent($connection, Job $job)
+ {
+ if ($this->events) {
+ $data = json_decode($job->getRawBody(), true);
+
+ $this->events->fire('illuminate.queue.after', [$connection, $job, $data]);
+ }
+ }
+
+ /**
+ * Log a failed job into storage.
+ *
+ * @param string $connection
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @return array
+ */
+ protected function logFailedJob($connection, Job $job)
+ {
+ if ($this->failer) {
+ $this->failer->log($connection, $job->getQueue(), $job->getRawBody());
+
+ $job->delete();
+
+ $job->failed();
+
+ $this->raiseFailedJobEvent($connection, $job);
+ }
+
+ return ['job' => $job, 'failed' => true];
+ }
+
+ /**
+ * Raise the failed queue job event.
+ *
+ * @param string $connection
+ * @param \Illuminate\Contracts\Queue\Job $job
+ * @return void
+ */
+ protected function raiseFailedJobEvent($connection, Job $job)
+ {
+ if ($this->events) {
+ $data = json_decode($job->getRawBody(), true);
+
+ $this->events->fire('illuminate.queue.failed', [$connection, $job, $data]);
+ }
+ }
+
+ /**
+ * Determine if the memory limit has been exceeded.
+ *
+ * @param int $memoryLimit
+ * @return bool
+ */
+ public function memoryExceeded($memoryLimit)
+ {
+ return (memory_get_usage() / 1024 / 1024) >= $memoryLimit;
+ }
+
+ /**
+ * Stop listening and bail out of the script.
+ *
+ * @return void
+ */
+ public function stop()
+ {
+ $this->events->fire('illuminate.queue.stopping');
+
+ die;
+ }
+
+ /**
+ * Sleep the script for a given number of seconds.
+ *
+ * @param int $seconds
+ * @return void
+ */
+ public function sleep($seconds)
+ {
+ sleep($seconds);
+ }
+
+ /**
+ * Get the last queue restart timestamp, or null.
+ *
+ * @return int|null
+ */
+ protected function getTimestampOfLastQueueRestart()
+ {
+ if ($this->cache) {
+ return $this->cache->get('illuminate:queue:restart');
+ }
+ }
+
+ /**
+ * Determine if the queue worker should restart.
+ *
+ * @param int|null $lastRestart
+ * @return bool
+ */
+ protected function queueShouldRestart($lastRestart)
+ {
+ return $this->getTimestampOfLastQueueRestart() != $lastRestart;
+ }
+
+ /**
+ * Set the exception handler to use in Daemon mode.
+ *
+ * @param \Illuminate\Contracts\Debug\ExceptionHandler $handler
+ * @return void
+ */
+ public function setDaemonExceptionHandler(ExceptionHandler $handler)
+ {
+ $this->exceptions = $handler;
+ }
+
+ /**
+ * Set the cache repository implementation.
+ *
+ * @param \Illuminate\Contracts\Cache\Repository $cache
+ * @return void
+ */
+ public function setCache(CacheContract $cache)
+ {
+ $this->cache = $cache;
+ }
+
+ /**
+ * Get the queue manager instance.
+ *
+ * @return \Illuminate\Queue\QueueManager
+ */
+ public function getManager()
+ {
+ return $this->manager;
+ }
+
+ /**
+ * Set the queue manager instance.
+ *
+ * @param \Illuminate\Queue\QueueManager $manager
+ * @return void
+ */
+ public function setManager(QueueManager $manager)
+ {
+ $this->manager = $manager;
+ }
+}
diff --git a/vendor/illuminate/queue/composer.json b/vendor/illuminate/queue/composer.json
new file mode 100644
index 00000000..84f2edd7
--- /dev/null
+++ b/vendor/illuminate/queue/composer.json
@@ -0,0 +1,47 @@
+{
+ "name": "illuminate/queue",
+ "description": "The Illuminate Queue package.",
+ "license": "MIT",
+ "homepage": "http://laravel.com",
+ "support": {
+ "issues": "https://github.com/laravel/framework/issues",
+ "source": "https://github.com/laravel/framework"
+ },
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylorotwell@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.5.9",
+ "illuminate/console": "5.1.*",
+ "illuminate/contracts": "5.1.*",
+ "illuminate/container": "5.1.*",
+ "illuminate/http": "5.1.*",
+ "illuminate/support": "5.1.*",
+ "symfony/process": "2.7.*",
+ "symfony/debug": "2.7.*",
+ "nesbot/carbon": "~1.19"
+ },
+ "autoload": {
+ "psr-4": {
+ "Illuminate\\Queue\\": ""
+ },
+ "classmap": [
+ "IlluminateQueueClosure.php"
+ ]
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "suggest": {
+ "aws/aws-sdk-php": "Required to use the SQS queue driver (~3.0).",
+ "illuminate/redis": "Required to use the redis queue driver (5.1.*).",
+ "iron-io/iron_mq": "Required to use the iron queue driver (~2.0).",
+ "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0)."
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/illuminate/session/CacheBasedSessionHandler.php b/vendor/illuminate/session/CacheBasedSessionHandler.php
new file mode 100644
index 00000000..a2990bdd
--- /dev/null
+++ b/vendor/illuminate/session/CacheBasedSessionHandler.php
@@ -0,0 +1,94 @@
+cache = $cache;
+ $this->minutes = $minutes;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function open($savePath, $sessionName)
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function close()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function read($sessionId)
+ {
+ return $this->cache->get($sessionId, '');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($sessionId, $data)
+ {
+ return $this->cache->put($sessionId, $data, $this->minutes);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy($sessionId)
+ {
+ return $this->cache->forget($sessionId);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function gc($lifetime)
+ {
+ return true;
+ }
+
+ /**
+ * Get the underlying cache repository.
+ *
+ * @return \Illuminate\Contracts\Cache\Repository
+ */
+ public function getCache()
+ {
+ return $this->cache;
+ }
+}
diff --git a/vendor/illuminate/session/CommandsServiceProvider.php b/vendor/illuminate/session/CommandsServiceProvider.php
new file mode 100644
index 00000000..9514c4f0
--- /dev/null
+++ b/vendor/illuminate/session/CommandsServiceProvider.php
@@ -0,0 +1,40 @@
+app->singleton('command.session.database', function ($app) {
+ return new SessionTableCommand($app['files'], $app['composer']);
+ });
+
+ $this->commands('command.session.database');
+ }
+
+ /**
+ * Get the services provided by the provider.
+ *
+ * @return array
+ */
+ public function provides()
+ {
+ return ['command.session.database'];
+ }
+}
diff --git a/vendor/illuminate/session/Console/SessionTableCommand.php b/vendor/illuminate/session/Console/SessionTableCommand.php
new file mode 100644
index 00000000..2290d3cf
--- /dev/null
+++ b/vendor/illuminate/session/Console/SessionTableCommand.php
@@ -0,0 +1,81 @@
+files = $files;
+ $this->composer = $composer;
+ }
+
+ /**
+ * Execute the console command.
+ *
+ * @return void
+ */
+ public function fire()
+ {
+ $fullPath = $this->createBaseMigration();
+
+ $this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/database.stub'));
+
+ $this->info('Migration created successfully!');
+
+ $this->composer->dumpAutoloads();
+ }
+
+ /**
+ * Create a base migration file for the session.
+ *
+ * @return string
+ */
+ protected function createBaseMigration()
+ {
+ $name = 'create_sessions_table';
+
+ $path = $this->laravel->databasePath().'/migrations';
+
+ return $this->laravel['migration.creator']->create($name, $path);
+ }
+}
diff --git a/vendor/illuminate/session/Console/stubs/database.stub b/vendor/illuminate/session/Console/stubs/database.stub
new file mode 100644
index 00000000..05297559
--- /dev/null
+++ b/vendor/illuminate/session/Console/stubs/database.stub
@@ -0,0 +1,31 @@
+string('id')->unique();
+ $table->text('payload');
+ $table->integer('last_activity');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('sessions');
+ }
+}
diff --git a/vendor/illuminate/session/CookieSessionHandler.php b/vendor/illuminate/session/CookieSessionHandler.php
new file mode 100644
index 00000000..0a9bac6d
--- /dev/null
+++ b/vendor/illuminate/session/CookieSessionHandler.php
@@ -0,0 +1,108 @@
+cookie = $cookie;
+ $this->minutes = $minutes;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function open($savePath, $sessionName)
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function close()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function read($sessionId)
+ {
+ $value = $this->request->cookies->get($sessionId) ?: '';
+
+ if (! is_null($decoded = json_decode($value, true)) && is_array($decoded)) {
+ if (isset($decoded['expires']) && time() <= $decoded['expires']) {
+ return $decoded['data'];
+ }
+ }
+
+ return '';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($sessionId, $data)
+ {
+ $this->cookie->queue($sessionId, json_encode([
+ 'data' => $data,
+ 'expires' => Carbon::now()->addMinutes($this->minutes)->getTimestamp(),
+ ]), $this->minutes);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy($sessionId)
+ {
+ $this->cookie->queue($this->cookie->forget($sessionId));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function gc($lifetime)
+ {
+ return true;
+ }
+
+ /**
+ * Set the request instance.
+ *
+ * @param \Symfony\Component\HttpFoundation\Request $request
+ * @return void
+ */
+ public function setRequest(Request $request)
+ {
+ $this->request = $request;
+ }
+}
diff --git a/vendor/illuminate/session/DatabaseSessionHandler.php b/vendor/illuminate/session/DatabaseSessionHandler.php
new file mode 100644
index 00000000..dbc83bb7
--- /dev/null
+++ b/vendor/illuminate/session/DatabaseSessionHandler.php
@@ -0,0 +1,148 @@
+table = $table;
+ $this->minutes = $minutes;
+ $this->connection = $connection;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function open($savePath, $sessionName)
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function close()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function read($sessionId)
+ {
+ $session = (object) $this->getQuery()->find($sessionId);
+
+ if (isset($session->last_activity)) {
+ if ($session->last_activity < Carbon::now()->subMinutes($this->minutes)->getTimestamp()) {
+ $this->exists = true;
+
+ return;
+ }
+ }
+
+ if (isset($session->payload)) {
+ $this->exists = true;
+
+ return base64_decode($session->payload);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($sessionId, $data)
+ {
+ if ($this->exists) {
+ $this->getQuery()->where('id', $sessionId)->update([
+ 'payload' => base64_encode($data), 'last_activity' => time(),
+ ]);
+ } else {
+ $this->getQuery()->insert([
+ 'id' => $sessionId, 'payload' => base64_encode($data), 'last_activity' => time(),
+ ]);
+ }
+
+ $this->exists = true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy($sessionId)
+ {
+ $this->getQuery()->where('id', $sessionId)->delete();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function gc($lifetime)
+ {
+ $this->getQuery()->where('last_activity', '<=', time() - $lifetime)->delete();
+ }
+
+ /**
+ * Get a fresh query builder instance for the table.
+ *
+ * @return \Illuminate\Database\Query\Builder
+ */
+ protected function getQuery()
+ {
+ return $this->connection->table($this->table);
+ }
+
+ /**
+ * Set the existence state for the session.
+ *
+ * @param bool $value
+ * @return $this
+ */
+ public function setExists($value)
+ {
+ $this->exists = $value;
+
+ return $this;
+ }
+}
diff --git a/vendor/illuminate/session/EncryptedStore.php b/vendor/illuminate/session/EncryptedStore.php
new file mode 100644
index 00000000..9811d972
--- /dev/null
+++ b/vendor/illuminate/session/EncryptedStore.php
@@ -0,0 +1,69 @@
+encrypter = $encrypter;
+
+ parent::__construct($name, $handler, $id);
+ }
+
+ /**
+ * Prepare the raw string data from the session for unserialization.
+ *
+ * @param string $data
+ * @return string
+ */
+ protected function prepareForUnserialize($data)
+ {
+ try {
+ return $this->encrypter->decrypt($data);
+ } catch (DecryptException $e) {
+ return json_encode([]);
+ }
+ }
+
+ /**
+ * Prepare the serialized session data for storage.
+ *
+ * @param string $data
+ * @return string
+ */
+ protected function prepareForStorage($data)
+ {
+ return $this->encrypter->encrypt($data);
+ }
+
+ /**
+ * Get the encrypter instance.
+ *
+ * @return \Illuminate\Contracts\Encryption\Encrypter
+ */
+ public function getEncrypter()
+ {
+ return $this->encrypter;
+ }
+}
diff --git a/vendor/illuminate/session/ExistenceAwareInterface.php b/vendor/illuminate/session/ExistenceAwareInterface.php
new file mode 100644
index 00000000..4a6bd984
--- /dev/null
+++ b/vendor/illuminate/session/ExistenceAwareInterface.php
@@ -0,0 +1,14 @@
+path = $path;
+ $this->files = $files;
+ $this->minutes = $minutes;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function open($savePath, $sessionName)
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function close()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function read($sessionId)
+ {
+ if ($this->files->exists($path = $this->path.'/'.$sessionId)) {
+ if (filemtime($path) >= Carbon::now()->subMinutes($this->minutes)->getTimestamp()) {
+ return $this->files->get($path);
+ }
+ }
+
+ return '';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($sessionId, $data)
+ {
+ $this->files->put($this->path.'/'.$sessionId, $data, true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy($sessionId)
+ {
+ $this->files->delete($this->path.'/'.$sessionId);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function gc($lifetime)
+ {
+ $files = Finder::create()
+ ->in($this->path)
+ ->files()
+ ->ignoreDotFiles(true)
+ ->date('<= now - '.$lifetime.' seconds');
+
+ foreach ($files as $file) {
+ $this->files->delete($file->getRealPath());
+ }
+ }
+}
diff --git a/vendor/illuminate/session/Middleware/StartSession.php b/vendor/illuminate/session/Middleware/StartSession.php
new file mode 100644
index 00000000..cf216e93
--- /dev/null
+++ b/vendor/illuminate/session/Middleware/StartSession.php
@@ -0,0 +1,244 @@
+manager = $manager;
+ }
+
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ * @return mixed
+ */
+ public function handle($request, Closure $next)
+ {
+ $this->sessionHandled = true;
+
+ // If a session driver has been configured, we will need to start the session here
+ // so that the data is ready for an application. Note that the Laravel sessions
+ // do not make use of PHP "native" sessions in any way since they are crappy.
+ if ($this->sessionConfigured()) {
+ $session = $this->startSession($request);
+
+ $request->setSession($session);
+ }
+
+ $response = $next($request);
+
+ // Again, if the session has been configured we will need to close out the session
+ // so that the attributes may be persisted to some storage medium. We will also
+ // add the session identifier cookie to the application response headers now.
+ if ($this->sessionConfigured()) {
+ $this->storeCurrentUrl($request, $session);
+
+ $this->collectGarbage($session);
+
+ $this->addCookieToResponse($response, $session);
+ }
+
+ return $response;
+ }
+
+ /**
+ * Perform any final actions for the request lifecycle.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Symfony\Component\HttpFoundation\Response $response
+ * @return void
+ */
+ public function terminate($request, $response)
+ {
+ if ($this->sessionHandled && $this->sessionConfigured() && ! $this->usingCookieSessions()) {
+ $this->manager->driver()->save();
+ }
+ }
+
+ /**
+ * Start the session for the given request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @return \Illuminate\Session\SessionInterface
+ */
+ protected function startSession(Request $request)
+ {
+ with($session = $this->getSession($request))->setRequestOnHandler($request);
+
+ $session->start();
+
+ return $session;
+ }
+
+ /**
+ * Get the session implementation from the manager.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @return \Illuminate\Session\SessionInterface
+ */
+ public function getSession(Request $request)
+ {
+ $session = $this->manager->driver();
+
+ $session->setId($request->cookies->get($session->getName()));
+
+ return $session;
+ }
+
+ /**
+ * Store the current URL for the request if necessary.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Illuminate\Session\SessionInterface $session
+ * @return void
+ */
+ protected function storeCurrentUrl(Request $request, $session)
+ {
+ if ($request->method() === 'GET' && $request->route() && ! $request->ajax()) {
+ $session->setPreviousUrl($request->fullUrl());
+ }
+ }
+
+ /**
+ * Remove the garbage from the session if necessary.
+ *
+ * @param \Illuminate\Session\SessionInterface $session
+ * @return void
+ */
+ protected function collectGarbage(SessionInterface $session)
+ {
+ $config = $this->manager->getSessionConfig();
+
+ // Here we will see if this request hits the garbage collection lottery by hitting
+ // the odds needed to perform garbage collection on any given request. If we do
+ // hit it, we'll call this handler to let it delete all the expired sessions.
+ if ($this->configHitsLottery($config)) {
+ $session->getHandler()->gc($this->getSessionLifetimeInSeconds());
+ }
+ }
+
+ /**
+ * Determine if the configuration odds hit the lottery.
+ *
+ * @param array $config
+ * @return bool
+ */
+ protected function configHitsLottery(array $config)
+ {
+ return mt_rand(1, $config['lottery'][1]) <= $config['lottery'][0];
+ }
+
+ /**
+ * Add the session cookie to the application response.
+ *
+ * @param \Symfony\Component\HttpFoundation\Response $response
+ * @param \Illuminate\Session\SessionInterface $session
+ * @return void
+ */
+ protected function addCookieToResponse(Response $response, SessionInterface $session)
+ {
+ if ($this->usingCookieSessions()) {
+ $this->manager->driver()->save();
+ }
+
+ if ($this->sessionIsPersistent($config = $this->manager->getSessionConfig())) {
+ $response->headers->setCookie(new Cookie(
+ $session->getName(), $session->getId(), $this->getCookieExpirationDate(),
+ $config['path'], $config['domain'], Arr::get($config, 'secure', false)
+ ));
+ }
+ }
+
+ /**
+ * Get the session lifetime in seconds.
+ *
+ * @return int
+ */
+ protected function getSessionLifetimeInSeconds()
+ {
+ return Arr::get($this->manager->getSessionConfig(), 'lifetime') * 60;
+ }
+
+ /**
+ * Get the cookie lifetime in seconds.
+ *
+ * @return int
+ */
+ protected function getCookieExpirationDate()
+ {
+ $config = $this->manager->getSessionConfig();
+
+ return $config['expire_on_close'] ? 0 : Carbon::now()->addMinutes($config['lifetime']);
+ }
+
+ /**
+ * Determine if a session driver has been configured.
+ *
+ * @return bool
+ */
+ protected function sessionConfigured()
+ {
+ return ! is_null(Arr::get($this->manager->getSessionConfig(), 'driver'));
+ }
+
+ /**
+ * Determine if the configured session driver is persistent.
+ *
+ * @param array|null $config
+ * @return bool
+ */
+ protected function sessionIsPersistent(array $config = null)
+ {
+ $config = $config ?: $this->manager->getSessionConfig();
+
+ return ! in_array($config['driver'], [null, 'array']);
+ }
+
+ /**
+ * Determine if the session is using cookie sessions.
+ *
+ * @return bool
+ */
+ protected function usingCookieSessions()
+ {
+ if (! $this->sessionConfigured()) {
+ return false;
+ }
+
+ return $this->manager->driver()->getHandler() instanceof CookieSessionHandler;
+ }
+}
diff --git a/vendor/illuminate/session/SessionInterface.php b/vendor/illuminate/session/SessionInterface.php
new file mode 100644
index 00000000..1d7f18d3
--- /dev/null
+++ b/vendor/illuminate/session/SessionInterface.php
@@ -0,0 +1,31 @@
+buildSession(parent::callCustomCreator($driver));
+ }
+
+ /**
+ * Create an instance of the "array" session driver.
+ *
+ * @return \Illuminate\Session\Store
+ */
+ protected function createArrayDriver()
+ {
+ return $this->buildSession(new NullSessionHandler);
+ }
+
+ /**
+ * Create an instance of the "cookie" session driver.
+ *
+ * @return \Illuminate\Session\Store
+ */
+ protected function createCookieDriver()
+ {
+ $lifetime = $this->app['config']['session.lifetime'];
+
+ return $this->buildSession(new CookieSessionHandler($this->app['cookie'], $lifetime));
+ }
+
+ /**
+ * Create an instance of the file session driver.
+ *
+ * @return \Illuminate\Session\Store
+ */
+ protected function createFileDriver()
+ {
+ return $this->createNativeDriver();
+ }
+
+ /**
+ * Create an instance of the file session driver.
+ *
+ * @return \Illuminate\Session\Store
+ */
+ protected function createNativeDriver()
+ {
+ $path = $this->app['config']['session.files'];
+
+ $lifetime = $this->app['config']['session.lifetime'];
+
+ return $this->buildSession(new FileSessionHandler($this->app['files'], $path, $lifetime));
+ }
+
+ /**
+ * Create an instance of the database session driver.
+ *
+ * @return \Illuminate\Session\Store
+ */
+ protected function createDatabaseDriver()
+ {
+ $connection = $this->getDatabaseConnection();
+
+ $table = $this->app['config']['session.table'];
+
+ $lifetime = $this->app['config']['session.lifetime'];
+
+ return $this->buildSession(new DatabaseSessionHandler($connection, $table, $lifetime));
+ }
+
+ /**
+ * Get the database connection for the database driver.
+ *
+ * @return \Illuminate\Database\Connection
+ */
+ protected function getDatabaseConnection()
+ {
+ $connection = $this->app['config']['session.connection'];
+
+ return $this->app['db']->connection($connection);
+ }
+
+ /**
+ * Create an instance of the APC session driver.
+ *
+ * @return \Illuminate\Session\Store
+ */
+ protected function createApcDriver()
+ {
+ return $this->createCacheBased('apc');
+ }
+
+ /**
+ * Create an instance of the Memcached session driver.
+ *
+ * @return \Illuminate\Session\Store
+ */
+ protected function createMemcachedDriver()
+ {
+ return $this->createCacheBased('memcached');
+ }
+
+ /**
+ * Create an instance of the Wincache session driver.
+ *
+ * @return \Illuminate\Session\Store
+ */
+ protected function createWincacheDriver()
+ {
+ return $this->createCacheBased('wincache');
+ }
+
+ /**
+ * Create an instance of the Redis session driver.
+ *
+ * @return \Illuminate\Session\Store
+ */
+ protected function createRedisDriver()
+ {
+ $handler = $this->createCacheHandler('redis');
+
+ $handler->getCache()->getStore()->setConnection($this->app['config']['session.connection']);
+
+ return $this->buildSession($handler);
+ }
+
+ /**
+ * Create an instance of a cache driven driver.
+ *
+ * @param string $driver
+ * @return \Illuminate\Session\Store
+ */
+ protected function createCacheBased($driver)
+ {
+ return $this->buildSession($this->createCacheHandler($driver));
+ }
+
+ /**
+ * Create the cache based session handler instance.
+ *
+ * @param string $driver
+ * @return \Illuminate\Session\CacheBasedSessionHandler
+ */
+ protected function createCacheHandler($driver)
+ {
+ $minutes = $this->app['config']['session.lifetime'];
+
+ return new CacheBasedSessionHandler(clone $this->app['cache']->driver($driver), $minutes);
+ }
+
+ /**
+ * Build the session instance.
+ *
+ * @param \SessionHandlerInterface $handler
+ * @return \Illuminate\Session\Store
+ */
+ protected function buildSession($handler)
+ {
+ if ($this->app['config']['session.encrypt']) {
+ return new EncryptedStore(
+ $this->app['config']['session.cookie'], $handler, $this->app['encrypter']
+ );
+ } else {
+ return new Store($this->app['config']['session.cookie'], $handler);
+ }
+ }
+
+ /**
+ * Get the session configuration.
+ *
+ * @return array
+ */
+ public function getSessionConfig()
+ {
+ return $this->app['config']['session'];
+ }
+
+ /**
+ * Get the default session driver name.
+ *
+ * @return string
+ */
+ public function getDefaultDriver()
+ {
+ return $this->app['config']['session.driver'];
+ }
+
+ /**
+ * Set the default session driver name.
+ *
+ * @param string $name
+ * @return void
+ */
+ public function setDefaultDriver($name)
+ {
+ $this->app['config']['session.driver'] = $name;
+ }
+}
diff --git a/vendor/illuminate/session/SessionServiceProvider.php b/vendor/illuminate/session/SessionServiceProvider.php
new file mode 100644
index 00000000..bc49ebc3
--- /dev/null
+++ b/vendor/illuminate/session/SessionServiceProvider.php
@@ -0,0 +1,51 @@
+registerSessionManager();
+
+ $this->registerSessionDriver();
+
+ $this->app->singleton('Illuminate\Session\Middleware\StartSession');
+ }
+
+ /**
+ * Register the session manager instance.
+ *
+ * @return void
+ */
+ protected function registerSessionManager()
+ {
+ $this->app->singleton('session', function ($app) {
+ return new SessionManager($app);
+ });
+ }
+
+ /**
+ * Register the session driver instance.
+ *
+ * @return void
+ */
+ protected function registerSessionDriver()
+ {
+ $this->app->singleton('session.store', function ($app) {
+ // First, we will create the session manager which is responsible for the
+ // creation of the various session drivers when they are needed by the
+ // application instance, and will resolve them on a lazy load basis.
+ $manager = $app['session'];
+
+ return $manager->driver();
+ });
+ }
+}
diff --git a/vendor/illuminate/session/Store.php b/vendor/illuminate/session/Store.php
new file mode 100644
index 00000000..34197132
--- /dev/null
+++ b/vendor/illuminate/session/Store.php
@@ -0,0 +1,699 @@
+setId($id);
+ $this->name = $name;
+ $this->handler = $handler;
+ $this->metaBag = new MetadataBag;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function start()
+ {
+ $this->loadSession();
+
+ if (! $this->has('_token')) {
+ $this->regenerateToken();
+ }
+
+ return $this->started = true;
+ }
+
+ /**
+ * Load the session data from the handler.
+ *
+ * @return void
+ */
+ protected function loadSession()
+ {
+ $this->attributes = array_merge($this->attributes, $this->readFromHandler());
+
+ foreach (array_merge($this->bags, [$this->metaBag]) as $bag) {
+ $this->initializeLocalBag($bag);
+
+ $bag->initialize($this->bagData[$bag->getStorageKey()]);
+ }
+ }
+
+ /**
+ * Read the session data from the handler.
+ *
+ * @return array
+ */
+ protected function readFromHandler()
+ {
+ $data = $this->handler->read($this->getId());
+
+ if ($data) {
+ $data = @unserialize($this->prepareForUnserialize($data));
+
+ if ($data !== false && $data !== null && is_array($data)) {
+ return $data;
+ }
+ }
+
+ return [];
+ }
+
+ /**
+ * Prepare the raw string data from the session for unserialization.
+ *
+ * @param string $data
+ * @return string
+ */
+ protected function prepareForUnserialize($data)
+ {
+ return $data;
+ }
+
+ /**
+ * Initialize a bag in storage if it doesn't exist.
+ *
+ * @param \Symfony\Component\HttpFoundation\Session\SessionBagInterface $bag
+ * @return void
+ */
+ protected function initializeLocalBag($bag)
+ {
+ $this->bagData[$bag->getStorageKey()] = $this->pull($bag->getStorageKey(), []);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setId($id)
+ {
+ if (! $this->isValidId($id)) {
+ $id = $this->generateSessionId();
+ }
+
+ $this->id = $id;
+ }
+
+ /**
+ * Determine if this is a valid session ID.
+ *
+ * @param string $id
+ * @return bool
+ */
+ public function isValidId($id)
+ {
+ return is_string($id) && preg_match('/^[a-f0-9]{40}$/', $id);
+ }
+
+ /**
+ * Get a new, random session ID.
+ *
+ * @return string
+ */
+ protected function generateSessionId()
+ {
+ return sha1(uniqid('', true).Str::random(25).microtime(true));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function invalidate($lifetime = null)
+ {
+ $this->clear();
+
+ return $this->migrate(true, $lifetime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function migrate($destroy = false, $lifetime = null)
+ {
+ if ($destroy) {
+ $this->handler->destroy($this->getId());
+ }
+
+ $this->setExists(false);
+
+ $this->id = $this->generateSessionId();
+
+ return true;
+ }
+
+ /**
+ * Generate a new session identifier.
+ *
+ * @param bool $destroy
+ * @return bool
+ */
+ public function regenerate($destroy = false)
+ {
+ return $this->migrate($destroy);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function save()
+ {
+ $this->addBagDataToSession();
+
+ $this->ageFlashData();
+
+ $this->handler->write($this->getId(), $this->prepareForStorage(serialize($this->attributes)));
+
+ $this->started = false;
+ }
+
+ /**
+ * Prepare the serialized session data for storage.
+ *
+ * @param string $data
+ * @return string
+ */
+ protected function prepareForStorage($data)
+ {
+ return $data;
+ }
+
+ /**
+ * Merge all of the bag data into the session.
+ *
+ * @return void
+ */
+ protected function addBagDataToSession()
+ {
+ foreach (array_merge($this->bags, [$this->metaBag]) as $bag) {
+ $key = $bag->getStorageKey();
+
+ if (isset($this->bagData[$key])) {
+ $this->put($key, $this->bagData[$key]);
+ }
+ }
+ }
+
+ /**
+ * Age the flash data for the session.
+ *
+ * @return void
+ */
+ public function ageFlashData()
+ {
+ $this->forget($this->get('flash.old', []));
+
+ $this->put('flash.old', $this->get('flash.new', []));
+
+ $this->put('flash.new', []);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function has($name)
+ {
+ return ! is_null($this->get($name));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get($name, $default = null)
+ {
+ return Arr::get($this->attributes, $name, $default);
+ }
+
+ /**
+ * Get the value of a given key and then forget it.
+ *
+ * @param string $key
+ * @param string $default
+ * @return mixed
+ */
+ public function pull($key, $default = null)
+ {
+ return Arr::pull($this->attributes, $key, $default);
+ }
+
+ /**
+ * Determine if the session contains old input.
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function hasOldInput($key = null)
+ {
+ $old = $this->getOldInput($key);
+
+ return is_null($key) ? count($old) > 0 : ! is_null($old);
+ }
+
+ /**
+ * Get the requested item from the flashed input array.
+ *
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public function getOldInput($key = null, $default = null)
+ {
+ $input = $this->get('_old_input', []);
+
+ // Input that is flashed to the session can be easily retrieved by the
+ // developer, making repopulating old forms and the like much more
+ // convenient, since the request's previous input is available.
+ return Arr::get($input, $key, $default);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set($name, $value)
+ {
+ Arr::set($this->attributes, $name, $value);
+ }
+
+ /**
+ * Put a key / value pair or array of key / value pairs in the session.
+ *
+ * @param string|array $key
+ * @param mixed $value
+ * @return void
+ */
+ public function put($key, $value = null)
+ {
+ if (! is_array($key)) {
+ $key = [$key => $value];
+ }
+
+ foreach ($key as $arrayKey => $arrayValue) {
+ $this->set($arrayKey, $arrayValue);
+ }
+ }
+
+ /**
+ * Push a value onto a session array.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function push($key, $value)
+ {
+ $array = $this->get($key, []);
+
+ $array[] = $value;
+
+ $this->put($key, $array);
+ }
+
+ /**
+ * Flash a key / value pair to the session.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function flash($key, $value)
+ {
+ $this->put($key, $value);
+
+ $this->push('flash.new', $key);
+
+ $this->removeFromOldFlashData([$key]);
+ }
+
+ /**
+ * Flash a key / value pair to the session
+ * for immediate use.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function now($key, $value)
+ {
+ $this->put($key, $value);
+
+ $this->push('flash.old', $key);
+ }
+
+ /**
+ * Flash an input array to the session.
+ *
+ * @param array $value
+ * @return void
+ */
+ public function flashInput(array $value)
+ {
+ $this->flash('_old_input', $value);
+ }
+
+ /**
+ * Reflash all of the session flash data.
+ *
+ * @return void
+ */
+ public function reflash()
+ {
+ $this->mergeNewFlashes($this->get('flash.old', []));
+
+ $this->put('flash.old', []);
+ }
+
+ /**
+ * Reflash a subset of the current flash data.
+ *
+ * @param array|mixed $keys
+ * @return void
+ */
+ public function keep($keys = null)
+ {
+ $keys = is_array($keys) ? $keys : func_get_args();
+
+ $this->mergeNewFlashes($keys);
+
+ $this->removeFromOldFlashData($keys);
+ }
+
+ /**
+ * Merge new flash keys into the new flash array.
+ *
+ * @param array $keys
+ * @return void
+ */
+ protected function mergeNewFlashes(array $keys)
+ {
+ $values = array_unique(array_merge($this->get('flash.new', []), $keys));
+
+ $this->put('flash.new', $values);
+ }
+
+ /**
+ * Remove the given keys from the old flash data.
+ *
+ * @param array $keys
+ * @return void
+ */
+ protected function removeFromOldFlashData(array $keys)
+ {
+ $this->put('flash.old', array_diff($this->get('flash.old', []), $keys));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function all()
+ {
+ return $this->attributes;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function replace(array $attributes)
+ {
+ $this->put($attributes);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function remove($name)
+ {
+ return Arr::pull($this->attributes, $name);
+ }
+
+ /**
+ * Remove one or many items from the session.
+ *
+ * @param string|array $keys
+ * @return void
+ */
+ public function forget($keys)
+ {
+ Arr::forget($this->attributes, $keys);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function clear()
+ {
+ $this->attributes = [];
+
+ foreach ($this->bags as $bag) {
+ $bag->clear();
+ }
+ }
+
+ /**
+ * Remove all of the items from the session.
+ *
+ * @return void
+ */
+ public function flush()
+ {
+ $this->clear();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isStarted()
+ {
+ return $this->started;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function registerBag(SessionBagInterface $bag)
+ {
+ $this->bags[$bag->getStorageKey()] = $bag;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getBag($name)
+ {
+ return Arr::get($this->bags, $name, function () {
+ throw new InvalidArgumentException('Bag not registered.');
+ });
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getMetadataBag()
+ {
+ return $this->metaBag;
+ }
+
+ /**
+ * Get the raw bag data array for a given bag.
+ *
+ * @param string $name
+ * @return array
+ */
+ public function getBagData($name)
+ {
+ return Arr::get($this->bagData, $name, []);
+ }
+
+ /**
+ * Get the CSRF token value.
+ *
+ * @return string
+ */
+ public function token()
+ {
+ return $this->get('_token');
+ }
+
+ /**
+ * Get the CSRF token value.
+ *
+ * @return string
+ */
+ public function getToken()
+ {
+ return $this->token();
+ }
+
+ /**
+ * Regenerate the CSRF token value.
+ *
+ * @return void
+ */
+ public function regenerateToken()
+ {
+ $this->put('_token', Str::random(40));
+ }
+
+ /**
+ * Get the previous URL from the session.
+ *
+ * @return string|null
+ */
+ public function previousUrl()
+ {
+ return $this->get('_previous.url');
+ }
+
+ /**
+ * Set the "previous" URL in the session.
+ *
+ * @param string $url
+ * @return void
+ */
+ public function setPreviousUrl($url)
+ {
+ return $this->put('_previous.url', $url);
+ }
+
+ /**
+ * Set the existence of the session on the handler if applicable.
+ *
+ * @param bool $value
+ * @return void
+ */
+ public function setExists($value)
+ {
+ if ($this->handler instanceof ExistenceAwareInterface) {
+ $this->handler->setExists($value);
+ }
+ }
+
+ /**
+ * Get the underlying session handler implementation.
+ *
+ * @return \SessionHandlerInterface
+ */
+ public function getHandler()
+ {
+ return $this->handler;
+ }
+
+ /**
+ * Determine if the session handler needs a request.
+ *
+ * @return bool
+ */
+ public function handlerNeedsRequest()
+ {
+ return $this->handler instanceof CookieSessionHandler;
+ }
+
+ /**
+ * Set the request on the handler instance.
+ *
+ * @param \Symfony\Component\HttpFoundation\Request $request
+ * @return void
+ */
+ public function setRequestOnHandler(Request $request)
+ {
+ if ($this->handlerNeedsRequest()) {
+ $this->handler->setRequest($request);
+ }
+ }
+}
diff --git a/vendor/illuminate/session/TokenMismatchException.php b/vendor/illuminate/session/TokenMismatchException.php
new file mode 100644
index 00000000..98d99a1e
--- /dev/null
+++ b/vendor/illuminate/session/TokenMismatchException.php
@@ -0,0 +1,10 @@
+=5.5.9",
+ "illuminate/contracts": "5.1.*",
+ "illuminate/support": "5.1.*",
+ "nesbot/carbon": "~1.19",
+ "symfony/finder": "2.7.*",
+ "symfony/http-foundation": "2.7.*"
+ },
+ "autoload": {
+ "psr-4": {
+ "Illuminate\\Session\\": ""
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "suggest": {
+ "illuminate/console": "Required to use the session:table command (5.1.*)."
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/illuminate/support/AggregateServiceProvider.php b/vendor/illuminate/support/AggregateServiceProvider.php
new file mode 100644
index 00000000..ca5f9a86
--- /dev/null
+++ b/vendor/illuminate/support/AggregateServiceProvider.php
@@ -0,0 +1,52 @@
+instances = [];
+
+ foreach ($this->providers as $provider) {
+ $this->instances[] = $this->app->register($provider);
+ }
+ }
+
+ /**
+ * Get the services provided by the provider.
+ *
+ * @return array
+ */
+ public function provides()
+ {
+ $provides = [];
+
+ foreach ($this->providers as $provider) {
+ $instance = $this->app->resolveProviderClass($provider);
+
+ $provides = array_merge($provides, $instance->provides());
+ }
+
+ return $provides;
+ }
+}
diff --git a/vendor/illuminate/support/Arr.php b/vendor/illuminate/support/Arr.php
new file mode 100644
index 00000000..93e95699
--- /dev/null
+++ b/vendor/illuminate/support/Arr.php
@@ -0,0 +1,486 @@
+ $value) {
+ list($innerKey, $innerValue) = call_user_func($callback, $key, $value);
+
+ $results[$innerKey] = $innerValue;
+ }
+
+ return $results;
+ }
+
+ /**
+ * Collapse an array of arrays into a single array.
+ *
+ * @param \ArrayAccess|array $array
+ * @return array
+ */
+ public static function collapse($array)
+ {
+ $results = [];
+
+ foreach ($array as $values) {
+ if ($values instanceof Collection) {
+ $values = $values->all();
+ }
+
+ $results = array_merge($results, $values);
+ }
+
+ return $results;
+ }
+
+ /**
+ * Divide an array into two arrays. One with keys and the other with values.
+ *
+ * @param array $array
+ * @return array
+ */
+ public static function divide($array)
+ {
+ return [array_keys($array), array_values($array)];
+ }
+
+ /**
+ * Flatten a multi-dimensional associative array with dots.
+ *
+ * @param array $array
+ * @param string $prepend
+ * @return array
+ */
+ public static function dot($array, $prepend = '')
+ {
+ $results = [];
+
+ foreach ($array as $key => $value) {
+ if (is_array($value)) {
+ $results = array_merge($results, static::dot($value, $prepend.$key.'.'));
+ } else {
+ $results[$prepend.$key] = $value;
+ }
+ }
+
+ return $results;
+ }
+
+ /**
+ * Get all of the given array except for a specified array of items.
+ *
+ * @param array $array
+ * @param array|string $keys
+ * @return array
+ */
+ public static function except($array, $keys)
+ {
+ static::forget($array, $keys);
+
+ return $array;
+ }
+
+ /**
+ * Fetch a flattened array of a nested array element.
+ *
+ * @param array $array
+ * @param string $key
+ * @return array
+ *
+ * @deprecated since version 5.1. Use pluck instead.
+ */
+ public static function fetch($array, $key)
+ {
+ foreach (explode('.', $key) as $segment) {
+ $results = [];
+
+ foreach ($array as $value) {
+ if (array_key_exists($segment, $value = (array) $value)) {
+ $results[] = $value[$segment];
+ }
+ }
+
+ $array = array_values($results);
+ }
+
+ return array_values($results);
+ }
+
+ /**
+ * Return the first element in an array passing a given truth test.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @param mixed $default
+ * @return mixed
+ */
+ public static function first($array, callable $callback, $default = null)
+ {
+ foreach ($array as $key => $value) {
+ if (call_user_func($callback, $key, $value)) {
+ return $value;
+ }
+ }
+
+ return value($default);
+ }
+
+ /**
+ * Return the last element in an array passing a given truth test.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @param mixed $default
+ * @return mixed
+ */
+ public static function last($array, callable $callback, $default = null)
+ {
+ return static::first(array_reverse($array), $callback, $default);
+ }
+
+ /**
+ * Flatten a multi-dimensional array into a single level.
+ *
+ * @param array $array
+ * @return array
+ */
+ public static function flatten($array)
+ {
+ $return = [];
+
+ array_walk_recursive($array, function ($x) use (&$return) {
+ $return[] = $x;
+ });
+
+ return $return;
+ }
+
+ /**
+ * Remove one or many array items from a given array using "dot" notation.
+ *
+ * @param array $array
+ * @param array|string $keys
+ * @return void
+ */
+ public static function forget(&$array, $keys)
+ {
+ $original = &$array;
+
+ $keys = (array) $keys;
+
+ if (count($keys) === 0) {
+ return;
+ }
+
+ foreach ($keys as $key) {
+ $parts = explode('.', $key);
+
+ while (count($parts) > 1) {
+ $part = array_shift($parts);
+
+ if (isset($array[$part]) && is_array($array[$part])) {
+ $array = &$array[$part];
+ } else {
+ $parts = [];
+ }
+ }
+
+ unset($array[array_shift($parts)]);
+
+ // clean up after each pass
+ $array = &$original;
+ }
+ }
+
+ /**
+ * Get an item from an array using "dot" notation.
+ *
+ * @param array $array
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public static function get($array, $key, $default = null)
+ {
+ if (is_null($key)) {
+ return $array;
+ }
+
+ if (isset($array[$key])) {
+ return $array[$key];
+ }
+
+ foreach (explode('.', $key) as $segment) {
+ if (! is_array($array) || ! array_key_exists($segment, $array)) {
+ return value($default);
+ }
+
+ $array = $array[$segment];
+ }
+
+ return $array;
+ }
+
+ /**
+ * Check if an item exists in an array using "dot" notation.
+ *
+ * @param array $array
+ * @param string $key
+ * @return bool
+ */
+ public static function has($array, $key)
+ {
+ if (empty($array) || is_null($key)) {
+ return false;
+ }
+
+ if (array_key_exists($key, $array)) {
+ return true;
+ }
+
+ foreach (explode('.', $key) as $segment) {
+ if (! is_array($array) || ! array_key_exists($segment, $array)) {
+ return false;
+ }
+
+ $array = $array[$segment];
+ }
+
+ return true;
+ }
+
+ /**
+ * Determines if an array is associative.
+ *
+ * An array is "associative" if it doesn't have sequential numerical keys beginning with zero.
+ *
+ * @param array $array
+ * @return bool
+ */
+ public static function isAssoc(array $array)
+ {
+ $keys = array_keys($array);
+
+ return array_keys($keys) !== $keys;
+ }
+
+ /**
+ * Get a subset of the items from the given array.
+ *
+ * @param array $array
+ * @param array|string $keys
+ * @return array
+ */
+ public static function only($array, $keys)
+ {
+ return array_intersect_key($array, array_flip((array) $keys));
+ }
+
+ /**
+ * Pluck an array of values from an array.
+ *
+ * @param array $array
+ * @param string|array $value
+ * @param string|array|null $key
+ * @return array
+ */
+ public static function pluck($array, $value, $key = null)
+ {
+ $results = [];
+
+ list($value, $key) = static::explodePluckParameters($value, $key);
+
+ foreach ($array as $item) {
+ $itemValue = data_get($item, $value);
+
+ // If the key is "null", we will just append the value to the array and keep
+ // looping. Otherwise we will key the array using the value of the key we
+ // received from the developer. Then we'll return the final array form.
+ if (is_null($key)) {
+ $results[] = $itemValue;
+ } else {
+ $itemKey = data_get($item, $key);
+
+ $results[$itemKey] = $itemValue;
+ }
+ }
+
+ return $results;
+ }
+
+ /**
+ * Explode the "value" and "key" arguments passed to "pluck".
+ *
+ * @param string|array $value
+ * @param string|array|null $key
+ * @return array
+ */
+ protected static function explodePluckParameters($value, $key)
+ {
+ $value = is_string($value) ? explode('.', $value) : $value;
+
+ $key = is_null($key) || is_array($key) ? $key : explode('.', $key);
+
+ return [$value, $key];
+ }
+
+ /**
+ * Push an item onto the beginning of an array.
+ *
+ * @param array $array
+ * @param mixed $value
+ * @param mixed $key
+ * @return array
+ */
+ public static function prepend($array, $value, $key = null)
+ {
+ if (is_null($key)) {
+ array_unshift($array, $value);
+ } else {
+ $array = [$key => $value] + $array;
+ }
+
+ return $array;
+ }
+
+ /**
+ * Get a value from the array, and remove it.
+ *
+ * @param array $array
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public static function pull(&$array, $key, $default = null)
+ {
+ $value = static::get($array, $key, $default);
+
+ static::forget($array, $key);
+
+ return $value;
+ }
+
+ /**
+ * Set an array item to a given value using "dot" notation.
+ *
+ * If no key is given to the method, the entire array will be replaced.
+ *
+ * @param array $array
+ * @param string $key
+ * @param mixed $value
+ * @return array
+ */
+ public static function set(&$array, $key, $value)
+ {
+ if (is_null($key)) {
+ return $array = $value;
+ }
+
+ $keys = explode('.', $key);
+
+ while (count($keys) > 1) {
+ $key = array_shift($keys);
+
+ // If the key doesn't exist at this depth, we will just create an empty array
+ // to hold the next value, allowing us to create the arrays to hold final
+ // values at the correct depth. Then we'll keep digging into the array.
+ if (! isset($array[$key]) || ! is_array($array[$key])) {
+ $array[$key] = [];
+ }
+
+ $array = &$array[$key];
+ }
+
+ $array[array_shift($keys)] = $value;
+
+ return $array;
+ }
+
+ /**
+ * Sort the array using the given callback.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @return array
+ */
+ public static function sort($array, callable $callback)
+ {
+ return Collection::make($array)->sortBy($callback)->all();
+ }
+
+ /**
+ * Recursively sort an array by keys and values.
+ *
+ * @param array $array
+ * @return array
+ */
+ public static function sortRecursive($array)
+ {
+ foreach ($array as &$value) {
+ if (is_array($value)) {
+ $value = static::sortRecursive($value);
+ }
+ }
+
+ if (static::isAssoc($array)) {
+ ksort($array);
+ } else {
+ sort($array);
+ }
+
+ return $array;
+ }
+
+ /**
+ * Filter the array using the given callback.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @return array
+ */
+ public static function where($array, callable $callback)
+ {
+ $filtered = [];
+
+ foreach ($array as $key => $value) {
+ if (call_user_func($callback, $key, $value)) {
+ $filtered[$key] = $value;
+ }
+ }
+
+ return $filtered;
+ }
+}
diff --git a/vendor/illuminate/support/ClassLoader.php b/vendor/illuminate/support/ClassLoader.php
new file mode 100644
index 00000000..6a8d2358
--- /dev/null
+++ b/vendor/illuminate/support/ClassLoader.php
@@ -0,0 +1,104 @@
+items = is_array($items) ? $items : $this->getArrayableItems($items);
+ }
+
+ /**
+ * Create a new collection instance if the value isn't one already.
+ *
+ * @param mixed $items
+ * @return static
+ */
+ public static function make($items = [])
+ {
+ return new static($items);
+ }
+
+ /**
+ * Get all of the items in the collection.
+ *
+ * @return array
+ */
+ public function all()
+ {
+ return $this->items;
+ }
+
+ /**
+ * Get the average value of a given key.
+ *
+ * @param string|null $key
+ * @return mixed
+ */
+ public function avg($key = null)
+ {
+ if ($count = $this->count()) {
+ return $this->sum($key) / $count;
+ }
+ }
+
+ /**
+ * Alias for the "avg" method.
+ *
+ * @param string|null $key
+ * @return mixed
+ */
+ public function average($key = null)
+ {
+ return $this->avg($key);
+ }
+
+ /**
+ * Collapse the collection of items into a single array.
+ *
+ * @return static
+ */
+ public function collapse()
+ {
+ return new static(Arr::collapse($this->items));
+ }
+
+ /**
+ * Determine if an item exists in the collection.
+ *
+ * @param mixed $key
+ * @param mixed $value
+ * @return bool
+ */
+ public function contains($key, $value = null)
+ {
+ if (func_num_args() == 2) {
+ return $this->contains(function ($k, $item) use ($key, $value) {
+ return data_get($item, $key) == $value;
+ });
+ }
+
+ if ($this->useAsCallable($key)) {
+ return ! is_null($this->first($key));
+ }
+
+ return in_array($key, $this->items);
+ }
+
+ /**
+ * Get the items in the collection that are not present in the given items.
+ *
+ * @param mixed $items
+ * @return static
+ */
+ public function diff($items)
+ {
+ return new static(array_diff($this->items, $this->getArrayableItems($items)));
+ }
+
+ /**
+ * Execute a callback over each item.
+ *
+ * @param callable $callback
+ * @return $this
+ */
+ public function each(callable $callback)
+ {
+ foreach ($this->items as $key => $item) {
+ if ($callback($item, $key) === false) {
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Create a new collection consisting of every n-th element.
+ *
+ * @param int $step
+ * @param int $offset
+ * @return static
+ */
+ public function every($step, $offset = 0)
+ {
+ $new = [];
+
+ $position = 0;
+
+ foreach ($this->items as $key => $item) {
+ if ($position % $step === $offset) {
+ $new[] = $item;
+ }
+
+ $position++;
+ }
+
+ return new static($new);
+ }
+
+ /**
+ * Get all items except for those with the specified keys.
+ *
+ * @param mixed $keys
+ * @return static
+ */
+ public function except($keys)
+ {
+ $keys = is_array($keys) ? $keys : func_get_args();
+
+ return new static(Arr::except($this->items, $keys));
+ }
+
+ /**
+ * Fetch a nested element of the collection.
+ *
+ * @param string $key
+ * @return static
+ *
+ * @deprecated since version 5.1. Use pluck instead.
+ */
+ public function fetch($key)
+ {
+ return new static(Arr::fetch($this->items, $key));
+ }
+
+ /**
+ * Run a filter over each of the items.
+ *
+ * @param callable|null $callback
+ * @return static
+ */
+ public function filter(callable $callback = null)
+ {
+ if ($callback) {
+ return new static(array_filter($this->items, $callback));
+ }
+
+ return new static(array_filter($this->items));
+ }
+
+ /**
+ * Filter items by the given key value pair.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @param bool $strict
+ * @return static
+ */
+ public function where($key, $value, $strict = true)
+ {
+ return $this->filter(function ($item) use ($key, $value, $strict) {
+ return $strict ? data_get($item, $key) === $value
+ : data_get($item, $key) == $value;
+ });
+ }
+
+ /**
+ * Filter items by the given key value pair using loose comparison.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return static
+ */
+ public function whereLoose($key, $value)
+ {
+ return $this->where($key, $value, false);
+ }
+
+ /**
+ * Get the first item from the collection.
+ *
+ * @param callable|null $callback
+ * @param mixed $default
+ * @return mixed
+ */
+ public function first(callable $callback = null, $default = null)
+ {
+ if (is_null($callback)) {
+ return count($this->items) > 0 ? reset($this->items) : value($default);
+ }
+
+ return Arr::first($this->items, $callback, $default);
+ }
+
+ /**
+ * Get a flattened array of the items in the collection.
+ *
+ * @return static
+ */
+ public function flatten()
+ {
+ return new static(Arr::flatten($this->items));
+ }
+
+ /**
+ * Flip the items in the collection.
+ *
+ * @return static
+ */
+ public function flip()
+ {
+ return new static(array_flip($this->items));
+ }
+
+ /**
+ * Remove an item from the collection by key.
+ *
+ * @param string|array $keys
+ * @return $this
+ */
+ public function forget($keys)
+ {
+ foreach ((array) $keys as $key) {
+ $this->offsetUnset($key);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get an item from the collection by key.
+ *
+ * @param mixed $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public function get($key, $default = null)
+ {
+ if ($this->offsetExists($key)) {
+ return $this->items[$key];
+ }
+
+ return value($default);
+ }
+
+ /**
+ * Group an associative array by a field or using a callback.
+ *
+ * @param callable|string $groupBy
+ * @param bool $preserveKeys
+ * @return static
+ */
+ public function groupBy($groupBy, $preserveKeys = false)
+ {
+ $groupBy = $this->valueRetriever($groupBy);
+
+ $results = [];
+
+ foreach ($this->items as $key => $value) {
+ $groupKey = $groupBy($value, $key);
+
+ if (! array_key_exists($groupKey, $results)) {
+ $results[$groupKey] = new static;
+ }
+
+ $results[$groupKey]->offsetSet($preserveKeys ? $key : null, $value);
+ }
+
+ return new static($results);
+ }
+
+ /**
+ * Key an associative array by a field or using a callback.
+ *
+ * @param callable|string $keyBy
+ * @return static
+ */
+ public function keyBy($keyBy)
+ {
+ $keyBy = $this->valueRetriever($keyBy);
+
+ $results = [];
+
+ foreach ($this->items as $item) {
+ $results[$keyBy($item)] = $item;
+ }
+
+ return new static($results);
+ }
+
+ /**
+ * Determine if an item exists in the collection by key.
+ *
+ * @param mixed $key
+ * @return bool
+ */
+ public function has($key)
+ {
+ return $this->offsetExists($key);
+ }
+
+ /**
+ * Concatenate values of a given key as a string.
+ *
+ * @param string $value
+ * @param string $glue
+ * @return string
+ */
+ public function implode($value, $glue = null)
+ {
+ $first = $this->first();
+
+ if (is_array($first) || is_object($first)) {
+ return implode($glue, $this->pluck($value)->all());
+ }
+
+ return implode($value, $this->items);
+ }
+
+ /**
+ * Intersect the collection with the given items.
+ *
+ * @param mixed $items
+ * @return static
+ */
+ public function intersect($items)
+ {
+ return new static(array_intersect($this->items, $this->getArrayableItems($items)));
+ }
+
+ /**
+ * Determine if the collection is empty or not.
+ *
+ * @return bool
+ */
+ public function isEmpty()
+ {
+ return empty($this->items);
+ }
+
+ /**
+ * Determine if the given value is callable, but not a string.
+ *
+ * @param mixed $value
+ * @return bool
+ */
+ protected function useAsCallable($value)
+ {
+ return ! is_string($value) && is_callable($value);
+ }
+
+ /**
+ * Get the keys of the collection items.
+ *
+ * @return static
+ */
+ public function keys()
+ {
+ return new static(array_keys($this->items));
+ }
+
+ /**
+ * Get the last item from the collection.
+ *
+ * @param callable|null $callback
+ * @param mixed $default
+ * @return mixed
+ */
+ public function last(callable $callback = null, $default = null)
+ {
+ if (is_null($callback)) {
+ return count($this->items) > 0 ? end($this->items) : value($default);
+ }
+
+ return Arr::last($this->items, $callback, $default);
+ }
+
+ /**
+ * Get the values of a given key.
+ *
+ * @param string $value
+ * @param string|null $key
+ * @return static
+ */
+ public function pluck($value, $key = null)
+ {
+ return new static(Arr::pluck($this->items, $value, $key));
+ }
+
+ /**
+ * Alias for the "pluck" method.
+ *
+ * @param string $value
+ * @param string|null $key
+ * @return static
+ */
+ public function lists($value, $key = null)
+ {
+ return $this->pluck($value, $key);
+ }
+
+ /**
+ * Run a map over each of the items.
+ *
+ * @param callable $callback
+ * @return static
+ */
+ public function map(callable $callback)
+ {
+ $keys = array_keys($this->items);
+
+ $items = array_map($callback, $this->items, $keys);
+
+ return new static(array_combine($keys, $items));
+ }
+
+ /**
+ * Map a collection and flatten the result by a single level.
+ *
+ * @param callable $callback
+ * @return static
+ */
+ public function flatMap(callable $callback)
+ {
+ return $this->map($callback)->collapse();
+ }
+
+ /**
+ * Get the max value of a given key.
+ *
+ * @param string|null $key
+ * @return mixed
+ */
+ public function max($key = null)
+ {
+ return $this->reduce(function ($result, $item) use ($key) {
+ $value = data_get($item, $key);
+
+ return is_null($result) || $value > $result ? $value : $result;
+ });
+ }
+
+ /**
+ * Merge the collection with the given items.
+ *
+ * @param mixed $items
+ * @return static
+ */
+ public function merge($items)
+ {
+ return new static(array_merge($this->items, $this->getArrayableItems($items)));
+ }
+
+ /**
+ * Get the min value of a given key.
+ *
+ * @param string|null $key
+ * @return mixed
+ */
+ public function min($key = null)
+ {
+ return $this->reduce(function ($result, $item) use ($key) {
+ $value = data_get($item, $key);
+
+ return is_null($result) || $value < $result ? $value : $result;
+ });
+ }
+
+ /**
+ * Get the items with the specified keys.
+ *
+ * @param mixed $keys
+ * @return static
+ */
+ public function only($keys)
+ {
+ $keys = is_array($keys) ? $keys : func_get_args();
+
+ return new static(Arr::only($this->items, $keys));
+ }
+
+ /**
+ * "Paginate" the collection by slicing it into a smaller collection.
+ *
+ * @param int $page
+ * @param int $perPage
+ * @return static
+ */
+ public function forPage($page, $perPage)
+ {
+ return $this->slice(($page - 1) * $perPage, $perPage);
+ }
+
+ /**
+ * Get and remove the last item from the collection.
+ *
+ * @return mixed
+ */
+ public function pop()
+ {
+ return array_pop($this->items);
+ }
+
+ /**
+ * Push an item onto the beginning of the collection.
+ *
+ * @param mixed $value
+ * @param mixed $key
+ * @return $this
+ */
+ public function prepend($value, $key = null)
+ {
+ $this->items = Arr::prepend($this->items, $value, $key);
+
+ return $this;
+ }
+
+ /**
+ * Push an item onto the end of the collection.
+ *
+ * @param mixed $value
+ * @return $this
+ */
+ public function push($value)
+ {
+ $this->offsetSet(null, $value);
+
+ return $this;
+ }
+
+ /**
+ * Get and remove an item from the collection.
+ *
+ * @param mixed $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public function pull($key, $default = null)
+ {
+ return Arr::pull($this->items, $key, $default);
+ }
+
+ /**
+ * Put an item in the collection by key.
+ *
+ * @param mixed $key
+ * @param mixed $value
+ * @return $this
+ */
+ public function put($key, $value)
+ {
+ $this->offsetSet($key, $value);
+
+ return $this;
+ }
+
+ /**
+ * Get one or more items randomly from the collection.
+ *
+ * @param int $amount
+ * @return mixed
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function random($amount = 1)
+ {
+ if ($amount > ($count = $this->count())) {
+ throw new InvalidArgumentException("You requested {$amount} items, but there are only {$count} items in the collection");
+ }
+
+ $keys = array_rand($this->items, $amount);
+
+ if ($amount == 1) {
+ return $this->items[$keys];
+ }
+
+ return new static(array_intersect_key($this->items, array_flip($keys)));
+ }
+
+ /**
+ * Reduce the collection to a single value.
+ *
+ * @param callable $callback
+ * @param mixed $initial
+ * @return mixed
+ */
+ public function reduce(callable $callback, $initial = null)
+ {
+ return array_reduce($this->items, $callback, $initial);
+ }
+
+ /**
+ * Create a collection of all elements that do not pass a given truth test.
+ *
+ * @param callable|mixed $callback
+ * @return static
+ */
+ public function reject($callback)
+ {
+ if ($this->useAsCallable($callback)) {
+ return $this->filter(function ($item) use ($callback) {
+ return ! $callback($item);
+ });
+ }
+
+ return $this->filter(function ($item) use ($callback) {
+ return $item != $callback;
+ });
+ }
+
+ /**
+ * Reverse items order.
+ *
+ * @return static
+ */
+ public function reverse()
+ {
+ return new static(array_reverse($this->items));
+ }
+
+ /**
+ * Search the collection for a given value and return the corresponding key if successful.
+ *
+ * @param mixed $value
+ * @param bool $strict
+ * @return mixed
+ */
+ public function search($value, $strict = false)
+ {
+ if (! $this->useAsCallable($value)) {
+ return array_search($value, $this->items, $strict);
+ }
+
+ foreach ($this->items as $key => $item) {
+ if (call_user_func($value, $item, $key)) {
+ return $key;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get and remove the first item from the collection.
+ *
+ * @return mixed
+ */
+ public function shift()
+ {
+ return array_shift($this->items);
+ }
+
+ /**
+ * Shuffle the items in the collection.
+ *
+ * @return static
+ */
+ public function shuffle()
+ {
+ $items = $this->items;
+
+ shuffle($items);
+
+ return new static($items);
+ }
+
+ /**
+ * Slice the underlying collection array.
+ *
+ * @param int $offset
+ * @param int $length
+ * @param bool $preserveKeys
+ * @return static
+ */
+ public function slice($offset, $length = null, $preserveKeys = false)
+ {
+ return new static(array_slice($this->items, $offset, $length, $preserveKeys));
+ }
+
+ /**
+ * Chunk the underlying collection array.
+ *
+ * @param int $size
+ * @param bool $preserveKeys
+ * @return static
+ */
+ public function chunk($size, $preserveKeys = false)
+ {
+ $chunks = [];
+
+ foreach (array_chunk($this->items, $size, $preserveKeys) as $chunk) {
+ $chunks[] = new static($chunk);
+ }
+
+ return new static($chunks);
+ }
+
+ /**
+ * Sort through each item with a callback.
+ *
+ * @param callable|null $callback
+ * @return static
+ */
+ public function sort(callable $callback = null)
+ {
+ $items = $this->items;
+
+ $callback ? uasort($items, $callback) : uasort($items, function ($a, $b) {
+ if ($a == $b) {
+ return 0;
+ }
+
+ return ($a < $b) ? -1 : 1;
+ });
+
+ return new static($items);
+ }
+
+ /**
+ * Sort the collection using the given callback.
+ *
+ * @param callable|string $callback
+ * @param int $options
+ * @param bool $descending
+ * @return static
+ */
+ public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
+ {
+ $results = [];
+
+ $callback = $this->valueRetriever($callback);
+
+ // First we will loop through the items and get the comparator from a callback
+ // function which we were given. Then, we will sort the returned values and
+ // and grab the corresponding values for the sorted keys from this array.
+ foreach ($this->items as $key => $value) {
+ $results[$key] = $callback($value, $key);
+ }
+
+ $descending ? arsort($results, $options)
+ : asort($results, $options);
+
+ // Once we have sorted all of the keys in the array, we will loop through them
+ // and grab the corresponding model so we can set the underlying items list
+ // to the sorted version. Then we'll just return the collection instance.
+ foreach (array_keys($results) as $key) {
+ $results[$key] = $this->items[$key];
+ }
+
+ return new static($results);
+ }
+
+ /**
+ * Sort the collection in descending order using the given callback.
+ *
+ * @param callable|string $callback
+ * @param int $options
+ * @return static
+ */
+ public function sortByDesc($callback, $options = SORT_REGULAR)
+ {
+ return $this->sortBy($callback, $options, true);
+ }
+
+ /**
+ * Splice a portion of the underlying collection array.
+ *
+ * @param int $offset
+ * @param int|null $length
+ * @param mixed $replacement
+ * @return static
+ */
+ public function splice($offset, $length = null, $replacement = [])
+ {
+ if (func_num_args() == 1) {
+ return new static(array_splice($this->items, $offset));
+ }
+
+ return new static(array_splice($this->items, $offset, $length, $replacement));
+ }
+
+ /**
+ * Get the sum of the given values.
+ *
+ * @param callable|string|null $callback
+ * @return mixed
+ */
+ public function sum($callback = null)
+ {
+ if (is_null($callback)) {
+ return array_sum($this->items);
+ }
+
+ $callback = $this->valueRetriever($callback);
+
+ return $this->reduce(function ($result, $item) use ($callback) {
+ return $result += $callback($item);
+ }, 0);
+ }
+
+ /**
+ * Take the first or last {$limit} items.
+ *
+ * @param int $limit
+ * @return static
+ */
+ public function take($limit)
+ {
+ if ($limit < 0) {
+ return $this->slice($limit, abs($limit));
+ }
+
+ return $this->slice(0, $limit);
+ }
+
+ /**
+ * Transform each item in the collection using a callback.
+ *
+ * @param callable $callback
+ * @return $this
+ */
+ public function transform(callable $callback)
+ {
+ $this->items = $this->map($callback)->all();
+
+ return $this;
+ }
+
+ /**
+ * Return only unique items from the collection array.
+ *
+ * @param string|callable|null $key
+ * @return static
+ */
+ public function unique($key = null)
+ {
+ if (is_null($key)) {
+ return new static(array_unique($this->items, SORT_REGULAR));
+ }
+
+ $key = $this->valueRetriever($key);
+
+ $exists = [];
+
+ return $this->reject(function ($item) use ($key, &$exists) {
+ if (in_array($id = $key($item), $exists)) {
+ return true;
+ }
+
+ $exists[] = $id;
+ });
+ }
+
+ /**
+ * Reset the keys on the underlying array.
+ *
+ * @return static
+ */
+ public function values()
+ {
+ return new static(array_values($this->items));
+ }
+
+ /**
+ * Get a value retrieving callback.
+ *
+ * @param string $value
+ * @return callable
+ */
+ protected function valueRetriever($value)
+ {
+ if ($this->useAsCallable($value)) {
+ return $value;
+ }
+
+ return function ($item) use ($value) {
+ return data_get($item, $value);
+ };
+ }
+
+ /**
+ * Zip the collection together with one or more arrays.
+ *
+ * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]);
+ * => [[1, 4], [2, 5], [3, 6]]
+ *
+ * @param mixed ...$items
+ * @return static
+ */
+ public function zip($items)
+ {
+ $arrayableItems = array_map(function ($items) {
+ return $this->getArrayableItems($items);
+ }, func_get_args());
+
+ $params = array_merge([function () {
+ return new static(func_get_args());
+ }, $this->items], $arrayableItems);
+
+ return new static(call_user_func_array('array_map', $params));
+ }
+
+ /**
+ * Get the collection of items as a plain array.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return array_map(function ($value) {
+ return $value instanceof Arrayable ? $value->toArray() : $value;
+ }, $this->items);
+ }
+
+ /**
+ * Convert the object into something JSON serializable.
+ *
+ * @return array
+ */
+ public function jsonSerialize()
+ {
+ return $this->toArray();
+ }
+
+ /**
+ * Get the collection of items as JSON.
+ *
+ * @param int $options
+ * @return string
+ */
+ public function toJson($options = 0)
+ {
+ return json_encode($this->toArray(), $options);
+ }
+
+ /**
+ * Get an iterator for the items.
+ *
+ * @return \ArrayIterator
+ */
+ public function getIterator()
+ {
+ return new ArrayIterator($this->items);
+ }
+
+ /**
+ * Get a CachingIterator instance.
+ *
+ * @param int $flags
+ * @return \CachingIterator
+ */
+ public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING)
+ {
+ return new CachingIterator($this->getIterator(), $flags);
+ }
+
+ /**
+ * Count the number of items in the collection.
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return count($this->items);
+ }
+
+ /**
+ * Determine if an item exists at an offset.
+ *
+ * @param mixed $key
+ * @return bool
+ */
+ public function offsetExists($key)
+ {
+ return array_key_exists($key, $this->items);
+ }
+
+ /**
+ * Get an item at a given offset.
+ *
+ * @param mixed $key
+ * @return mixed
+ */
+ public function offsetGet($key)
+ {
+ return $this->items[$key];
+ }
+
+ /**
+ * Set the item at a given offset.
+ *
+ * @param mixed $key
+ * @param mixed $value
+ * @return void
+ */
+ public function offsetSet($key, $value)
+ {
+ if (is_null($key)) {
+ $this->items[] = $value;
+ } else {
+ $this->items[$key] = $value;
+ }
+ }
+
+ /**
+ * Unset the item at a given offset.
+ *
+ * @param string $key
+ * @return void
+ */
+ public function offsetUnset($key)
+ {
+ unset($this->items[$key]);
+ }
+
+ /**
+ * Convert the collection to its string representation.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toJson();
+ }
+
+ /**
+ * Results array of items from Collection or Arrayable.
+ *
+ * @param mixed $items
+ * @return array
+ */
+ protected function getArrayableItems($items)
+ {
+ if ($items instanceof self) {
+ return $items->all();
+ } elseif ($items instanceof Arrayable) {
+ return $items->toArray();
+ } elseif ($items instanceof Jsonable) {
+ return json_decode($items->toJson(), true);
+ }
+
+ return (array) $items;
+ }
+}
diff --git a/vendor/illuminate/support/Debug/Dumper.php b/vendor/illuminate/support/Debug/Dumper.php
new file mode 100644
index 00000000..99a045da
--- /dev/null
+++ b/vendor/illuminate/support/Debug/Dumper.php
@@ -0,0 +1,26 @@
+dump((new VarCloner)->cloneVar($value));
+ } else {
+ var_dump($value);
+ }
+ }
+}
diff --git a/vendor/illuminate/support/Debug/HtmlDumper.php b/vendor/illuminate/support/Debug/HtmlDumper.php
new file mode 100644
index 00000000..5825ac8d
--- /dev/null
+++ b/vendor/illuminate/support/Debug/HtmlDumper.php
@@ -0,0 +1,29 @@
+ 'background-color:#fff; color:#222; line-height:1.2em; font-weight:normal; font:12px Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:100000',
+ 'num' => 'color:#a71d5d',
+ 'const' => 'color:#795da3',
+ 'str' => 'color:#df5000',
+ 'cchr' => 'color:#222',
+ 'note' => 'color:#a71d5d',
+ 'ref' => 'color:#a0a0a0',
+ 'public' => 'color:#795da3',
+ 'protected' => 'color:#795da3',
+ 'private' => 'color:#795da3',
+ 'meta' => 'color:#b729d9',
+ 'key' => 'color:#df5000',
+ 'index' => 'color:#a71d5d',
+ ];
+}
diff --git a/vendor/illuminate/support/Facades/App.php b/vendor/illuminate/support/Facades/App.php
new file mode 100644
index 00000000..2675d56a
--- /dev/null
+++ b/vendor/illuminate/support/Facades/App.php
@@ -0,0 +1,19 @@
+getEngineResolver()->resolve('blade')->getCompiler();
+ }
+}
diff --git a/vendor/illuminate/support/Facades/Bus.php b/vendor/illuminate/support/Facades/Bus.php
new file mode 100644
index 00000000..7c42e9ed
--- /dev/null
+++ b/vendor/illuminate/support/Facades/Bus.php
@@ -0,0 +1,19 @@
+cookie($key, null));
+ }
+
+ /**
+ * Retrieve a cookie from the request.
+ *
+ * @param string $key
+ * @param mixed $default
+ * @return string
+ */
+ public static function get($key = null, $default = null)
+ {
+ return static::$app['request']->cookie($key, $default);
+ }
+
+ /**
+ * Get the registered name of the component.
+ *
+ * @return string
+ */
+ protected static function getFacadeAccessor()
+ {
+ return 'cookie';
+ }
+}
diff --git a/vendor/illuminate/support/Facades/Crypt.php b/vendor/illuminate/support/Facades/Crypt.php
new file mode 100644
index 00000000..0eef08d1
--- /dev/null
+++ b/vendor/illuminate/support/Facades/Crypt.php
@@ -0,0 +1,19 @@
+instance(static::getFacadeAccessor(), $instance);
+ }
+
+ /**
+ * Initiate a mock expectation on the facade.
+ *
+ * @param mixed
+ * @return \Mockery\Expectation
+ */
+ public static function shouldReceive()
+ {
+ $name = static::getFacadeAccessor();
+
+ if (static::isMock()) {
+ $mock = static::$resolvedInstance[$name];
+ } else {
+ $mock = static::createFreshMockInstance($name);
+ }
+
+ return call_user_func_array([$mock, 'shouldReceive'], func_get_args());
+ }
+
+ /**
+ * Create a fresh mock instance for the given class.
+ *
+ * @param string $name
+ * @return \Mockery\Expectation
+ */
+ protected static function createFreshMockInstance($name)
+ {
+ static::$resolvedInstance[$name] = $mock = static::createMockByName($name);
+
+ $mock->shouldAllowMockingProtectedMethods();
+
+ if (isset(static::$app)) {
+ static::$app->instance($name, $mock);
+ }
+
+ return $mock;
+ }
+
+ /**
+ * Create a fresh mock instance for the given class.
+ *
+ * @param string $name
+ * @return \Mockery\Expectation
+ */
+ protected static function createMockByName($name)
+ {
+ $class = static::getMockableClass($name);
+
+ return $class ? Mockery::mock($class) : Mockery::mock();
+ }
+
+ /**
+ * Determines whether a mock is set as the instance of the facade.
+ *
+ * @return bool
+ */
+ protected static function isMock()
+ {
+ $name = static::getFacadeAccessor();
+
+ return isset(static::$resolvedInstance[$name]) && static::$resolvedInstance[$name] instanceof MockInterface;
+ }
+
+ /**
+ * Get the mockable class for the bound instance.
+ *
+ * @return string|null
+ */
+ protected static function getMockableClass()
+ {
+ if ($root = static::getFacadeRoot()) {
+ return get_class($root);
+ }
+ }
+
+ /**
+ * Get the root object behind the facade.
+ *
+ * @return mixed
+ */
+ public static function getFacadeRoot()
+ {
+ return static::resolveFacadeInstance(static::getFacadeAccessor());
+ }
+
+ /**
+ * Get the registered name of the component.
+ *
+ * @return string
+ *
+ * @throws \RuntimeException
+ */
+ protected static function getFacadeAccessor()
+ {
+ throw new RuntimeException('Facade does not implement getFacadeAccessor method.');
+ }
+
+ /**
+ * Resolve the facade root instance from the container.
+ *
+ * @param string|object $name
+ * @return mixed
+ */
+ protected static function resolveFacadeInstance($name)
+ {
+ if (is_object($name)) {
+ return $name;
+ }
+
+ if (isset(static::$resolvedInstance[$name])) {
+ return static::$resolvedInstance[$name];
+ }
+
+ return static::$resolvedInstance[$name] = static::$app[$name];
+ }
+
+ /**
+ * Clear a resolved facade instance.
+ *
+ * @param string $name
+ * @return void
+ */
+ public static function clearResolvedInstance($name)
+ {
+ unset(static::$resolvedInstance[$name]);
+ }
+
+ /**
+ * Clear all of the resolved instances.
+ *
+ * @return void
+ */
+ public static function clearResolvedInstances()
+ {
+ static::$resolvedInstance = [];
+ }
+
+ /**
+ * Get the application instance behind the facade.
+ *
+ * @return \Illuminate\Contracts\Foundation\Application
+ */
+ public static function getFacadeApplication()
+ {
+ return static::$app;
+ }
+
+ /**
+ * Set the application instance.
+ *
+ * @param \Illuminate\Contracts\Foundation\Application $app
+ * @return void
+ */
+ public static function setFacadeApplication($app)
+ {
+ static::$app = $app;
+ }
+
+ /**
+ * Handle dynamic, static calls to the object.
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public static function __callStatic($method, $args)
+ {
+ $instance = static::getFacadeRoot();
+
+ if (! $instance) {
+ throw new RuntimeException('A facade root has not been set.');
+ }
+
+ switch (count($args)) {
+ case 0:
+ return $instance->$method();
+ case 1:
+ return $instance->$method($args[0]);
+ case 2:
+ return $instance->$method($args[0], $args[1]);
+ case 3:
+ return $instance->$method($args[0], $args[1], $args[2]);
+ case 4:
+ return $instance->$method($args[0], $args[1], $args[2], $args[3]);
+ default:
+ return call_user_func_array([$instance, $method], $args);
+ }
+ }
+}
diff --git a/vendor/illuminate/support/Facades/File.php b/vendor/illuminate/support/Facades/File.php
new file mode 100644
index 00000000..0f81bf62
--- /dev/null
+++ b/vendor/illuminate/support/Facades/File.php
@@ -0,0 +1,19 @@
+input($key, $default);
+ }
+
+ /**
+ * Get the registered name of the component.
+ *
+ * @return string
+ */
+ protected static function getFacadeAccessor()
+ {
+ return 'request';
+ }
+}
diff --git a/vendor/illuminate/support/Facades/Lang.php b/vendor/illuminate/support/Facades/Lang.php
new file mode 100644
index 00000000..e5862b99
--- /dev/null
+++ b/vendor/illuminate/support/Facades/Lang.php
@@ -0,0 +1,19 @@
+connection($name)->getSchemaBuilder();
+ }
+
+ /**
+ * Get a schema builder instance for the default connection.
+ *
+ * @return \Illuminate\Database\Schema\Builder
+ */
+ protected static function getFacadeAccessor()
+ {
+ return static::$app['db']->connection()->getSchemaBuilder();
+ }
+}
diff --git a/vendor/illuminate/support/Facades/Session.php b/vendor/illuminate/support/Facades/Session.php
new file mode 100644
index 00000000..bc9b5fd9
--- /dev/null
+++ b/vendor/illuminate/support/Facades/Session.php
@@ -0,0 +1,20 @@
+ $value) {
+ $this->attributes[$key] = $value;
+ }
+ }
+
+ /**
+ * Get an attribute from the container.
+ *
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public function get($key, $default = null)
+ {
+ if (array_key_exists($key, $this->attributes)) {
+ return $this->attributes[$key];
+ }
+
+ return value($default);
+ }
+
+ /**
+ * Get the attributes from the container.
+ *
+ * @return array
+ */
+ public function getAttributes()
+ {
+ return $this->attributes;
+ }
+
+ /**
+ * Convert the Fluent instance to an array.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return $this->attributes;
+ }
+
+ /**
+ * Convert the object into something JSON serializable.
+ *
+ * @return array
+ */
+ public function jsonSerialize()
+ {
+ return $this->toArray();
+ }
+
+ /**
+ * Convert the Fluent instance to JSON.
+ *
+ * @param int $options
+ * @return string
+ */
+ public function toJson($options = 0)
+ {
+ return json_encode($this->toArray(), $options);
+ }
+
+ /**
+ * Determine if the given offset exists.
+ *
+ * @param string $offset
+ * @return bool
+ */
+ public function offsetExists($offset)
+ {
+ return isset($this->{$offset});
+ }
+
+ /**
+ * Get the value for a given offset.
+ *
+ * @param string $offset
+ * @return mixed
+ */
+ public function offsetGet($offset)
+ {
+ return $this->{$offset};
+ }
+
+ /**
+ * Set the value at the given offset.
+ *
+ * @param string $offset
+ * @param mixed $value
+ * @return void
+ */
+ public function offsetSet($offset, $value)
+ {
+ $this->{$offset} = $value;
+ }
+
+ /**
+ * Unset the value at the given offset.
+ *
+ * @param string $offset
+ * @return void
+ */
+ public function offsetUnset($offset)
+ {
+ unset($this->{$offset});
+ }
+
+ /**
+ * Handle dynamic calls to the container to set attributes.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return $this
+ */
+ public function __call($method, $parameters)
+ {
+ $this->attributes[$method] = count($parameters) > 0 ? $parameters[0] : true;
+
+ return $this;
+ }
+
+ /**
+ * Dynamically retrieve the value of an attribute.
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function __get($key)
+ {
+ return $this->get($key);
+ }
+
+ /**
+ * Dynamically set the value of an attribute.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function __set($key, $value)
+ {
+ $this->attributes[$key] = $value;
+ }
+
+ /**
+ * Dynamically check if an attribute is set.
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function __isset($key)
+ {
+ return isset($this->attributes[$key]);
+ }
+
+ /**
+ * Dynamically unset an attribute.
+ *
+ * @param string $key
+ * @return void
+ */
+ public function __unset($key)
+ {
+ unset($this->attributes[$key]);
+ }
+}
diff --git a/vendor/illuminate/support/HtmlString.php b/vendor/illuminate/support/HtmlString.php
new file mode 100644
index 00000000..8d246cff
--- /dev/null
+++ b/vendor/illuminate/support/HtmlString.php
@@ -0,0 +1,46 @@
+html = $html;
+ }
+
+ /**
+ * Get the the HTML string.
+ *
+ * @return string
+ */
+ public function toHtml()
+ {
+ return $this->html;
+ }
+
+ /**
+ * Get the the HTML string.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toHtml();
+ }
+}
diff --git a/vendor/illuminate/support/Manager.php b/vendor/illuminate/support/Manager.php
new file mode 100644
index 00000000..29154c61
--- /dev/null
+++ b/vendor/illuminate/support/Manager.php
@@ -0,0 +1,139 @@
+app = $app;
+ }
+
+ /**
+ * Get the default driver name.
+ *
+ * @return string
+ */
+ abstract public function getDefaultDriver();
+
+ /**
+ * Get a driver instance.
+ *
+ * @param string $driver
+ * @return mixed
+ */
+ public function driver($driver = null)
+ {
+ $driver = $driver ?: $this->getDefaultDriver();
+
+ // If the given driver has not been created before, we will create the instances
+ // here and cache it so we can return it next time very quickly. If there is
+ // already a driver created by this name, we'll just return that instance.
+ if (! isset($this->drivers[$driver])) {
+ $this->drivers[$driver] = $this->createDriver($driver);
+ }
+
+ return $this->drivers[$driver];
+ }
+
+ /**
+ * Create a new driver instance.
+ *
+ * @param string $driver
+ * @return mixed
+ *
+ * @throws \InvalidArgumentException
+ */
+ protected function createDriver($driver)
+ {
+ $method = 'create'.ucfirst($driver).'Driver';
+
+ // We'll check to see if a creator method exists for the given driver. If not we
+ // will check for a custom driver creator, which allows developers to create
+ // drivers using their own customized driver creator Closure to create it.
+ if (isset($this->customCreators[$driver])) {
+ return $this->callCustomCreator($driver);
+ } elseif (method_exists($this, $method)) {
+ return $this->$method();
+ }
+
+ throw new InvalidArgumentException("Driver [$driver] not supported.");
+ }
+
+ /**
+ * Call a custom driver creator.
+ *
+ * @param string $driver
+ * @return mixed
+ */
+ protected function callCustomCreator($driver)
+ {
+ return $this->customCreators[$driver]($this->app);
+ }
+
+ /**
+ * Register a custom driver creator Closure.
+ *
+ * @param string $driver
+ * @param \Closure $callback
+ * @return $this
+ */
+ public function extend($driver, Closure $callback)
+ {
+ $this->customCreators[$driver] = $callback;
+
+ return $this;
+ }
+
+ /**
+ * Get all of the created "drivers".
+ *
+ * @return array
+ */
+ public function getDrivers()
+ {
+ return $this->drivers;
+ }
+
+ /**
+ * Dynamically call the default driver instance.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return mixed
+ */
+ public function __call($method, $parameters)
+ {
+ return call_user_func_array([$this->driver(), $method], $parameters);
+ }
+}
diff --git a/vendor/illuminate/support/MessageBag.php b/vendor/illuminate/support/MessageBag.php
new file mode 100644
index 00000000..a58b1548
--- /dev/null
+++ b/vendor/illuminate/support/MessageBag.php
@@ -0,0 +1,309 @@
+ $value) {
+ $this->messages[$key] = (array) $value;
+ }
+ }
+
+ /**
+ * Get the keys present in the message bag.
+ *
+ * @return array
+ */
+ public function keys()
+ {
+ return array_keys($this->messages);
+ }
+
+ /**
+ * Add a message to the bag.
+ *
+ * @param string $key
+ * @param string $message
+ * @return $this
+ */
+ public function add($key, $message)
+ {
+ if ($this->isUnique($key, $message)) {
+ $this->messages[$key][] = $message;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Merge a new array of messages into the bag.
+ *
+ * @param \Illuminate\Contracts\Support\MessageProvider|array $messages
+ * @return $this
+ */
+ public function merge($messages)
+ {
+ if ($messages instanceof MessageProvider) {
+ $messages = $messages->getMessageBag()->getMessages();
+ }
+
+ $this->messages = array_merge_recursive($this->messages, $messages);
+
+ return $this;
+ }
+
+ /**
+ * Determine if a key and message combination already exists.
+ *
+ * @param string $key
+ * @param string $message
+ * @return bool
+ */
+ protected function isUnique($key, $message)
+ {
+ $messages = (array) $this->messages;
+
+ return ! isset($messages[$key]) || ! in_array($message, $messages[$key]);
+ }
+
+ /**
+ * Determine if messages exist for a given key.
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function has($key = null)
+ {
+ return $this->first($key) !== '';
+ }
+
+ /**
+ * Get the first message from the bag for a given key.
+ *
+ * @param string $key
+ * @param string $format
+ * @return string
+ */
+ public function first($key = null, $format = null)
+ {
+ $messages = is_null($key) ? $this->all($format) : $this->get($key, $format);
+
+ return count($messages) > 0 ? $messages[0] : '';
+ }
+
+ /**
+ * Get all of the messages from the bag for a given key.
+ *
+ * @param string $key
+ * @param string $format
+ * @return array
+ */
+ public function get($key, $format = null)
+ {
+ // If the message exists in the container, we will transform it and return
+ // the message. Otherwise, we'll return an empty array since the entire
+ // methods is to return back an array of messages in the first place.
+ if (array_key_exists($key, $this->messages)) {
+ return $this->transform($this->messages[$key], $this->checkFormat($format), $key);
+ }
+
+ return [];
+ }
+
+ /**
+ * Get all of the messages for every key in the bag.
+ *
+ * @param string $format
+ * @return array
+ */
+ public function all($format = null)
+ {
+ $format = $this->checkFormat($format);
+
+ $all = [];
+
+ foreach ($this->messages as $key => $messages) {
+ $all = array_merge($all, $this->transform($messages, $format, $key));
+ }
+
+ return $all;
+ }
+
+ /**
+ * Format an array of messages.
+ *
+ * @param array $messages
+ * @param string $format
+ * @param string $messageKey
+ * @return array
+ */
+ protected function transform($messages, $format, $messageKey)
+ {
+ $messages = (array) $messages;
+
+ // We will simply spin through the given messages and transform each one
+ // replacing the :message place holder with the real message allowing
+ // the messages to be easily formatted to each developer's desires.
+ $replace = [':message', ':key'];
+
+ foreach ($messages as &$message) {
+ $message = str_replace($replace, [$message, $messageKey], $format);
+ }
+
+ return $messages;
+ }
+
+ /**
+ * Get the appropriate format based on the given format.
+ *
+ * @param string $format
+ * @return string
+ */
+ protected function checkFormat($format)
+ {
+ return $format ?: $this->format;
+ }
+
+ /**
+ * Get the raw messages in the container.
+ *
+ * @return array
+ */
+ public function getMessages()
+ {
+ return $this->messages;
+ }
+
+ /**
+ * Get the messages for the instance.
+ *
+ * @return \Illuminate\Support\MessageBag
+ */
+ public function getMessageBag()
+ {
+ return $this;
+ }
+
+ /**
+ * Get the default message format.
+ *
+ * @return string
+ */
+ public function getFormat()
+ {
+ return $this->format;
+ }
+
+ /**
+ * Set the default message format.
+ *
+ * @param string $format
+ * @return \Illuminate\Support\MessageBag
+ */
+ public function setFormat($format = ':message')
+ {
+ $this->format = $format;
+
+ return $this;
+ }
+
+ /**
+ * Determine if the message bag has any messages.
+ *
+ * @return bool
+ */
+ public function isEmpty()
+ {
+ return ! $this->any();
+ }
+
+ /**
+ * Determine if the message bag has any messages.
+ *
+ * @return bool
+ */
+ public function any()
+ {
+ return $this->count() > 0;
+ }
+
+ /**
+ * Get the number of messages in the container.
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return count($this->messages, COUNT_RECURSIVE) - count($this->messages);
+ }
+
+ /**
+ * Get the instance as an array.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return $this->getMessages();
+ }
+
+ /**
+ * Convert the object into something JSON serializable.
+ *
+ * @return array
+ */
+ public function jsonSerialize()
+ {
+ return $this->toArray();
+ }
+
+ /**
+ * Convert the object to its JSON representation.
+ *
+ * @param int $options
+ * @return string
+ */
+ public function toJson($options = 0)
+ {
+ return json_encode($this->toArray(), $options);
+ }
+
+ /**
+ * Convert the message bag to its string representation.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toJson();
+ }
+}
diff --git a/vendor/illuminate/support/NamespacedItemResolver.php b/vendor/illuminate/support/NamespacedItemResolver.php
new file mode 100644
index 00000000..a111985e
--- /dev/null
+++ b/vendor/illuminate/support/NamespacedItemResolver.php
@@ -0,0 +1,104 @@
+parsed[$key])) {
+ return $this->parsed[$key];
+ }
+
+ // If the key does not contain a double colon, it means the key is not in a
+ // namespace, and is just a regular configuration item. Namespaces are a
+ // tool for organizing configuration items for things such as modules.
+ if (strpos($key, '::') === false) {
+ $segments = explode('.', $key);
+
+ $parsed = $this->parseBasicSegments($segments);
+ } else {
+ $parsed = $this->parseNamespacedSegments($key);
+ }
+
+ // Once we have the parsed array of this key's elements, such as its groups
+ // and namespace, we will cache each array inside a simple list that has
+ // the key and the parsed array for quick look-ups for later requests.
+ return $this->parsed[$key] = $parsed;
+ }
+
+ /**
+ * Parse an array of basic segments.
+ *
+ * @param array $segments
+ * @return array
+ */
+ protected function parseBasicSegments(array $segments)
+ {
+ // The first segment in a basic array will always be the group, so we can go
+ // ahead and grab that segment. If there is only one total segment we are
+ // just pulling an entire group out of the array and not a single item.
+ $group = $segments[0];
+
+ if (count($segments) == 1) {
+ return [null, $group, null];
+ }
+
+ // If there is more than one segment in this group, it means we are pulling
+ // a specific item out of a groups and will need to return the item name
+ // as well as the group so we know which item to pull from the arrays.
+ else {
+ $item = implode('.', array_slice($segments, 1));
+
+ return [null, $group, $item];
+ }
+ }
+
+ /**
+ * Parse an array of namespaced segments.
+ *
+ * @param string $key
+ * @return array
+ */
+ protected function parseNamespacedSegments($key)
+ {
+ list($namespace, $item) = explode('::', $key);
+
+ // First we'll just explode the first segment to get the namespace and group
+ // since the item should be in the remaining segments. Once we have these
+ // two pieces of data we can proceed with parsing out the item's value.
+ $itemSegments = explode('.', $item);
+
+ $groupAndItem = array_slice($this->parseBasicSegments($itemSegments), 1);
+
+ return array_merge([$namespace], $groupAndItem);
+ }
+
+ /**
+ * Set the parsed value of a key.
+ *
+ * @param string $key
+ * @param array $parsed
+ * @return void
+ */
+ public function setParsedKey($key, $parsed)
+ {
+ $this->parsed[$key] = $parsed;
+ }
+}
diff --git a/vendor/illuminate/support/Pluralizer.php b/vendor/illuminate/support/Pluralizer.php
new file mode 100644
index 00000000..7ba7a4da
--- /dev/null
+++ b/vendor/illuminate/support/Pluralizer.php
@@ -0,0 +1,104 @@
+app = $app;
+ }
+
+ /**
+ * Register the service provider.
+ *
+ * @return void
+ */
+ abstract public function register();
+
+ /**
+ * Merge the given configuration with the existing configuration.
+ *
+ * @param string $path
+ * @param string $key
+ * @return void
+ */
+ protected function mergeConfigFrom($path, $key)
+ {
+ $config = $this->app['config']->get($key, []);
+
+ $this->app['config']->set($key, array_merge(require $path, $config));
+ }
+
+ /**
+ * Register a view file namespace.
+ *
+ * @param string $path
+ * @param string $namespace
+ * @return void
+ */
+ protected function loadViewsFrom($path, $namespace)
+ {
+ if (is_dir($appPath = $this->app->basePath().'/resources/views/vendor/'.$namespace)) {
+ $this->app['view']->addNamespace($namespace, $appPath);
+ }
+
+ $this->app['view']->addNamespace($namespace, $path);
+ }
+
+ /**
+ * Register a translation file namespace.
+ *
+ * @param string $path
+ * @param string $namespace
+ * @return void
+ */
+ protected function loadTranslationsFrom($path, $namespace)
+ {
+ $this->app['translator']->addNamespace($namespace, $path);
+ }
+
+ /**
+ * Register paths to be published by the publish command.
+ *
+ * @param array $paths
+ * @param string $group
+ * @return void
+ */
+ protected function publishes(array $paths, $group = null)
+ {
+ $class = get_class($this);
+
+ if (! array_key_exists($class, static::$publishes)) {
+ static::$publishes[$class] = [];
+ }
+
+ static::$publishes[$class] = array_merge(static::$publishes[$class], $paths);
+
+ if ($group) {
+ if (! array_key_exists($group, static::$publishGroups)) {
+ static::$publishGroups[$group] = [];
+ }
+
+ static::$publishGroups[$group] = array_merge(static::$publishGroups[$group], $paths);
+ }
+ }
+
+ /**
+ * Get the paths to publish.
+ *
+ * @param string $provider
+ * @param string $group
+ * @return array
+ */
+ public static function pathsToPublish($provider = null, $group = null)
+ {
+ if ($provider && $group) {
+ if (empty(static::$publishes[$provider]) || empty(static::$publishGroups[$group])) {
+ return [];
+ }
+
+ return array_intersect(static::$publishes[$provider], static::$publishGroups[$group]);
+ }
+
+ if ($group && array_key_exists($group, static::$publishGroups)) {
+ return static::$publishGroups[$group];
+ }
+
+ if ($provider && array_key_exists($provider, static::$publishes)) {
+ return static::$publishes[$provider];
+ }
+
+ if ($group || $provider) {
+ return [];
+ }
+
+ $paths = [];
+
+ foreach (static::$publishes as $class => $publish) {
+ $paths = array_merge($paths, $publish);
+ }
+
+ return $paths;
+ }
+
+ /**
+ * Register the package's custom Artisan commands.
+ *
+ * @param array|mixed $commands
+ * @return void
+ */
+ public function commands($commands)
+ {
+ $commands = is_array($commands) ? $commands : func_get_args();
+
+ // To register the commands with Artisan, we will grab each of the arguments
+ // passed into the method and listen for Artisan "start" event which will
+ // give us the Artisan console instance which we will give commands to.
+ $events = $this->app['events'];
+
+ $events->listen('artisan.start', function ($artisan) use ($commands) {
+ $artisan->resolveCommands($commands);
+ });
+ }
+
+ /**
+ * Get the services provided by the provider.
+ *
+ * @return array
+ */
+ public function provides()
+ {
+ return [];
+ }
+
+ /**
+ * Get the events that trigger this service provider to register.
+ *
+ * @return array
+ */
+ public function when()
+ {
+ return [];
+ }
+
+ /**
+ * Determine if the provider is deferred.
+ *
+ * @return bool
+ */
+ public function isDeferred()
+ {
+ return $this->defer;
+ }
+
+ /**
+ * Get a list of files that should be compiled for the package.
+ *
+ * @return array
+ */
+ public static function compiles()
+ {
+ return [];
+ }
+
+ /**
+ * Dynamically handle missing method calls.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return mixed
+ */
+ public function __call($method, $parameters)
+ {
+ if ($method == 'boot') {
+ return;
+ }
+
+ throw new BadMethodCallException("Call to undefined method [{$method}]");
+ }
+}
diff --git a/vendor/illuminate/support/Str.php b/vendor/illuminate/support/Str.php
new file mode 100644
index 00000000..24d308da
--- /dev/null
+++ b/vendor/illuminate/support/Str.php
@@ -0,0 +1,443 @@
+container = $container;
+
+ if (! $this->container->bound('config')) {
+ $this->container->instance('config', new Fluent);
+ }
+ }
+
+ /**
+ * Make this capsule instance available globally.
+ *
+ * @return void
+ */
+ public function setAsGlobal()
+ {
+ static::$instance = $this;
+ }
+
+ /**
+ * Get the IoC container instance.
+ *
+ * @return \Illuminate\Contracts\Container\Container
+ */
+ public function getContainer()
+ {
+ return $this->container;
+ }
+
+ /**
+ * Set the IoC container instance.
+ *
+ * @param \Illuminate\Contracts\Container\Container $container
+ * @return void
+ */
+ public function setContainer(Container $container)
+ {
+ $this->container = $container;
+ }
+}
diff --git a/vendor/illuminate/support/Traits/Macroable.php b/vendor/illuminate/support/Traits/Macroable.php
new file mode 100644
index 00000000..a6a54fd3
--- /dev/null
+++ b/vendor/illuminate/support/Traits/Macroable.php
@@ -0,0 +1,83 @@
+bindTo($this, get_class($this)), $parameters);
+ } else {
+ return call_user_func_array(static::$macros[$method], $parameters);
+ }
+ }
+
+ throw new BadMethodCallException("Method {$method} does not exist.");
+ }
+}
diff --git a/vendor/illuminate/support/ViewErrorBag.php b/vendor/illuminate/support/ViewErrorBag.php
new file mode 100644
index 00000000..9fe3b961
--- /dev/null
+++ b/vendor/illuminate/support/ViewErrorBag.php
@@ -0,0 +1,107 @@
+bags[$key]);
+ }
+
+ /**
+ * Get a MessageBag instance from the bags.
+ *
+ * @param string $key
+ * @return \Illuminate\Contracts\Support\MessageBag
+ */
+ public function getBag($key)
+ {
+ return Arr::get($this->bags, $key) ?: new MessageBag;
+ }
+
+ /**
+ * Get all the bags.
+ *
+ * @return array
+ */
+ public function getBags()
+ {
+ return $this->bags;
+ }
+
+ /**
+ * Add a new MessageBag instance to the bags.
+ *
+ * @param string $key
+ * @param \Illuminate\Contracts\Support\MessageBag $bag
+ * @return $this
+ */
+ public function put($key, MessageBagContract $bag)
+ {
+ $this->bags[$key] = $bag;
+
+ return $this;
+ }
+
+ /**
+ * Get the number of messages in the default bag.
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return $this->default->count();
+ }
+
+ /**
+ * Dynamically call methods on the default bag.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return mixed
+ */
+ public function __call($method, $parameters)
+ {
+ return call_user_func_array([$this->default, $method], $parameters);
+ }
+
+ /**
+ * Dynamically access a view error bag.
+ *
+ * @param string $key
+ * @return \Illuminate\Contracts\Support\MessageBag
+ */
+ public function __get($key)
+ {
+ return $this->getBag($key);
+ }
+
+ /**
+ * Dynamically set a view error bag.
+ *
+ * @param string $key
+ * @param \Illuminate\Contracts\Support\MessageBag $value
+ * @return void
+ */
+ public function __set($key, $value)
+ {
+ $this->put($key, $value);
+ }
+}
diff --git a/vendor/illuminate/support/composer.json b/vendor/illuminate/support/composer.json
new file mode 100644
index 00000000..a96f06ab
--- /dev/null
+++ b/vendor/illuminate/support/composer.json
@@ -0,0 +1,42 @@
+{
+ "name": "illuminate/support",
+ "description": "The Illuminate Support package.",
+ "license": "MIT",
+ "homepage": "http://laravel.com",
+ "support": {
+ "issues": "https://github.com/laravel/framework/issues",
+ "source": "https://github.com/laravel/framework"
+ },
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylorotwell@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.5.9",
+ "ext-mbstring": "*",
+ "illuminate/contracts": "5.1.*",
+ "doctrine/inflector": "~1.0",
+ "danielstjules/stringy": "~1.8",
+ "paragonie/random_compat": "~1.4"
+ },
+ "autoload": {
+ "psr-4": {
+ "Illuminate\\Support\\": ""
+ },
+ "files": [
+ "helpers.php"
+ ]
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "suggest": {
+ "jeremeamia/superclosure": "Required to be able to serialize closures (~2.0).",
+ "symfony/var-dumper": "Improves the dd function (2.7.*)."
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/illuminate/support/helpers.php b/vendor/illuminate/support/helpers.php
new file mode 100644
index 00000000..3ea27f5b
--- /dev/null
+++ b/vendor/illuminate/support/helpers.php
@@ -0,0 +1,800 @@
+ $value) {
+ if (is_numeric($key)) {
+ $start++;
+
+ $array[$start] = Arr::pull($array, $key);
+ }
+ }
+
+ return $array;
+ }
+}
+
+if (! function_exists('array_add')) {
+ /**
+ * Add an element to an array using "dot" notation if it doesn't exist.
+ *
+ * @param array $array
+ * @param string $key
+ * @param mixed $value
+ * @return array
+ */
+ function array_add($array, $key, $value)
+ {
+ return Arr::add($array, $key, $value);
+ }
+}
+
+if (! function_exists('array_build')) {
+ /**
+ * Build a new array using a callback.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @return array
+ */
+ function array_build($array, callable $callback)
+ {
+ return Arr::build($array, $callback);
+ }
+}
+
+if (! function_exists('array_collapse')) {
+ /**
+ * Collapse an array of arrays into a single array.
+ *
+ * @param \ArrayAccess|array $array
+ * @return array
+ */
+ function array_collapse($array)
+ {
+ return Arr::collapse($array);
+ }
+}
+
+if (! function_exists('array_divide')) {
+ /**
+ * Divide an array into two arrays. One with keys and the other with values.
+ *
+ * @param array $array
+ * @return array
+ */
+ function array_divide($array)
+ {
+ return Arr::divide($array);
+ }
+}
+
+if (! function_exists('array_dot')) {
+ /**
+ * Flatten a multi-dimensional associative array with dots.
+ *
+ * @param array $array
+ * @param string $prepend
+ * @return array
+ */
+ function array_dot($array, $prepend = '')
+ {
+ return Arr::dot($array, $prepend);
+ }
+}
+
+if (! function_exists('array_except')) {
+ /**
+ * Get all of the given array except for a specified array of items.
+ *
+ * @param array $array
+ * @param array|string $keys
+ * @return array
+ */
+ function array_except($array, $keys)
+ {
+ return Arr::except($array, $keys);
+ }
+}
+
+if (! function_exists('array_fetch')) {
+ /**
+ * Fetch a flattened array of a nested array element.
+ *
+ * @param array $array
+ * @param string $key
+ * @return array
+ *
+ * @deprecated since version 5.1. Use array_pluck instead.
+ */
+ function array_fetch($array, $key)
+ {
+ return Arr::fetch($array, $key);
+ }
+}
+
+if (! function_exists('array_first')) {
+ /**
+ * Return the first element in an array passing a given truth test.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @param mixed $default
+ * @return mixed
+ */
+ function array_first($array, callable $callback, $default = null)
+ {
+ return Arr::first($array, $callback, $default);
+ }
+}
+
+if (! function_exists('array_flatten')) {
+ /**
+ * Flatten a multi-dimensional array into a single level.
+ *
+ * @param array $array
+ * @return array
+ */
+ function array_flatten($array)
+ {
+ return Arr::flatten($array);
+ }
+}
+
+if (! function_exists('array_forget')) {
+ /**
+ * Remove one or many array items from a given array using "dot" notation.
+ *
+ * @param array $array
+ * @param array|string $keys
+ * @return void
+ */
+ function array_forget(&$array, $keys)
+ {
+ return Arr::forget($array, $keys);
+ }
+}
+
+if (! function_exists('array_get')) {
+ /**
+ * Get an item from an array using "dot" notation.
+ *
+ * @param array $array
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ function array_get($array, $key, $default = null)
+ {
+ return Arr::get($array, $key, $default);
+ }
+}
+
+if (! function_exists('array_has')) {
+ /**
+ * Check if an item exists in an array using "dot" notation.
+ *
+ * @param array $array
+ * @param string $key
+ * @return bool
+ */
+ function array_has($array, $key)
+ {
+ return Arr::has($array, $key);
+ }
+}
+
+if (! function_exists('array_last')) {
+ /**
+ * Return the last element in an array passing a given truth test.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @param mixed $default
+ * @return mixed
+ */
+ function array_last($array, $callback, $default = null)
+ {
+ return Arr::last($array, $callback, $default);
+ }
+}
+
+if (! function_exists('array_only')) {
+ /**
+ * Get a subset of the items from the given array.
+ *
+ * @param array $array
+ * @param array|string $keys
+ * @return array
+ */
+ function array_only($array, $keys)
+ {
+ return Arr::only($array, $keys);
+ }
+}
+
+if (! function_exists('array_pluck')) {
+ /**
+ * Pluck an array of values from an array.
+ *
+ * @param array $array
+ * @param string|array $value
+ * @param string|array|null $key
+ * @return array
+ */
+ function array_pluck($array, $value, $key = null)
+ {
+ return Arr::pluck($array, $value, $key);
+ }
+}
+
+if (! function_exists('array_prepend')) {
+ /**
+ * Push an item onto the beginning of an array.
+ *
+ * @param array $array
+ * @param mixed $value
+ * @param mixed $key
+ * @return array
+ */
+ function array_prepend($array, $value, $key = null)
+ {
+ return Arr::prepend($array, $value, $key);
+ }
+}
+
+if (! function_exists('array_pull')) {
+ /**
+ * Get a value from the array, and remove it.
+ *
+ * @param array $array
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ function array_pull(&$array, $key, $default = null)
+ {
+ return Arr::pull($array, $key, $default);
+ }
+}
+
+if (! function_exists('array_set')) {
+ /**
+ * Set an array item to a given value using "dot" notation.
+ *
+ * If no key is given to the method, the entire array will be replaced.
+ *
+ * @param array $array
+ * @param string $key
+ * @param mixed $value
+ * @return array
+ */
+ function array_set(&$array, $key, $value)
+ {
+ return Arr::set($array, $key, $value);
+ }
+}
+
+if (! function_exists('array_sort')) {
+ /**
+ * Sort the array using the given callback.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @return array
+ */
+ function array_sort($array, callable $callback)
+ {
+ return Arr::sort($array, $callback);
+ }
+}
+
+if (! function_exists('array_sort_recursive')) {
+ /**
+ * Recursively sort an array by keys and values.
+ *
+ * @param array $array
+ * @return array
+ */
+ function array_sort_recursive($array)
+ {
+ return Arr::sortRecursive($array);
+ }
+}
+
+if (! function_exists('array_where')) {
+ /**
+ * Filter the array using the given callback.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @return array
+ */
+ function array_where($array, callable $callback)
+ {
+ return Arr::where($array, $callback);
+ }
+}
+
+if (! function_exists('camel_case')) {
+ /**
+ * Convert a value to camel case.
+ *
+ * @param string $value
+ * @return string
+ */
+ function camel_case($value)
+ {
+ return Str::camel($value);
+ }
+}
+
+if (! function_exists('class_basename')) {
+ /**
+ * Get the class "basename" of the given object / class.
+ *
+ * @param string|object $class
+ * @return string
+ */
+ function class_basename($class)
+ {
+ $class = is_object($class) ? get_class($class) : $class;
+
+ return basename(str_replace('\\', '/', $class));
+ }
+}
+
+if (! function_exists('class_uses_recursive')) {
+ /**
+ * Returns all traits used by a class, its subclasses and trait of their traits.
+ *
+ * @param string $class
+ * @return array
+ */
+ function class_uses_recursive($class)
+ {
+ $results = [];
+
+ foreach (array_merge([$class => $class], class_parents($class)) as $class) {
+ $results += trait_uses_recursive($class);
+ }
+
+ return array_unique($results);
+ }
+}
+
+if (! function_exists('collect')) {
+ /**
+ * Create a collection from the given value.
+ *
+ * @param mixed $value
+ * @return \Illuminate\Support\Collection
+ */
+ function collect($value = null)
+ {
+ return new Collection($value);
+ }
+}
+
+if (! function_exists('data_get')) {
+ /**
+ * Get an item from an array or object using "dot" notation.
+ *
+ * @param mixed $target
+ * @param string|array $key
+ * @param mixed $default
+ * @return mixed
+ */
+ function data_get($target, $key, $default = null)
+ {
+ if (is_null($key)) {
+ return $target;
+ }
+
+ $key = is_array($key) ? $key : explode('.', $key);
+
+ foreach ($key as $segment) {
+ if (is_array($target)) {
+ if (! array_key_exists($segment, $target)) {
+ return value($default);
+ }
+
+ $target = $target[$segment];
+ } elseif ($target instanceof ArrayAccess) {
+ if (! isset($target[$segment])) {
+ return value($default);
+ }
+
+ $target = $target[$segment];
+ } elseif (is_object($target)) {
+ if (! isset($target->{$segment})) {
+ return value($default);
+ }
+
+ $target = $target->{$segment};
+ } else {
+ return value($default);
+ }
+ }
+
+ return $target;
+ }
+}
+
+if (! function_exists('dd')) {
+ /**
+ * Dump the passed variables and end the script.
+ *
+ * @param mixed
+ * @return void
+ */
+ function dd()
+ {
+ array_map(function ($x) {
+ (new Dumper)->dump($x);
+ }, func_get_args());
+
+ die(1);
+ }
+}
+
+if (! function_exists('e')) {
+ /**
+ * Escape HTML entities in a string.
+ *
+ * @param \Illuminate\Contracts\Support\Htmlable|string $value
+ * @return string
+ */
+ function e($value)
+ {
+ if ($value instanceof Htmlable) {
+ return $value->toHtml();
+ }
+
+ return htmlentities($value, ENT_QUOTES, 'UTF-8', false);
+ }
+}
+
+if (! function_exists('ends_with')) {
+ /**
+ * Determine if a given string ends with a given substring.
+ *
+ * @param string $haystack
+ * @param string|array $needles
+ * @return bool
+ */
+ function ends_with($haystack, $needles)
+ {
+ return Str::endsWith($haystack, $needles);
+ }
+}
+
+if (! function_exists('head')) {
+ /**
+ * Get the first element of an array. Useful for method chaining.
+ *
+ * @param array $array
+ * @return mixed
+ */
+ function head($array)
+ {
+ return reset($array);
+ }
+}
+
+if (! function_exists('last')) {
+ /**
+ * Get the last element from an array.
+ *
+ * @param array $array
+ * @return mixed
+ */
+ function last($array)
+ {
+ return end($array);
+ }
+}
+
+if (! function_exists('object_get')) {
+ /**
+ * Get an item from an object using "dot" notation.
+ *
+ * @param object $object
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ function object_get($object, $key, $default = null)
+ {
+ if (is_null($key) || trim($key) == '') {
+ return $object;
+ }
+
+ foreach (explode('.', $key) as $segment) {
+ if (! is_object($object) || ! isset($object->{$segment})) {
+ return value($default);
+ }
+
+ $object = $object->{$segment};
+ }
+
+ return $object;
+ }
+}
+
+if (! function_exists('preg_replace_sub')) {
+ /**
+ * Replace a given pattern with each value in the array in sequentially.
+ *
+ * @param string $pattern
+ * @param array $replacements
+ * @param string $subject
+ * @return string
+ */
+ function preg_replace_sub($pattern, &$replacements, $subject)
+ {
+ return preg_replace_callback($pattern, function ($match) use (&$replacements) {
+ foreach ($replacements as $key => $value) {
+ return array_shift($replacements);
+ }
+ }, $subject);
+ }
+}
+
+if (! function_exists('snake_case')) {
+ /**
+ * Convert a string to snake case.
+ *
+ * @param string $value
+ * @param string $delimiter
+ * @return string
+ */
+ function snake_case($value, $delimiter = '_')
+ {
+ return Str::snake($value, $delimiter);
+ }
+}
+
+if (! function_exists('starts_with')) {
+ /**
+ * Determine if a given string starts with a given substring.
+ *
+ * @param string $haystack
+ * @param string|array $needles
+ * @return bool
+ */
+ function starts_with($haystack, $needles)
+ {
+ return Str::startsWith($haystack, $needles);
+ }
+}
+
+if (! function_exists('str_contains')) {
+ /**
+ * Determine if a given string contains a given substring.
+ *
+ * @param string $haystack
+ * @param string|array $needles
+ * @return bool
+ */
+ function str_contains($haystack, $needles)
+ {
+ return Str::contains($haystack, $needles);
+ }
+}
+
+if (! function_exists('str_finish')) {
+ /**
+ * Cap a string with a single instance of a given value.
+ *
+ * @param string $value
+ * @param string $cap
+ * @return string
+ */
+ function str_finish($value, $cap)
+ {
+ return Str::finish($value, $cap);
+ }
+}
+
+if (! function_exists('str_is')) {
+ /**
+ * Determine if a given string matches a given pattern.
+ *
+ * @param string $pattern
+ * @param string $value
+ * @return bool
+ */
+ function str_is($pattern, $value)
+ {
+ return Str::is($pattern, $value);
+ }
+}
+
+if (! function_exists('str_limit')) {
+ /**
+ * Limit the number of characters in a string.
+ *
+ * @param string $value
+ * @param int $limit
+ * @param string $end
+ * @return string
+ */
+ function str_limit($value, $limit = 100, $end = '...')
+ {
+ return Str::limit($value, $limit, $end);
+ }
+}
+
+if (! function_exists('str_plural')) {
+ /**
+ * Get the plural form of an English word.
+ *
+ * @param string $value
+ * @param int $count
+ * @return string
+ */
+ function str_plural($value, $count = 2)
+ {
+ return Str::plural($value, $count);
+ }
+}
+
+if (! function_exists('str_random')) {
+ /**
+ * Generate a more truly "random" alpha-numeric string.
+ *
+ * @param int $length
+ * @return string
+ *
+ * @throws \RuntimeException
+ */
+ function str_random($length = 16)
+ {
+ return Str::random($length);
+ }
+}
+
+if (! function_exists('str_replace_array')) {
+ /**
+ * Replace a given value in the string sequentially with an array.
+ *
+ * @param string $search
+ * @param array $replace
+ * @param string $subject
+ * @return string
+ */
+ function str_replace_array($search, array $replace, $subject)
+ {
+ foreach ($replace as $value) {
+ $subject = preg_replace('/'.$search.'/', $value, $subject, 1);
+ }
+
+ return $subject;
+ }
+}
+
+if (! function_exists('str_singular')) {
+ /**
+ * Get the singular form of an English word.
+ *
+ * @param string $value
+ * @return string
+ */
+ function str_singular($value)
+ {
+ return Str::singular($value);
+ }
+}
+
+if (! function_exists('str_slug')) {
+ /**
+ * Generate a URL friendly "slug" from a given string.
+ *
+ * @param string $title
+ * @param string $separator
+ * @return string
+ */
+ function str_slug($title, $separator = '-')
+ {
+ return Str::slug($title, $separator);
+ }
+}
+
+if (! function_exists('studly_case')) {
+ /**
+ * Convert a value to studly caps case.
+ *
+ * @param string $value
+ * @return string
+ */
+ function studly_case($value)
+ {
+ return Str::studly($value);
+ }
+}
+
+if (! function_exists('title_case')) {
+ /**
+ * Convert a value to title case.
+ *
+ * @param string $value
+ * @return string
+ */
+ function title_case($value)
+ {
+ return Str::title($value);
+ }
+}
+
+if (! function_exists('trait_uses_recursive')) {
+ /**
+ * Returns all traits used by a trait and its traits.
+ *
+ * @param string $trait
+ * @return array
+ */
+ function trait_uses_recursive($trait)
+ {
+ $traits = class_uses($trait);
+
+ foreach ($traits as $trait) {
+ $traits += trait_uses_recursive($trait);
+ }
+
+ return $traits;
+ }
+}
+
+if (! function_exists('value')) {
+ /**
+ * Return the default value of the given value.
+ *
+ * @param mixed $value
+ * @return mixed
+ */
+ function value($value)
+ {
+ return $value instanceof Closure ? $value() : $value;
+ }
+}
+
+if (! function_exists('windows_os')) {
+ /**
+ * Determine whether the current envrionment is Windows based.
+ *
+ * @return bool
+ */
+ function windows_os()
+ {
+ return strtolower(substr(PHP_OS, 0, 3)) === 'win';
+ }
+}
+
+if (! function_exists('with')) {
+ /**
+ * Return the given object. Useful for chaining.
+ *
+ * @param mixed $object
+ * @return mixed
+ */
+ function with($object)
+ {
+ return $object;
+ }
+}
diff --git a/vendor/illuminate/translation/FileLoader.php b/vendor/illuminate/translation/FileLoader.php
new file mode 100644
index 00000000..835acccd
--- /dev/null
+++ b/vendor/illuminate/translation/FileLoader.php
@@ -0,0 +1,127 @@
+path = $path;
+ $this->files = $files;
+ }
+
+ /**
+ * Load the messages for the given locale.
+ *
+ * @param string $locale
+ * @param string $group
+ * @param string $namespace
+ * @return array
+ */
+ public function load($locale, $group, $namespace = null)
+ {
+ if (is_null($namespace) || $namespace == '*') {
+ return $this->loadPath($this->path, $locale, $group);
+ }
+
+ return $this->loadNamespaced($locale, $group, $namespace);
+ }
+
+ /**
+ * Load a namespaced translation group.
+ *
+ * @param string $locale
+ * @param string $group
+ * @param string $namespace
+ * @return array
+ */
+ protected function loadNamespaced($locale, $group, $namespace)
+ {
+ if (isset($this->hints[$namespace])) {
+ $lines = $this->loadPath($this->hints[$namespace], $locale, $group);
+
+ return $this->loadNamespaceOverrides($lines, $locale, $group, $namespace);
+ }
+
+ return [];
+ }
+
+ /**
+ * Load a local namespaced translation group for overrides.
+ *
+ * @param array $lines
+ * @param string $locale
+ * @param string $group
+ * @param string $namespace
+ * @return array
+ */
+ protected function loadNamespaceOverrides(array $lines, $locale, $group, $namespace)
+ {
+ $file = "{$this->path}/vendor/{$namespace}/{$locale}/{$group}.php";
+
+ if ($this->files->exists($file)) {
+ return array_replace_recursive($lines, $this->files->getRequire($file));
+ }
+
+ return $lines;
+ }
+
+ /**
+ * Load a locale from a given path.
+ *
+ * @param string $path
+ * @param string $locale
+ * @param string $group
+ * @return array
+ */
+ protected function loadPath($path, $locale, $group)
+ {
+ if ($this->files->exists($full = "{$path}/{$locale}/{$group}.php")) {
+ return $this->files->getRequire($full);
+ }
+
+ return [];
+ }
+
+ /**
+ * Add a new namespace to the loader.
+ *
+ * @param string $namespace
+ * @param string $hint
+ * @return void
+ */
+ public function addNamespace($namespace, $hint)
+ {
+ $this->hints[$namespace] = $hint;
+ }
+}
diff --git a/vendor/illuminate/translation/LoaderInterface.php b/vendor/illuminate/translation/LoaderInterface.php
new file mode 100644
index 00000000..9e455724
--- /dev/null
+++ b/vendor/illuminate/translation/LoaderInterface.php
@@ -0,0 +1,25 @@
+registerLoader();
+
+ $this->app->singleton('translator', function ($app) {
+ $loader = $app['translation.loader'];
+
+ // When registering the translator component, we'll need to set the default
+ // locale as well as the fallback locale. So, we'll grab the application
+ // configuration so we can easily get both of these values from there.
+ $locale = $app['config']['app.locale'];
+
+ $trans = new Translator($loader, $locale);
+
+ $trans->setFallback($app['config']['app.fallback_locale']);
+
+ return $trans;
+ });
+ }
+
+ /**
+ * Register the translation line loader.
+ *
+ * @return void
+ */
+ protected function registerLoader()
+ {
+ $this->app->singleton('translation.loader', function ($app) {
+ return new FileLoader($app['files'], $app['path.lang']);
+ });
+ }
+
+ /**
+ * Get the services provided by the provider.
+ *
+ * @return array
+ */
+ public function provides()
+ {
+ return ['translator', 'translation.loader'];
+ }
+}
diff --git a/vendor/illuminate/translation/Translator.php b/vendor/illuminate/translation/Translator.php
new file mode 100644
index 00000000..62f09c7c
--- /dev/null
+++ b/vendor/illuminate/translation/Translator.php
@@ -0,0 +1,383 @@
+loader = $loader;
+ $this->locale = $locale;
+ }
+
+ /**
+ * Determine if a translation exists for a given locale.
+ *
+ * @param string $key
+ * @param string|null $locale
+ * @return bool
+ */
+ public function hasForLocale($key, $locale = null)
+ {
+ return $this->has($key, $locale, false);
+ }
+
+ /**
+ * Determine if a translation exists.
+ *
+ * @param string $key
+ * @param string|null $locale
+ * @param bool $fallback
+ * @return bool
+ */
+ public function has($key, $locale = null, $fallback = true)
+ {
+ return $this->get($key, [], $locale, $fallback) !== $key;
+ }
+
+ /**
+ * Get the translation for the given key.
+ *
+ * @param string $key
+ * @param array $replace
+ * @param string|null $locale
+ * @param bool $fallback
+ * @return string
+ */
+ public function get($key, array $replace = [], $locale = null, $fallback = true)
+ {
+ list($namespace, $group, $item) = $this->parseKey($key);
+
+ // Here we will get the locale that should be used for the language line. If one
+ // was not passed, we will use the default locales which was given to us when
+ // the translator was instantiated. Then, we can load the lines and return.
+ $locales = $fallback ? $this->parseLocale($locale) : [$locale ?: $this->locale];
+
+ foreach ($locales as $locale) {
+ $this->load($namespace, $group, $locale);
+
+ $line = $this->getLine(
+ $namespace, $group, $locale, $item, $replace
+ );
+
+ if (! is_null($line)) {
+ break;
+ }
+ }
+
+ // If the line doesn't exist, we will return back the key which was requested as
+ // that will be quick to spot in the UI if language keys are wrong or missing
+ // from the application's language files. Otherwise we can return the line.
+ if (! isset($line)) {
+ return $key;
+ }
+
+ return $line;
+ }
+
+ /**
+ * Retrieve a language line out the loaded array.
+ *
+ * @param string $namespace
+ * @param string $group
+ * @param string $locale
+ * @param string $item
+ * @param array $replace
+ * @return string|array|null
+ */
+ protected function getLine($namespace, $group, $locale, $item, array $replace)
+ {
+ $line = Arr::get($this->loaded[$namespace][$group][$locale], $item);
+
+ if (is_string($line)) {
+ return $this->makeReplacements($line, $replace);
+ } elseif (is_array($line) && count($line) > 0) {
+ return $line;
+ }
+ }
+
+ /**
+ * Make the place-holder replacements on a line.
+ *
+ * @param string $line
+ * @param array $replace
+ * @return string
+ */
+ protected function makeReplacements($line, array $replace)
+ {
+ $replace = $this->sortReplacements($replace);
+
+ foreach ($replace as $key => $value) {
+ $line = str_replace(':'.$key, $value, $line);
+ }
+
+ return $line;
+ }
+
+ /**
+ * Sort the replacements array.
+ *
+ * @param array $replace
+ * @return array
+ */
+ protected function sortReplacements(array $replace)
+ {
+ return (new Collection($replace))->sortBy(function ($value, $key) {
+ return mb_strlen($key) * -1;
+ });
+ }
+
+ /**
+ * Get a translation according to an integer value.
+ *
+ * @param string $key
+ * @param int $number
+ * @param array $replace
+ * @param string $locale
+ * @return string
+ */
+ public function choice($key, $number, array $replace = [], $locale = null)
+ {
+ $line = $this->get($key, $replace, $locale = $locale ?: $this->locale ?: $this->fallback);
+
+ $replace['count'] = $number;
+
+ return $this->makeReplacements($this->getSelector()->choose($line, $number, $locale), $replace);
+ }
+
+ /**
+ * Get the translation for a given key.
+ *
+ * @param string $id
+ * @param array $parameters
+ * @param string $domain
+ * @param string $locale
+ * @return string
+ */
+ public function trans($id, array $parameters = [], $domain = 'messages', $locale = null)
+ {
+ return $this->get($id, $parameters, $locale);
+ }
+
+ /**
+ * Get a translation according to an integer value.
+ *
+ * @param string $id
+ * @param int $number
+ * @param array $parameters
+ * @param string $domain
+ * @param string $locale
+ * @return string
+ */
+ public function transChoice($id, $number, array $parameters = [], $domain = 'messages', $locale = null)
+ {
+ return $this->choice($id, $number, $parameters, $locale);
+ }
+
+ /**
+ * Load the specified language group.
+ *
+ * @param string $namespace
+ * @param string $group
+ * @param string $locale
+ * @return void
+ */
+ public function load($namespace, $group, $locale)
+ {
+ if ($this->isLoaded($namespace, $group, $locale)) {
+ return;
+ }
+
+ // The loader is responsible for returning the array of language lines for the
+ // given namespace, group, and locale. We'll set the lines in this array of
+ // lines that have already been loaded so that we can easily access them.
+ $lines = $this->loader->load($locale, $group, $namespace);
+
+ $this->loaded[$namespace][$group][$locale] = $lines;
+ }
+
+ /**
+ * Determine if the given group has been loaded.
+ *
+ * @param string $namespace
+ * @param string $group
+ * @param string $locale
+ * @return bool
+ */
+ protected function isLoaded($namespace, $group, $locale)
+ {
+ return isset($this->loaded[$namespace][$group][$locale]);
+ }
+
+ /**
+ * Add a new namespace to the loader.
+ *
+ * @param string $namespace
+ * @param string $hint
+ * @return void
+ */
+ public function addNamespace($namespace, $hint)
+ {
+ $this->loader->addNamespace($namespace, $hint);
+ }
+
+ /**
+ * Parse a key into namespace, group, and item.
+ *
+ * @param string $key
+ * @return array
+ */
+ public function parseKey($key)
+ {
+ $segments = parent::parseKey($key);
+
+ if (is_null($segments[0])) {
+ $segments[0] = '*';
+ }
+
+ return $segments;
+ }
+
+ /**
+ * Get the array of locales to be checked.
+ *
+ * @param string|null $locale
+ * @return array
+ */
+ protected function parseLocale($locale)
+ {
+ if (! is_null($locale)) {
+ return array_filter([$locale, $this->fallback]);
+ }
+
+ return array_filter([$this->locale, $this->fallback]);
+ }
+
+ /**
+ * Get the message selector instance.
+ *
+ * @return \Symfony\Component\Translation\MessageSelector
+ */
+ public function getSelector()
+ {
+ if (! isset($this->selector)) {
+ $this->selector = new MessageSelector;
+ }
+
+ return $this->selector;
+ }
+
+ /**
+ * Set the message selector instance.
+ *
+ * @param \Symfony\Component\Translation\MessageSelector $selector
+ * @return void
+ */
+ public function setSelector(MessageSelector $selector)
+ {
+ $this->selector = $selector;
+ }
+
+ /**
+ * Get the language line loader implementation.
+ *
+ * @return \Illuminate\Translation\LoaderInterface
+ */
+ public function getLoader()
+ {
+ return $this->loader;
+ }
+
+ /**
+ * Get the default locale being used.
+ *
+ * @return string
+ */
+ public function locale()
+ {
+ return $this->getLocale();
+ }
+
+ /**
+ * Get the default locale being used.
+ *
+ * @return string
+ */
+ public function getLocale()
+ {
+ return $this->locale;
+ }
+
+ /**
+ * Set the default locale.
+ *
+ * @param string $locale
+ * @return void
+ */
+ public function setLocale($locale)
+ {
+ $this->locale = $locale;
+ }
+
+ /**
+ * Get the fallback locale being used.
+ *
+ * @return string
+ */
+ public function getFallback()
+ {
+ return $this->fallback;
+ }
+
+ /**
+ * Set the fallback locale being used.
+ *
+ * @param string $fallback
+ * @return void
+ */
+ public function setFallback($fallback)
+ {
+ $this->fallback = $fallback;
+ }
+}
diff --git a/vendor/illuminate/translation/composer.json b/vendor/illuminate/translation/composer.json
new file mode 100644
index 00000000..e3e355d6
--- /dev/null
+++ b/vendor/illuminate/translation/composer.json
@@ -0,0 +1,33 @@
+{
+ "name": "illuminate/translation",
+ "description": "The Illuminate Translation package.",
+ "license": "MIT",
+ "homepage": "http://laravel.com",
+ "support": {
+ "issues": "https://github.com/laravel/framework/issues",
+ "source": "https://github.com/laravel/framework"
+ },
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylorotwell@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.5.9",
+ "illuminate/filesystem": "5.1.*",
+ "illuminate/support": "5.1.*",
+ "symfony/translation": "2.7.*"
+ },
+ "autoload": {
+ "psr-4": {
+ "Illuminate\\Translation\\": ""
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/illuminate/validation/DatabasePresenceVerifier.php b/vendor/illuminate/validation/DatabasePresenceVerifier.php
new file mode 100644
index 00000000..42aa3532
--- /dev/null
+++ b/vendor/illuminate/validation/DatabasePresenceVerifier.php
@@ -0,0 +1,120 @@
+db = $db;
+ }
+
+ /**
+ * Count the number of objects in a collection having the given value.
+ *
+ * @param string $collection
+ * @param string $column
+ * @param string $value
+ * @param int $excludeId
+ * @param string $idColumn
+ * @param array $extra
+ * @return int
+ */
+ public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = [])
+ {
+ $query = $this->table($collection)->where($column, '=', $value);
+
+ if (! is_null($excludeId) && $excludeId != 'NULL') {
+ $query->where($idColumn ?: 'id', '<>', $excludeId);
+ }
+
+ foreach ($extra as $key => $extraValue) {
+ $this->addWhere($query, $key, $extraValue);
+ }
+
+ return $query->count();
+ }
+
+ /**
+ * Count the number of objects in a collection with the given values.
+ *
+ * @param string $collection
+ * @param string $column
+ * @param array $values
+ * @param array $extra
+ * @return int
+ */
+ public function getMultiCount($collection, $column, array $values, array $extra = [])
+ {
+ $query = $this->table($collection)->whereIn($column, $values);
+
+ foreach ($extra as $key => $extraValue) {
+ $this->addWhere($query, $key, $extraValue);
+ }
+
+ return $query->count();
+ }
+
+ /**
+ * Add a "where" clause to the given query.
+ *
+ * @param \Illuminate\Database\Query\Builder $query
+ * @param string $key
+ * @param string $extraValue
+ * @return void
+ */
+ protected function addWhere($query, $key, $extraValue)
+ {
+ if ($extraValue === 'NULL') {
+ $query->whereNull($key);
+ } elseif ($extraValue === 'NOT_NULL') {
+ $query->whereNotNull($key);
+ } else {
+ $query->where($key, $extraValue);
+ }
+ }
+
+ /**
+ * Get a query builder for the given table.
+ *
+ * @param string $table
+ * @return \Illuminate\Database\Query\Builder
+ */
+ protected function table($table)
+ {
+ return $this->db->connection($this->connection)->table($table)->useWritePdo();
+ }
+
+ /**
+ * Set the connection to be used.
+ *
+ * @param string $connection
+ * @return void
+ */
+ public function setConnection($connection)
+ {
+ $this->connection = $connection;
+ }
+}
diff --git a/vendor/illuminate/validation/Factory.php b/vendor/illuminate/validation/Factory.php
new file mode 100644
index 00000000..bbc5e225
--- /dev/null
+++ b/vendor/illuminate/validation/Factory.php
@@ -0,0 +1,241 @@
+container = $container;
+ $this->translator = $translator;
+ }
+
+ /**
+ * Create a new Validator instance.
+ *
+ * @param array $data
+ * @param array $rules
+ * @param array $messages
+ * @param array $customAttributes
+ * @return \Illuminate\Validation\Validator
+ */
+ public function make(array $data, array $rules, array $messages = [], array $customAttributes = [])
+ {
+ // The presence verifier is responsible for checking the unique and exists data
+ // for the validator. It is behind an interface so that multiple versions of
+ // it may be written besides database. We'll inject it into the validator.
+ $validator = $this->resolve($data, $rules, $messages, $customAttributes);
+
+ if (! is_null($this->verifier)) {
+ $validator->setPresenceVerifier($this->verifier);
+ }
+
+ // Next we'll set the IoC container instance of the validator, which is used to
+ // resolve out class based validator extensions. If it is not set then these
+ // types of extensions will not be possible on these validation instances.
+ if (! is_null($this->container)) {
+ $validator->setContainer($this->container);
+ }
+
+ $this->addExtensions($validator);
+
+ return $validator;
+ }
+
+ /**
+ * Add the extensions to a validator instance.
+ *
+ * @param \Illuminate\Validation\Validator $validator
+ * @return void
+ */
+ protected function addExtensions(Validator $validator)
+ {
+ $validator->addExtensions($this->extensions);
+
+ // Next, we will add the implicit extensions, which are similar to the required
+ // and accepted rule in that they are run even if the attributes is not in a
+ // array of data that is given to a validator instances via instantiation.
+ $implicit = $this->implicitExtensions;
+
+ $validator->addImplicitExtensions($implicit);
+
+ $validator->addReplacers($this->replacers);
+
+ $validator->setFallbackMessages($this->fallbackMessages);
+ }
+
+ /**
+ * Resolve a new Validator instance.
+ *
+ * @param array $data
+ * @param array $rules
+ * @param array $messages
+ * @param array $customAttributes
+ * @return \Illuminate\Validation\Validator
+ */
+ protected function resolve(array $data, array $rules, array $messages, array $customAttributes)
+ {
+ if (is_null($this->resolver)) {
+ return new Validator($this->translator, $data, $rules, $messages, $customAttributes);
+ }
+
+ return call_user_func($this->resolver, $this->translator, $data, $rules, $messages, $customAttributes);
+ }
+
+ /**
+ * Register a custom validator extension.
+ *
+ * @param string $rule
+ * @param \Closure|string $extension
+ * @param string $message
+ * @return void
+ */
+ public function extend($rule, $extension, $message = null)
+ {
+ $this->extensions[$rule] = $extension;
+
+ if ($message) {
+ $this->fallbackMessages[Str::snake($rule)] = $message;
+ }
+ }
+
+ /**
+ * Register a custom implicit validator extension.
+ *
+ * @param string $rule
+ * @param \Closure|string $extension
+ * @param string $message
+ * @return void
+ */
+ public function extendImplicit($rule, $extension, $message = null)
+ {
+ $this->implicitExtensions[$rule] = $extension;
+
+ if ($message) {
+ $this->fallbackMessages[Str::snake($rule)] = $message;
+ }
+ }
+
+ /**
+ * Register a custom implicit validator message replacer.
+ *
+ * @param string $rule
+ * @param \Closure|string $replacer
+ * @return void
+ */
+ public function replacer($rule, $replacer)
+ {
+ $this->replacers[$rule] = $replacer;
+ }
+
+ /**
+ * Set the Validator instance resolver.
+ *
+ * @param \Closure $resolver
+ * @return void
+ */
+ public function resolver(Closure $resolver)
+ {
+ $this->resolver = $resolver;
+ }
+
+ /**
+ * Get the Translator implementation.
+ *
+ * @return \Symfony\Component\Translation\TranslatorInterface
+ */
+ public function getTranslator()
+ {
+ return $this->translator;
+ }
+
+ /**
+ * Get the Presence Verifier implementation.
+ *
+ * @return \Illuminate\Validation\PresenceVerifierInterface
+ */
+ public function getPresenceVerifier()
+ {
+ return $this->verifier;
+ }
+
+ /**
+ * Set the Presence Verifier implementation.
+ *
+ * @param \Illuminate\Validation\PresenceVerifierInterface $presenceVerifier
+ * @return void
+ */
+ public function setPresenceVerifier(PresenceVerifierInterface $presenceVerifier)
+ {
+ $this->verifier = $presenceVerifier;
+ }
+}
diff --git a/vendor/illuminate/validation/PresenceVerifierInterface.php b/vendor/illuminate/validation/PresenceVerifierInterface.php
new file mode 100644
index 00000000..74496299
--- /dev/null
+++ b/vendor/illuminate/validation/PresenceVerifierInterface.php
@@ -0,0 +1,30 @@
+getValidatorInstance();
+
+ if (! $this->passesAuthorization()) {
+ $this->failedAuthorization();
+ } elseif (! $instance->passes()) {
+ $this->failedValidation($instance);
+ }
+ }
+
+ /**
+ * Get the validator instance for the request.
+ *
+ * @return \Illuminate\Validation\Validator
+ */
+ protected function getValidatorInstance()
+ {
+ return $this->validator();
+ }
+
+ /**
+ * Handle a failed validation attempt.
+ *
+ * @param \Illuminate\Validation\Validator $validator
+ * @return mixed
+ */
+ protected function failedValidation(Validator $validator)
+ {
+ throw new ValidationException($validator);
+ }
+
+ /**
+ * Determine if the request passes the authorization check.
+ *
+ * @return bool
+ */
+ protected function passesAuthorization()
+ {
+ if (method_exists($this, 'authorize')) {
+ return $this->authorize();
+ }
+
+ return true;
+ }
+
+ /**
+ * Handle a failed authorization attempt.
+ *
+ * @return mixed
+ */
+ protected function failedAuthorization()
+ {
+ throw new UnauthorizedException;
+ }
+}
diff --git a/vendor/illuminate/validation/ValidationServiceProvider.php b/vendor/illuminate/validation/ValidationServiceProvider.php
new file mode 100644
index 00000000..5eaf08f4
--- /dev/null
+++ b/vendor/illuminate/validation/ValidationServiceProvider.php
@@ -0,0 +1,68 @@
+registerValidationResolverHook();
+
+ $this->registerPresenceVerifier();
+
+ $this->registerValidationFactory();
+ }
+
+ /**
+ * Register the "ValidatesWhenResolved" container hook.
+ *
+ * @return void
+ */
+ protected function registerValidationResolverHook()
+ {
+ $this->app->afterResolving(function (ValidatesWhenResolved $resolved) {
+ $resolved->validate();
+ });
+ }
+
+ /**
+ * Register the validation factory.
+ *
+ * @return void
+ */
+ protected function registerValidationFactory()
+ {
+ $this->app->singleton('validator', function ($app) {
+ $validator = new Factory($app['translator'], $app);
+
+ // The validation presence verifier is responsible for determining the existence
+ // of values in a given data collection, typically a relational database or
+ // other persistent data stores. And it is used to check for uniqueness.
+ if (isset($app['validation.presence'])) {
+ $validator->setPresenceVerifier($app['validation.presence']);
+ }
+
+ return $validator;
+ });
+ }
+
+ /**
+ * Register the database presence verifier.
+ *
+ * @return void
+ */
+ protected function registerPresenceVerifier()
+ {
+ $this->app->singleton('validation.presence', function ($app) {
+ return new DatabasePresenceVerifier($app['db']);
+ });
+ }
+}
diff --git a/vendor/illuminate/validation/Validator.php b/vendor/illuminate/validation/Validator.php
new file mode 100644
index 00000000..ae81165e
--- /dev/null
+++ b/vendor/illuminate/validation/Validator.php
@@ -0,0 +1,2696 @@
+translator = $translator;
+ $this->customMessages = $messages;
+ $this->data = $this->parseData($data);
+ $this->rules = $this->explodeRules($rules);
+ $this->customAttributes = $customAttributes;
+ }
+
+ /**
+ * Parse the data and hydrate the files array.
+ *
+ * @param array $data
+ * @param string $arrayKey
+ * @return array
+ */
+ protected function parseData(array $data, $arrayKey = null)
+ {
+ if (is_null($arrayKey)) {
+ $this->files = [];
+ }
+
+ foreach ($data as $key => $value) {
+ $key = ($arrayKey) ? "$arrayKey.$key" : $key;
+
+ // If this value is an instance of the HttpFoundation File class we will
+ // remove it from the data array and add it to the files array, which
+ // we use to conveniently separate out these files from other data.
+ if ($value instanceof File) {
+ $this->files[$key] = $value;
+
+ unset($data[$key]);
+ } elseif (is_array($value)) {
+ $this->parseData($value, $key);
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Explode the rules into an array of rules.
+ *
+ * @param string|array $rules
+ * @return array
+ */
+ protected function explodeRules($rules)
+ {
+ foreach ($rules as $key => &$rule) {
+ $rule = (is_string($rule)) ? explode('|', $rule) : $rule;
+ }
+
+ return $rules;
+ }
+
+ /**
+ * After an after validation callback.
+ *
+ * @param callable|string $callback
+ * @return $this
+ */
+ public function after($callback)
+ {
+ $this->after[] = function () use ($callback) {
+ return call_user_func_array($callback, [$this]);
+ };
+
+ return $this;
+ }
+
+ /**
+ * Add conditions to a given field based on a Closure.
+ *
+ * @param string $attribute
+ * @param string|array $rules
+ * @param callable $callback
+ * @return void
+ */
+ public function sometimes($attribute, $rules, callable $callback)
+ {
+ $payload = new Fluent(array_merge($this->data, $this->files));
+
+ if (call_user_func($callback, $payload)) {
+ foreach ((array) $attribute as $key) {
+ $this->mergeRules($key, $rules);
+ }
+ }
+ }
+
+ /**
+ * Define a set of rules that apply to each element in an array attribute.
+ *
+ * @param string $attribute
+ * @param string|array $rules
+ * @return void
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function each($attribute, $rules)
+ {
+ $data = Arr::get($this->data, $attribute);
+
+ if (! is_array($data)) {
+ if ($this->hasRule($attribute, 'Array')) {
+ return;
+ }
+
+ throw new InvalidArgumentException('Attribute for each() must be an array.');
+ }
+
+ foreach ($data as $dataKey => $dataValue) {
+ foreach ((array) $rules as $ruleKey => $ruleValue) {
+ if (! is_string($ruleKey)) {
+ $this->mergeRules("$attribute.$dataKey", $ruleValue);
+ } else {
+ $this->mergeRules("$attribute.$dataKey.$ruleKey", $ruleValue);
+ }
+ }
+ }
+ }
+
+ /**
+ * Merge additional rules into a given attribute.
+ *
+ * @param string $attribute
+ * @param string|array $rules
+ * @return void
+ */
+ public function mergeRules($attribute, $rules)
+ {
+ $current = isset($this->rules[$attribute]) ? $this->rules[$attribute] : [];
+
+ $merge = head($this->explodeRules([$rules]));
+
+ $this->rules[$attribute] = array_merge($current, $merge);
+ }
+
+ /**
+ * Determine if the data passes the validation rules.
+ *
+ * @return bool
+ */
+ public function passes()
+ {
+ $this->messages = new MessageBag;
+
+ // We'll spin through each rule, validating the attributes attached to that
+ // rule. Any error messages will be added to the containers with each of
+ // the other error messages, returning true if we don't have messages.
+ foreach ($this->rules as $attribute => $rules) {
+ foreach ($rules as $rule) {
+ $this->validate($attribute, $rule);
+ }
+ }
+
+ // Here we will spin through all of the "after" hooks on this validator and
+ // fire them off. This gives the callbacks a chance to perform all kinds
+ // of other validation that needs to get wrapped up in this operation.
+ foreach ($this->after as $after) {
+ call_user_func($after);
+ }
+
+ return count($this->messages->all()) === 0;
+ }
+
+ /**
+ * Determine if the data fails the validation rules.
+ *
+ * @return bool
+ */
+ public function fails()
+ {
+ return ! $this->passes();
+ }
+
+ /**
+ * Validate a given attribute against a rule.
+ *
+ * @param string $attribute
+ * @param string $rule
+ * @return void
+ */
+ protected function validate($attribute, $rule)
+ {
+ list($rule, $parameters) = $this->parseRule($rule);
+
+ if ($rule == '') {
+ return;
+ }
+
+ // We will get the value for the given attribute from the array of data and then
+ // verify that the attribute is indeed validatable. Unless the rule implies
+ // that the attribute is required, rules are not run for missing values.
+ $value = $this->getValue($attribute);
+
+ $validatable = $this->isValidatable($rule, $attribute, $value);
+
+ $method = "validate{$rule}";
+
+ if ($validatable && ! $this->$method($attribute, $value, $parameters, $this)) {
+ $this->addFailure($attribute, $rule, $parameters);
+ }
+ }
+
+ /**
+ * Returns the data which was valid.
+ *
+ * @return array
+ */
+ public function valid()
+ {
+ if (! $this->messages) {
+ $this->passes();
+ }
+
+ return array_diff_key($this->data, $this->messages()->toArray());
+ }
+
+ /**
+ * Returns the data which was invalid.
+ *
+ * @return array
+ */
+ public function invalid()
+ {
+ if (! $this->messages) {
+ $this->passes();
+ }
+
+ return array_intersect_key($this->data, $this->messages()->toArray());
+ }
+
+ /**
+ * Get the value of a given attribute.
+ *
+ * @param string $attribute
+ * @return mixed
+ */
+ protected function getValue($attribute)
+ {
+ if (! is_null($value = Arr::get($this->data, $attribute))) {
+ return $value;
+ } elseif (! is_null($value = Arr::get($this->files, $attribute))) {
+ return $value;
+ }
+ }
+
+ /**
+ * Determine if the attribute is validatable.
+ *
+ * @param string $rule
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function isValidatable($rule, $attribute, $value)
+ {
+ return $this->presentOrRuleIsImplicit($rule, $attribute, $value) &&
+ $this->passesOptionalCheck($attribute) &&
+ $this->hasNotFailedPreviousRuleIfPresenceRule($rule, $attribute);
+ }
+
+ /**
+ * Determine if the field is present, or the rule implies required.
+ *
+ * @param string $rule
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function presentOrRuleIsImplicit($rule, $attribute, $value)
+ {
+ return $this->validateRequired($attribute, $value) || $this->isImplicit($rule);
+ }
+
+ /**
+ * Determine if the attribute passes any optional check.
+ *
+ * @param string $attribute
+ * @return bool
+ */
+ protected function passesOptionalCheck($attribute)
+ {
+ if ($this->hasRule($attribute, ['Sometimes'])) {
+ return array_key_exists($attribute, Arr::dot($this->data))
+ || in_array($attribute, array_keys($this->data))
+ || array_key_exists($attribute, $this->files);
+ }
+
+ return true;
+ }
+
+ /**
+ * Determine if a given rule implies the attribute is required.
+ *
+ * @param string $rule
+ * @return bool
+ */
+ protected function isImplicit($rule)
+ {
+ return in_array($rule, $this->implicitRules);
+ }
+
+ /**
+ * Determine if it's a necessary presence validation.
+ *
+ * This is to avoid possible database type comparison errors.
+ *
+ * @param string $rule
+ * @param string $attribute
+ * @return bool
+ */
+ protected function hasNotFailedPreviousRuleIfPresenceRule($rule, $attribute)
+ {
+ return in_array($rule, ['Unique', 'Exists'])
+ ? ! $this->messages->has($attribute) : true;
+ }
+
+ /**
+ * Add a failed rule and error message to the collection.
+ *
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return void
+ */
+ protected function addFailure($attribute, $rule, $parameters)
+ {
+ $this->addError($attribute, $rule, $parameters);
+
+ $this->failedRules[$attribute][$rule] = $parameters;
+ }
+
+ /**
+ * Add an error message to the validator's collection of messages.
+ *
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return void
+ */
+ protected function addError($attribute, $rule, $parameters)
+ {
+ $message = $this->getMessage($attribute, $rule);
+
+ $message = $this->doReplacements($message, $attribute, $rule, $parameters);
+
+ $this->messages->add($attribute, $message);
+ }
+
+ /**
+ * "Validate" optional attributes.
+ *
+ * Always returns true, just lets us put sometimes in rules.
+ *
+ * @return bool
+ */
+ protected function validateSometimes()
+ {
+ return true;
+ }
+
+ /**
+ * Validate that a required attribute exists.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateRequired($attribute, $value)
+ {
+ if (is_null($value)) {
+ return false;
+ } elseif (is_string($value) && trim($value) === '') {
+ return false;
+ } elseif ((is_array($value) || $value instanceof Countable) && count($value) < 1) {
+ return false;
+ } elseif ($value instanceof File) {
+ return (string) $value->getPath() != '';
+ }
+
+ return true;
+ }
+
+ /**
+ * Validate the given attribute is filled if it is present.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateFilled($attribute, $value)
+ {
+ if (array_key_exists($attribute, $this->data) || array_key_exists($attribute, $this->files)) {
+ return $this->validateRequired($attribute, $value);
+ }
+
+ return true;
+ }
+
+ /**
+ * Determine if any of the given attributes fail the required test.
+ *
+ * @param array $attributes
+ * @return bool
+ */
+ protected function anyFailingRequired(array $attributes)
+ {
+ foreach ($attributes as $key) {
+ if (! $this->validateRequired($key, $this->getValue($key))) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Determine if all of the given attributes fail the required test.
+ *
+ * @param array $attributes
+ * @return bool
+ */
+ protected function allFailingRequired(array $attributes)
+ {
+ foreach ($attributes as $key) {
+ if ($this->validateRequired($key, $this->getValue($key))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Validate that an attribute exists when any other attribute exists.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param mixed $parameters
+ * @return bool
+ */
+ protected function validateRequiredWith($attribute, $value, $parameters)
+ {
+ if (! $this->allFailingRequired($parameters)) {
+ return $this->validateRequired($attribute, $value);
+ }
+
+ return true;
+ }
+
+ /**
+ * Validate that an attribute exists when all other attributes exists.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param mixed $parameters
+ * @return bool
+ */
+ protected function validateRequiredWithAll($attribute, $value, $parameters)
+ {
+ if (! $this->anyFailingRequired($parameters)) {
+ return $this->validateRequired($attribute, $value);
+ }
+
+ return true;
+ }
+
+ /**
+ * Validate that an attribute exists when another attribute does not.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param mixed $parameters
+ * @return bool
+ */
+ protected function validateRequiredWithout($attribute, $value, $parameters)
+ {
+ if ($this->anyFailingRequired($parameters)) {
+ return $this->validateRequired($attribute, $value);
+ }
+
+ return true;
+ }
+
+ /**
+ * Validate that an attribute exists when all other attributes do not.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param mixed $parameters
+ * @return bool
+ */
+ protected function validateRequiredWithoutAll($attribute, $value, $parameters)
+ {
+ if ($this->allFailingRequired($parameters)) {
+ return $this->validateRequired($attribute, $value);
+ }
+
+ return true;
+ }
+
+ /**
+ * Validate that an attribute exists when another attribute has a given value.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param mixed $parameters
+ * @return bool
+ */
+ protected function validateRequiredIf($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(2, $parameters, 'required_if');
+
+ $data = Arr::get($this->data, $parameters[0]);
+
+ $values = array_slice($parameters, 1);
+
+ if (in_array($data, $values)) {
+ return $this->validateRequired($attribute, $value);
+ }
+
+ return true;
+ }
+
+ /**
+ * Validate that an attribute exists when another attribute does not have a given value.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param mixed $parameters
+ * @return bool
+ */
+ protected function validateRequiredUnless($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(2, $parameters, 'required_unless');
+
+ $data = Arr::get($this->data, $parameters[0]);
+
+ $values = array_slice($parameters, 1);
+
+ if (! in_array($data, $values)) {
+ return $this->validateRequired($attribute, $value);
+ }
+
+ return true;
+ }
+
+ /**
+ * Get the number of attributes in a list that are present.
+ *
+ * @param array $attributes
+ * @return int
+ */
+ protected function getPresentCount($attributes)
+ {
+ $count = 0;
+
+ foreach ($attributes as $key) {
+ if (Arr::get($this->data, $key) || Arr::get($this->files, $key)) {
+ $count++;
+ }
+ }
+
+ return $count;
+ }
+
+ /**
+ * Validate that an attribute has a matching confirmation.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateConfirmed($attribute, $value)
+ {
+ return $this->validateSame($attribute, $value, [$attribute.'_confirmation']);
+ }
+
+ /**
+ * Validate that two attributes match.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateSame($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'same');
+
+ $other = Arr::get($this->data, $parameters[0]);
+
+ return isset($other) && $value === $other;
+ }
+
+ /**
+ * Validate that an attribute is different from another attribute.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateDifferent($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'different');
+
+ $other = Arr::get($this->data, $parameters[0]);
+
+ return isset($other) && $value !== $other;
+ }
+
+ /**
+ * Validate that an attribute was "accepted".
+ *
+ * This validation rule implies the attribute is "required".
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateAccepted($attribute, $value)
+ {
+ $acceptable = ['yes', 'on', '1', 1, true, 'true'];
+
+ return $this->validateRequired($attribute, $value) && in_array($value, $acceptable, true);
+ }
+
+ /**
+ * Validate that an attribute is an array.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateArray($attribute, $value)
+ {
+ return is_array($value);
+ }
+
+ /**
+ * Validate that an attribute is a boolean.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateBoolean($attribute, $value)
+ {
+ $acceptable = [true, false, 0, 1, '0', '1'];
+
+ return in_array($value, $acceptable, true);
+ }
+
+ /**
+ * Validate that an attribute is an integer.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateInteger($attribute, $value)
+ {
+ return filter_var($value, FILTER_VALIDATE_INT) !== false;
+ }
+
+ /**
+ * Validate that an attribute is numeric.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateNumeric($attribute, $value)
+ {
+ return is_numeric($value);
+ }
+
+ /**
+ * Validate that an attribute is a string.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateString($attribute, $value)
+ {
+ return is_string($value);
+ }
+
+ /**
+ * Validate the attribute is a valid JSON string.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateJson($attribute, $value)
+ {
+ json_decode($value);
+
+ return json_last_error() === JSON_ERROR_NONE;
+ }
+
+ /**
+ * Validate that an attribute has a given number of digits.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateDigits($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'digits');
+
+ return $this->validateNumeric($attribute, $value)
+ && strlen((string) $value) == $parameters[0];
+ }
+
+ /**
+ * Validate that an attribute is between a given number of digits.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateDigitsBetween($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(2, $parameters, 'digits_between');
+
+ $length = strlen((string) $value);
+
+ return $this->validateNumeric($attribute, $value)
+ && $length >= $parameters[0] && $length <= $parameters[1];
+ }
+
+ /**
+ * Validate the size of an attribute.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateSize($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'size');
+
+ return $this->getSize($attribute, $value) == $parameters[0];
+ }
+
+ /**
+ * Validate the size of an attribute is between a set of values.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateBetween($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(2, $parameters, 'between');
+
+ $size = $this->getSize($attribute, $value);
+
+ return $size >= $parameters[0] && $size <= $parameters[1];
+ }
+
+ /**
+ * Validate the size of an attribute is greater than a minimum value.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateMin($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'min');
+
+ return $this->getSize($attribute, $value) >= $parameters[0];
+ }
+
+ /**
+ * Validate the size of an attribute is less than a maximum value.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateMax($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'max');
+
+ if ($value instanceof UploadedFile && ! $value->isValid()) {
+ return false;
+ }
+
+ return $this->getSize($attribute, $value) <= $parameters[0];
+ }
+
+ /**
+ * Get the size of an attribute.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return mixed
+ */
+ protected function getSize($attribute, $value)
+ {
+ $hasNumeric = $this->hasRule($attribute, $this->numericRules);
+
+ // This method will determine if the attribute is a number, string, or file and
+ // return the proper size accordingly. If it is a number, then number itself
+ // is the size. If it is a file, we take kilobytes, and for a string the
+ // entire length of the string will be considered the attribute size.
+ if (is_numeric($value) && $hasNumeric) {
+ return $value;
+ } elseif (is_array($value)) {
+ return count($value);
+ } elseif ($value instanceof File) {
+ return $value->getSize() / 1024;
+ }
+
+ return mb_strlen($value);
+ }
+
+ /**
+ * Validate an attribute is contained within a list of values.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateIn($attribute, $value, $parameters)
+ {
+ if (is_array($value) && $this->hasRule($attribute, 'Array')) {
+ return count(array_diff($value, $parameters)) == 0;
+ }
+
+ return ! is_array($value) && in_array((string) $value, $parameters);
+ }
+
+ /**
+ * Validate an attribute is not contained within a list of values.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateNotIn($attribute, $value, $parameters)
+ {
+ return ! $this->validateIn($attribute, $value, $parameters);
+ }
+
+ /**
+ * Validate the uniqueness of an attribute value on a given database table.
+ *
+ * If a database column is not specified, the attribute will be used.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateUnique($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'unique');
+
+ list($connection, $table) = $this->parseTable($parameters[0]);
+
+ // The second parameter position holds the name of the column that needs to
+ // be verified as unique. If this parameter isn't specified we will just
+ // assume that this column to be verified shares the attribute's name.
+ $column = isset($parameters[1]) ? $parameters[1] : $attribute;
+
+ list($idColumn, $id) = [null, null];
+
+ if (isset($parameters[2])) {
+ list($idColumn, $id) = $this->getUniqueIds($parameters);
+
+ if (strtolower($id) == 'null') {
+ $id = null;
+ }
+ }
+
+ // The presence verifier is responsible for counting rows within this store
+ // mechanism which might be a relational database or any other permanent
+ // data store like Redis, etc. We will use it to determine uniqueness.
+ $verifier = $this->getPresenceVerifier();
+
+ if (! is_null($connection)) {
+ $verifier->setConnection($connection);
+ }
+
+ $extra = $this->getUniqueExtra($parameters);
+
+ return $verifier->getCount(
+ $table, $column, $value, $id, $idColumn, $extra
+
+ ) == 0;
+ }
+
+ /**
+ * Parse the connection / table for the unique / exists rules.
+ *
+ * @param string $table
+ * @return array
+ */
+ protected function parseTable($table)
+ {
+ return Str::contains($table, '.') ? explode('.', $table, 2) : [null, $table];
+ }
+
+ /**
+ * Get the excluded ID column and value for the unique rule.
+ *
+ * @param array $parameters
+ * @return array
+ */
+ protected function getUniqueIds($parameters)
+ {
+ $idColumn = isset($parameters[3]) ? $parameters[3] : 'id';
+
+ return [$idColumn, $parameters[2]];
+ }
+
+ /**
+ * Get the extra conditions for a unique rule.
+ *
+ * @param array $parameters
+ * @return array
+ */
+ protected function getUniqueExtra($parameters)
+ {
+ if (isset($parameters[4])) {
+ return $this->getExtraConditions(array_slice($parameters, 4));
+ }
+
+ return [];
+ }
+
+ /**
+ * Validate the existence of an attribute value in a database table.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateExists($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'exists');
+
+ list($connection, $table) = $this->parseTable($parameters[0]);
+
+ // The second parameter position holds the name of the column that should be
+ // verified as existing. If this parameter is not specified we will guess
+ // that the columns being "verified" shares the given attribute's name.
+ $column = isset($parameters[1]) ? $parameters[1] : $attribute;
+
+ $expected = (is_array($value)) ? count($value) : 1;
+
+ return $this->getExistCount($connection, $table, $column, $value, $parameters) >= $expected;
+ }
+
+ /**
+ * Get the number of records that exist in storage.
+ *
+ * @param mixed $connection
+ * @param string $table
+ * @param string $column
+ * @param mixed $value
+ * @param array $parameters
+ * @return int
+ */
+ protected function getExistCount($connection, $table, $column, $value, $parameters)
+ {
+ $verifier = $this->getPresenceVerifier();
+
+ if (! is_null($connection)) {
+ $verifier->setConnection($connection);
+ }
+
+ $extra = $this->getExtraExistConditions($parameters);
+
+ if (is_array($value)) {
+ return $verifier->getMultiCount($table, $column, $value, $extra);
+ }
+
+ return $verifier->getCount($table, $column, $value, null, null, $extra);
+ }
+
+ /**
+ * Get the extra exist conditions.
+ *
+ * @param array $parameters
+ * @return array
+ */
+ protected function getExtraExistConditions(array $parameters)
+ {
+ return $this->getExtraConditions(array_values(array_slice($parameters, 2)));
+ }
+
+ /**
+ * Get the extra conditions for a unique / exists rule.
+ *
+ * @param array $segments
+ * @return array
+ */
+ protected function getExtraConditions(array $segments)
+ {
+ $extra = [];
+
+ $count = count($segments);
+
+ for ($i = 0; $i < $count; $i = $i + 2) {
+ $extra[$segments[$i]] = $segments[$i + 1];
+ }
+
+ return $extra;
+ }
+
+ /**
+ * Validate that an attribute is a valid IP.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateIp($attribute, $value)
+ {
+ return filter_var($value, FILTER_VALIDATE_IP) !== false;
+ }
+
+ /**
+ * Validate that an attribute is a valid e-mail address.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateEmail($attribute, $value)
+ {
+ return filter_var($value, FILTER_VALIDATE_EMAIL) !== false;
+ }
+
+ /**
+ * Validate that an attribute is a valid URL.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateUrl($attribute, $value)
+ {
+ return filter_var($value, FILTER_VALIDATE_URL) !== false;
+ }
+
+ /**
+ * Validate that an attribute is an active URL.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateActiveUrl($attribute, $value)
+ {
+ if (! is_string($value)) {
+ return false;
+ }
+
+ if ($url = parse_url($value, PHP_URL_HOST)) {
+ return count(dns_get_record($url, DNS_A | DNS_AAAA)) > 0;
+ }
+
+ return false;
+ }
+
+ /**
+ * Validate the MIME type of a file is an image MIME type.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateImage($attribute, $value)
+ {
+ return $this->validateMimes($attribute, $value, ['jpeg', 'png', 'gif', 'bmp', 'svg']);
+ }
+
+ /**
+ * Validate the guessed extension of a file upload is in a set of file extensions.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateMimes($attribute, $value, $parameters)
+ {
+ if (! $this->isAValidFileInstance($value)) {
+ return false;
+ }
+
+ return $value->getPath() != '' && in_array($value->guessExtension(), $parameters);
+ }
+
+ /**
+ * Validate the MIME type of a file upload attribute is in a set of MIME types.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateMimetypes($attribute, $value, $parameters)
+ {
+ if (! $this->isAValidFileInstance($value)) {
+ return false;
+ }
+
+ return $value->getPath() != '' && in_array($value->getMimeType(), $parameters);
+ }
+
+ /**
+ * Check that the given value is a valid file instance.
+ *
+ * @param mixed $value
+ * @return bool
+ */
+ protected function isAValidFileInstance($value)
+ {
+ if ($value instanceof UploadedFile && ! $value->isValid()) {
+ return false;
+ }
+
+ return $value instanceof File;
+ }
+
+ /**
+ * Validate that an attribute contains only alphabetic characters.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateAlpha($attribute, $value)
+ {
+ return is_string($value) && preg_match('/^[\pL\pM]+$/u', $value);
+ }
+
+ /**
+ * Validate that an attribute contains only alpha-numeric characters.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateAlphaNum($attribute, $value)
+ {
+ if (! is_string($value) && ! is_numeric($value)) {
+ return false;
+ }
+
+ return preg_match('/^[\pL\pM\pN]+$/u', $value);
+ }
+
+ /**
+ * Validate that an attribute contains only alpha-numeric characters, dashes, and underscores.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateAlphaDash($attribute, $value)
+ {
+ if (! is_string($value) && ! is_numeric($value)) {
+ return false;
+ }
+
+ return preg_match('/^[\pL\pM\pN_-]+$/u', $value);
+ }
+
+ /**
+ * Validate that an attribute passes a regular expression check.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateRegex($attribute, $value, $parameters)
+ {
+ if (! is_string($value) && ! is_numeric($value)) {
+ return false;
+ }
+
+ $this->requireParameterCount(1, $parameters, 'regex');
+
+ return preg_match($parameters[0], $value);
+ }
+
+ /**
+ * Validate that an attribute is a valid date.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateDate($attribute, $value)
+ {
+ if ($value instanceof DateTime) {
+ return true;
+ }
+
+ if ((! is_string($value) && ! is_numeric($value)) || strtotime($value) === false) {
+ return false;
+ }
+
+ $date = date_parse($value);
+
+ return checkdate($date['month'], $date['day'], $date['year']);
+ }
+
+ /**
+ * Validate that an attribute matches a date format.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateDateFormat($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'date_format');
+
+ if (! is_string($value) && ! is_numeric($value)) {
+ return false;
+ }
+
+ $parsed = date_parse_from_format($parameters[0], $value);
+
+ return $parsed['error_count'] === 0 && $parsed['warning_count'] === 0;
+ }
+
+ /**
+ * Validate the date is before a given date.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateBefore($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'before');
+
+ if (! is_string($value) && ! is_numeric($value) && ! $value instanceof Carbon) {
+ return false;
+ }
+
+ if ($format = $this->getDateFormat($attribute)) {
+ return $this->validateBeforeWithFormat($format, $value, $parameters);
+ }
+
+ if (! ($date = strtotime($parameters[0]))) {
+ return strtotime($value) < strtotime($this->getValue($parameters[0]));
+ }
+
+ return strtotime($value) < $date;
+ }
+
+ /**
+ * Validate the date is before a given date with a given format.
+ *
+ * @param string $format
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateBeforeWithFormat($format, $value, $parameters)
+ {
+ $param = $this->getValue($parameters[0]) ?: $parameters[0];
+
+ return $this->checkDateTimeOrder($format, $value, $param);
+ }
+
+ /**
+ * Validate the date is after a given date.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateAfter($attribute, $value, $parameters)
+ {
+ $this->requireParameterCount(1, $parameters, 'after');
+
+ if (! is_string($value) && ! is_numeric($value) && ! $value instanceof Carbon) {
+ return false;
+ }
+
+ if ($format = $this->getDateFormat($attribute)) {
+ return $this->validateAfterWithFormat($format, $value, $parameters);
+ }
+
+ if (! ($date = strtotime($parameters[0]))) {
+ return strtotime($value) > strtotime($this->getValue($parameters[0]));
+ }
+
+ return strtotime($value) > $date;
+ }
+
+ /**
+ * Validate the date is after a given date with a given format.
+ *
+ * @param string $format
+ * @param mixed $value
+ * @param array $parameters
+ * @return bool
+ */
+ protected function validateAfterWithFormat($format, $value, $parameters)
+ {
+ $param = $this->getValue($parameters[0]) ?: $parameters[0];
+
+ return $this->checkDateTimeOrder($format, $param, $value);
+ }
+
+ /**
+ * Given two date/time strings, check that one is after the other.
+ *
+ * @param string $format
+ * @param string $before
+ * @param string $after
+ * @return bool
+ */
+ protected function checkDateTimeOrder($format, $before, $after)
+ {
+ $before = $this->getDateTimeWithOptionalFormat($format, $before);
+
+ $after = $this->getDateTimeWithOptionalFormat($format, $after);
+
+ return ($before && $after) && ($after > $before);
+ }
+
+ /**
+ * Get a DateTime instance from a string.
+ *
+ * @param string $format
+ * @param string $value
+ * @return \DateTime|null
+ */
+ protected function getDateTimeWithOptionalFormat($format, $value)
+ {
+ $date = DateTime::createFromFormat($format, $value);
+
+ if ($date) {
+ return $date;
+ }
+
+ try {
+ return new DateTime($value);
+ } catch (Exception $e) {
+ //
+ }
+ }
+
+ /**
+ * Validate that an attribute is a valid timezone.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return bool
+ */
+ protected function validateTimezone($attribute, $value)
+ {
+ try {
+ new DateTimeZone($value);
+ } catch (Exception $e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Get the date format for an attribute if it has one.
+ *
+ * @param string $attribute
+ * @return string|null
+ */
+ protected function getDateFormat($attribute)
+ {
+ if ($result = $this->getRule($attribute, 'DateFormat')) {
+ return $result[1][0];
+ }
+ }
+
+ /**
+ * Get the validation message for an attribute and rule.
+ *
+ * @param string $attribute
+ * @param string $rule
+ * @return string
+ */
+ protected function getMessage($attribute, $rule)
+ {
+ $lowerRule = Str::snake($rule);
+
+ $inlineMessage = $this->getInlineMessage($attribute, $lowerRule);
+
+ // First we will retrieve the custom message for the validation rule if one
+ // exists. If a custom validation message is being used we'll return the
+ // custom message, otherwise we'll keep searching for a valid message.
+ if (! is_null($inlineMessage)) {
+ return $inlineMessage;
+ }
+
+ $customKey = "validation.custom.{$attribute}.{$lowerRule}";
+
+ $customMessage = $this->translator->trans($customKey);
+
+ // First we check for a custom defined validation message for the attribute
+ // and rule. This allows the developer to specify specific messages for
+ // only some attributes and rules that need to get specially formed.
+ if ($customMessage !== $customKey) {
+ return $customMessage;
+ }
+
+ // If the rule being validated is a "size" rule, we will need to gather the
+ // specific error message for the type of attribute being validated such
+ // as a number, file or string which all have different message types.
+ elseif (in_array($rule, $this->sizeRules)) {
+ return $this->getSizeMessage($attribute, $rule);
+ }
+
+ // Finally, if no developer specified messages have been set, and no other
+ // special messages apply for this rule, we will just pull the default
+ // messages out of the translator service for this validation rule.
+ $key = "validation.{$lowerRule}";
+
+ if ($key != ($value = $this->translator->trans($key))) {
+ return $value;
+ }
+
+ return $this->getInlineMessage(
+ $attribute, $lowerRule, $this->fallbackMessages
+ ) ?: $key;
+ }
+
+ /**
+ * Get the inline message for a rule if it exists.
+ *
+ * @param string $attribute
+ * @param string $lowerRule
+ * @param array $source
+ * @return string|null
+ */
+ protected function getInlineMessage($attribute, $lowerRule, $source = null)
+ {
+ $source = $source ?: $this->customMessages;
+
+ $keys = ["{$attribute}.{$lowerRule}", $lowerRule];
+
+ // First we will check for a custom message for an attribute specific rule
+ // message for the fields, then we will check for a general custom line
+ // that is not attribute specific. If we find either we'll return it.
+ foreach ($keys as $key) {
+ if (isset($source[$key])) {
+ return $source[$key];
+ }
+ }
+ }
+
+ /**
+ * Get the proper error message for an attribute and size rule.
+ *
+ * @param string $attribute
+ * @param string $rule
+ * @return string
+ */
+ protected function getSizeMessage($attribute, $rule)
+ {
+ $lowerRule = Str::snake($rule);
+
+ // There are three different types of size validations. The attribute may be
+ // either a number, file, or string so we will check a few things to know
+ // which type of value it is and return the correct line for that type.
+ $type = $this->getAttributeType($attribute);
+
+ $key = "validation.{$lowerRule}.{$type}";
+
+ return $this->translator->trans($key);
+ }
+
+ /**
+ * Get the data type of the given attribute.
+ *
+ * @param string $attribute
+ * @return string
+ */
+ protected function getAttributeType($attribute)
+ {
+ // We assume that the attributes present in the file array are files so that
+ // means that if the attribute does not have a numeric rule and the files
+ // list doesn't have it we'll just consider it a string by elimination.
+ if ($this->hasRule($attribute, $this->numericRules)) {
+ return 'numeric';
+ } elseif ($this->hasRule($attribute, ['Array'])) {
+ return 'array';
+ } elseif (array_key_exists($attribute, $this->files)) {
+ return 'file';
+ }
+
+ return 'string';
+ }
+
+ /**
+ * Replace all error message place-holders with actual values.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function doReplacements($message, $attribute, $rule, $parameters)
+ {
+ $message = str_replace(':attribute', $this->getAttribute($attribute), $message);
+
+ if (isset($this->replacers[Str::snake($rule)])) {
+ $message = $this->callReplacer($message, $attribute, Str::snake($rule), $parameters);
+ } elseif (method_exists($this, $replacer = "replace{$rule}")) {
+ $message = $this->$replacer($message, $attribute, $rule, $parameters);
+ }
+
+ return $message;
+ }
+
+ /**
+ * Transform an array of attributes to their displayable form.
+ *
+ * @param array $values
+ * @return array
+ */
+ protected function getAttributeList(array $values)
+ {
+ $attributes = [];
+
+ // For each attribute in the list we will simply get its displayable form as
+ // this is convenient when replacing lists of parameters like some of the
+ // replacement functions do when formatting out the validation message.
+ foreach ($values as $key => $value) {
+ $attributes[$key] = $this->getAttribute($value);
+ }
+
+ return $attributes;
+ }
+
+ /**
+ * Get the displayable name of the attribute.
+ *
+ * @param string $attribute
+ * @return string
+ */
+ protected function getAttribute($attribute)
+ {
+ // The developer may dynamically specify the array of custom attributes
+ // on this Validator instance. If the attribute exists in this array
+ // it takes precedence over all other ways we can pull attributes.
+ if (isset($this->customAttributes[$attribute])) {
+ return $this->customAttributes[$attribute];
+ }
+
+ $key = "validation.attributes.{$attribute}";
+
+ // We allow for the developer to specify language lines for each of the
+ // attributes allowing for more displayable counterparts of each of
+ // the attributes. This provides the ability for simple formats.
+ if (($line = $this->translator->trans($key)) !== $key) {
+ return $line;
+ }
+
+ // If no language line has been specified for the attribute all of the
+ // underscores are removed from the attribute name and that will be
+ // used as default versions of the attribute's displayable names.
+ return str_replace('_', ' ', Str::snake($attribute));
+ }
+
+ /**
+ * Get the displayable name of the value.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @return string
+ */
+ public function getDisplayableValue($attribute, $value)
+ {
+ if (isset($this->customValues[$attribute][$value])) {
+ return $this->customValues[$attribute][$value];
+ }
+
+ $key = "validation.values.{$attribute}.{$value}";
+
+ if (($line = $this->translator->trans($key)) !== $key) {
+ return $line;
+ }
+
+ return $value;
+ }
+
+ /**
+ * Replace all place-holders for the between rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceBetween($message, $attribute, $rule, $parameters)
+ {
+ return str_replace([':min', ':max'], $parameters, $message);
+ }
+
+ /**
+ * Replace all place-holders for the digits rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceDigits($message, $attribute, $rule, $parameters)
+ {
+ return str_replace(':digits', $parameters[0], $message);
+ }
+
+ /**
+ * Replace all place-holders for the digits (between) rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceDigitsBetween($message, $attribute, $rule, $parameters)
+ {
+ return $this->replaceBetween($message, $attribute, $rule, $parameters);
+ }
+
+ /**
+ * Replace all place-holders for the size rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceSize($message, $attribute, $rule, $parameters)
+ {
+ return str_replace(':size', $parameters[0], $message);
+ }
+
+ /**
+ * Replace all place-holders for the min rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceMin($message, $attribute, $rule, $parameters)
+ {
+ return str_replace(':min', $parameters[0], $message);
+ }
+
+ /**
+ * Replace all place-holders for the max rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceMax($message, $attribute, $rule, $parameters)
+ {
+ return str_replace(':max', $parameters[0], $message);
+ }
+
+ /**
+ * Replace all place-holders for the in rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceIn($message, $attribute, $rule, $parameters)
+ {
+ foreach ($parameters as &$parameter) {
+ $parameter = $this->getDisplayableValue($attribute, $parameter);
+ }
+
+ return str_replace(':values', implode(', ', $parameters), $message);
+ }
+
+ /**
+ * Replace all place-holders for the not_in rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceNotIn($message, $attribute, $rule, $parameters)
+ {
+ return $this->replaceIn($message, $attribute, $rule, $parameters);
+ }
+
+ /**
+ * Replace all place-holders for the mimes rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceMimes($message, $attribute, $rule, $parameters)
+ {
+ return str_replace(':values', implode(', ', $parameters), $message);
+ }
+
+ /**
+ * Replace all place-holders for the required_with rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceRequiredWith($message, $attribute, $rule, $parameters)
+ {
+ $parameters = $this->getAttributeList($parameters);
+
+ return str_replace(':values', implode(' / ', $parameters), $message);
+ }
+
+ /**
+ * Replace all place-holders for the required_with_all rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceRequiredWithAll($message, $attribute, $rule, $parameters)
+ {
+ return $this->replaceRequiredWith($message, $attribute, $rule, $parameters);
+ }
+
+ /**
+ * Replace all place-holders for the required_without rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceRequiredWithout($message, $attribute, $rule, $parameters)
+ {
+ return $this->replaceRequiredWith($message, $attribute, $rule, $parameters);
+ }
+
+ /**
+ * Replace all place-holders for the required_without_all rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceRequiredWithoutAll($message, $attribute, $rule, $parameters)
+ {
+ return $this->replaceRequiredWith($message, $attribute, $rule, $parameters);
+ }
+
+ /**
+ * Replace all place-holders for the required_if rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceRequiredIf($message, $attribute, $rule, $parameters)
+ {
+ $parameters[1] = $this->getDisplayableValue($parameters[0], Arr::get($this->data, $parameters[0]));
+
+ $parameters[0] = $this->getAttribute($parameters[0]);
+
+ return str_replace([':other', ':value'], $parameters, $message);
+ }
+
+ /**
+ * Replace all place-holders for the required_unless rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceRequiredUnless($message, $attribute, $rule, $parameters)
+ {
+ $other = $this->getAttribute(array_shift($parameters));
+
+ return str_replace([':other', ':values'], [$other, implode(', ', $parameters)], $message);
+ }
+
+ /**
+ * Replace all place-holders for the same rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceSame($message, $attribute, $rule, $parameters)
+ {
+ return str_replace(':other', $this->getAttribute($parameters[0]), $message);
+ }
+
+ /**
+ * Replace all place-holders for the different rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceDifferent($message, $attribute, $rule, $parameters)
+ {
+ return $this->replaceSame($message, $attribute, $rule, $parameters);
+ }
+
+ /**
+ * Replace all place-holders for the date_format rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceDateFormat($message, $attribute, $rule, $parameters)
+ {
+ return str_replace(':format', $parameters[0], $message);
+ }
+
+ /**
+ * Replace all place-holders for the before rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceBefore($message, $attribute, $rule, $parameters)
+ {
+ if (! (strtotime($parameters[0]))) {
+ return str_replace(':date', $this->getAttribute($parameters[0]), $message);
+ }
+
+ return str_replace(':date', $parameters[0], $message);
+ }
+
+ /**
+ * Replace all place-holders for the after rule.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function replaceAfter($message, $attribute, $rule, $parameters)
+ {
+ return $this->replaceBefore($message, $attribute, $rule, $parameters);
+ }
+
+ /**
+ * Determine if the given attribute has a rule in the given set.
+ *
+ * @param string $attribute
+ * @param string|array $rules
+ * @return bool
+ */
+ protected function hasRule($attribute, $rules)
+ {
+ return ! is_null($this->getRule($attribute, $rules));
+ }
+
+ /**
+ * Get a rule and its parameters for a given attribute.
+ *
+ * @param string $attribute
+ * @param string|array $rules
+ * @return array|null
+ */
+ protected function getRule($attribute, $rules)
+ {
+ if (! array_key_exists($attribute, $this->rules)) {
+ return;
+ }
+
+ $rules = (array) $rules;
+
+ foreach ($this->rules[$attribute] as $rule) {
+ list($rule, $parameters) = $this->parseRule($rule);
+
+ if (in_array($rule, $rules)) {
+ return [$rule, $parameters];
+ }
+ }
+ }
+
+ /**
+ * Extract the rule name and parameters from a rule.
+ *
+ * @param array|string $rules
+ * @return array
+ */
+ protected function parseRule($rules)
+ {
+ if (is_array($rules)) {
+ $rules = $this->parseArrayRule($rules);
+ } else {
+ $rules = $this->parseStringRule($rules);
+ }
+
+ $rules[0] = $this->normalizeRule($rules[0]);
+
+ return $rules;
+ }
+
+ /**
+ * Parse an array based rule.
+ *
+ * @param array $rules
+ * @return array
+ */
+ protected function parseArrayRule(array $rules)
+ {
+ return [Str::studly(trim(Arr::get($rules, 0))), array_slice($rules, 1)];
+ }
+
+ /**
+ * Parse a string based rule.
+ *
+ * @param string $rules
+ * @return array
+ */
+ protected function parseStringRule($rules)
+ {
+ $parameters = [];
+
+ // The format for specifying validation rules and parameters follows an
+ // easy {rule}:{parameters} formatting convention. For instance the
+ // rule "Max:3" states that the value may only be three letters.
+ if (strpos($rules, ':') !== false) {
+ list($rules, $parameter) = explode(':', $rules, 2);
+
+ $parameters = $this->parseParameters($rules, $parameter);
+ }
+
+ return [Str::studly(trim($rules)), $parameters];
+ }
+
+ /**
+ * Parse a parameter list.
+ *
+ * @param string $rule
+ * @param string $parameter
+ * @return array
+ */
+ protected function parseParameters($rule, $parameter)
+ {
+ if (strtolower($rule) == 'regex') {
+ return [$parameter];
+ }
+
+ return str_getcsv($parameter);
+ }
+
+ /**
+ * Normalizes a rule so that we can accept short types.
+ *
+ * @param string $rule
+ * @return string
+ */
+ protected function normalizeRule($rule)
+ {
+ switch ($rule) {
+ case 'Int':
+ return 'Integer';
+ case 'Bool':
+ return 'Boolean';
+ default:
+ return $rule;
+ }
+ }
+
+ /**
+ * Get the array of custom validator extensions.
+ *
+ * @return array
+ */
+ public function getExtensions()
+ {
+ return $this->extensions;
+ }
+
+ /**
+ * Register an array of custom validator extensions.
+ *
+ * @param array $extensions
+ * @return void
+ */
+ public function addExtensions(array $extensions)
+ {
+ if ($extensions) {
+ $keys = array_map('\Illuminate\Support\Str::snake', array_keys($extensions));
+
+ $extensions = array_combine($keys, array_values($extensions));
+ }
+
+ $this->extensions = array_merge($this->extensions, $extensions);
+ }
+
+ /**
+ * Register an array of custom implicit validator extensions.
+ *
+ * @param array $extensions
+ * @return void
+ */
+ public function addImplicitExtensions(array $extensions)
+ {
+ $this->addExtensions($extensions);
+
+ foreach ($extensions as $rule => $extension) {
+ $this->implicitRules[] = Str::studly($rule);
+ }
+ }
+
+ /**
+ * Register a custom validator extension.
+ *
+ * @param string $rule
+ * @param \Closure|string $extension
+ * @return void
+ */
+ public function addExtension($rule, $extension)
+ {
+ $this->extensions[Str::snake($rule)] = $extension;
+ }
+
+ /**
+ * Register a custom implicit validator extension.
+ *
+ * @param string $rule
+ * @param \Closure|string $extension
+ * @return void
+ */
+ public function addImplicitExtension($rule, $extension)
+ {
+ $this->addExtension($rule, $extension);
+
+ $this->implicitRules[] = Str::studly($rule);
+ }
+
+ /**
+ * Get the array of custom validator message replacers.
+ *
+ * @return array
+ */
+ public function getReplacers()
+ {
+ return $this->replacers;
+ }
+
+ /**
+ * Register an array of custom validator message replacers.
+ *
+ * @param array $replacers
+ * @return void
+ */
+ public function addReplacers(array $replacers)
+ {
+ if ($replacers) {
+ $keys = array_map('\Illuminate\Support\Str::snake', array_keys($replacers));
+
+ $replacers = array_combine($keys, array_values($replacers));
+ }
+
+ $this->replacers = array_merge($this->replacers, $replacers);
+ }
+
+ /**
+ * Register a custom validator message replacer.
+ *
+ * @param string $rule
+ * @param \Closure|string $replacer
+ * @return void
+ */
+ public function addReplacer($rule, $replacer)
+ {
+ $this->replacers[Str::snake($rule)] = $replacer;
+ }
+
+ /**
+ * Get the data under validation.
+ *
+ * @return array
+ */
+ public function getData()
+ {
+ return $this->data;
+ }
+
+ /**
+ * Set the data under validation.
+ *
+ * @param array $data
+ * @return void
+ */
+ public function setData(array $data)
+ {
+ $this->data = $this->parseData($data);
+ }
+
+ /**
+ * Get the validation rules.
+ *
+ * @return array
+ */
+ public function getRules()
+ {
+ return $this->rules;
+ }
+
+ /**
+ * Set the validation rules.
+ *
+ * @param array $rules
+ * @return $this
+ */
+ public function setRules(array $rules)
+ {
+ $this->rules = $this->explodeRules($rules);
+
+ return $this;
+ }
+
+ /**
+ * Set the custom attributes on the validator.
+ *
+ * @param array $attributes
+ * @return $this
+ */
+ public function setAttributeNames(array $attributes)
+ {
+ $this->customAttributes = $attributes;
+
+ return $this;
+ }
+
+ /**
+ * Set the custom values on the validator.
+ *
+ * @param array $values
+ * @return $this
+ */
+ public function setValueNames(array $values)
+ {
+ $this->customValues = $values;
+
+ return $this;
+ }
+
+ /**
+ * Get the files under validation.
+ *
+ * @return array
+ */
+ public function getFiles()
+ {
+ return $this->files;
+ }
+
+ /**
+ * Set the files under validation.
+ *
+ * @param array $files
+ * @return $this
+ */
+ public function setFiles(array $files)
+ {
+ $this->files = $files;
+
+ return $this;
+ }
+
+ /**
+ * Get the Presence Verifier implementation.
+ *
+ * @return \Illuminate\Validation\PresenceVerifierInterface
+ *
+ * @throws \RuntimeException
+ */
+ public function getPresenceVerifier()
+ {
+ if (! isset($this->presenceVerifier)) {
+ throw new RuntimeException('Presence verifier has not been set.');
+ }
+
+ return $this->presenceVerifier;
+ }
+
+ /**
+ * Set the Presence Verifier implementation.
+ *
+ * @param \Illuminate\Validation\PresenceVerifierInterface $presenceVerifier
+ * @return void
+ */
+ public function setPresenceVerifier(PresenceVerifierInterface $presenceVerifier)
+ {
+ $this->presenceVerifier = $presenceVerifier;
+ }
+
+ /**
+ * Get the Translator implementation.
+ *
+ * @return \Symfony\Component\Translation\TranslatorInterface
+ */
+ public function getTranslator()
+ {
+ return $this->translator;
+ }
+
+ /**
+ * Set the Translator implementation.
+ *
+ * @param \Symfony\Component\Translation\TranslatorInterface $translator
+ * @return void
+ */
+ public function setTranslator(TranslatorInterface $translator)
+ {
+ $this->translator = $translator;
+ }
+
+ /**
+ * Get the custom messages for the validator.
+ *
+ * @return array
+ */
+ public function getCustomMessages()
+ {
+ return $this->customMessages;
+ }
+
+ /**
+ * Set the custom messages for the validator.
+ *
+ * @param array $messages
+ * @return void
+ */
+ public function setCustomMessages(array $messages)
+ {
+ $this->customMessages = array_merge($this->customMessages, $messages);
+ }
+
+ /**
+ * Get the custom attributes used by the validator.
+ *
+ * @return array
+ */
+ public function getCustomAttributes()
+ {
+ return $this->customAttributes;
+ }
+
+ /**
+ * Add custom attributes to the validator.
+ *
+ * @param array $customAttributes
+ * @return $this
+ */
+ public function addCustomAttributes(array $customAttributes)
+ {
+ $this->customAttributes = array_merge($this->customAttributes, $customAttributes);
+
+ return $this;
+ }
+
+ /**
+ * Get the custom values for the validator.
+ *
+ * @return array
+ */
+ public function getCustomValues()
+ {
+ return $this->customValues;
+ }
+
+ /**
+ * Add the custom values for the validator.
+ *
+ * @param array $customValues
+ * @return $this
+ */
+ public function addCustomValues(array $customValues)
+ {
+ $this->customValues = array_merge($this->customValues, $customValues);
+
+ return $this;
+ }
+
+ /**
+ * Get the fallback messages for the validator.
+ *
+ * @return array
+ */
+ public function getFallbackMessages()
+ {
+ return $this->fallbackMessages;
+ }
+
+ /**
+ * Set the fallback messages for the validator.
+ *
+ * @param array $messages
+ * @return void
+ */
+ public function setFallbackMessages(array $messages)
+ {
+ $this->fallbackMessages = $messages;
+ }
+
+ /**
+ * Get the failed validation rules.
+ *
+ * @return array
+ */
+ public function failed()
+ {
+ return $this->failedRules;
+ }
+
+ /**
+ * Get the message container for the validator.
+ *
+ * @return \Illuminate\Support\MessageBag
+ */
+ public function messages()
+ {
+ if (! $this->messages) {
+ $this->passes();
+ }
+
+ return $this->messages;
+ }
+
+ /**
+ * An alternative more semantic shortcut to the message container.
+ *
+ * @return \Illuminate\Support\MessageBag
+ */
+ public function errors()
+ {
+ return $this->messages();
+ }
+
+ /**
+ * Get the messages for the instance.
+ *
+ * @return \Illuminate\Support\MessageBag
+ */
+ public function getMessageBag()
+ {
+ return $this->messages();
+ }
+
+ /**
+ * Set the IoC container instance.
+ *
+ * @param \Illuminate\Contracts\Container\Container $container
+ * @return void
+ */
+ public function setContainer(Container $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * Call a custom validator extension.
+ *
+ * @param string $rule
+ * @param array $parameters
+ * @return bool|null
+ */
+ protected function callExtension($rule, $parameters)
+ {
+ $callback = $this->extensions[$rule];
+
+ if ($callback instanceof Closure) {
+ return call_user_func_array($callback, $parameters);
+ } elseif (is_string($callback)) {
+ return $this->callClassBasedExtension($callback, $parameters);
+ }
+ }
+
+ /**
+ * Call a class based validator extension.
+ *
+ * @param string $callback
+ * @param array $parameters
+ * @return bool
+ */
+ protected function callClassBasedExtension($callback, $parameters)
+ {
+ list($class, $method) = explode('@', $callback);
+
+ return call_user_func_array([$this->container->make($class), $method], $parameters);
+ }
+
+ /**
+ * Call a custom validator message replacer.
+ *
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string|null
+ */
+ protected function callReplacer($message, $attribute, $rule, $parameters)
+ {
+ $callback = $this->replacers[$rule];
+
+ if ($callback instanceof Closure) {
+ return call_user_func_array($callback, func_get_args());
+ } elseif (is_string($callback)) {
+ return $this->callClassBasedReplacer($callback, $message, $attribute, $rule, $parameters);
+ }
+ }
+
+ /**
+ * Call a class based validator message replacer.
+ *
+ * @param string $callback
+ * @param string $message
+ * @param string $attribute
+ * @param string $rule
+ * @param array $parameters
+ * @return string
+ */
+ protected function callClassBasedReplacer($callback, $message, $attribute, $rule, $parameters)
+ {
+ list($class, $method) = explode('@', $callback);
+
+ return call_user_func_array([$this->container->make($class), $method], array_slice(func_get_args(), 1));
+ }
+
+ /**
+ * Require a certain number of parameters to be present.
+ *
+ * @param int $count
+ * @param array $parameters
+ * @param string $rule
+ * @return void
+ * @throws \InvalidArgumentException
+ */
+ protected function requireParameterCount($count, $parameters, $rule)
+ {
+ if (count($parameters) < $count) {
+ throw new InvalidArgumentException("Validation rule $rule requires at least $count parameters.");
+ }
+ }
+
+ /**
+ * Handle dynamic calls to class methods.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return mixed
+ *
+ * @throws \BadMethodCallException
+ */
+ public function __call($method, $parameters)
+ {
+ $rule = Str::snake(substr($method, 8));
+
+ if (isset($this->extensions[$rule])) {
+ return $this->callExtension($rule, $parameters);
+ }
+
+ throw new BadMethodCallException("Method [$method] does not exist.");
+ }
+}
diff --git a/vendor/illuminate/validation/composer.json b/vendor/illuminate/validation/composer.json
new file mode 100644
index 00000000..3733144d
--- /dev/null
+++ b/vendor/illuminate/validation/composer.json
@@ -0,0 +1,38 @@
+{
+ "name": "illuminate/validation",
+ "description": "The Illuminate Validation package.",
+ "license": "MIT",
+ "homepage": "http://laravel.com",
+ "support": {
+ "issues": "https://github.com/laravel/framework/issues",
+ "source": "https://github.com/laravel/framework"
+ },
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylorotwell@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.5.9",
+ "illuminate/container": "5.1.*",
+ "illuminate/contracts": "5.1.*",
+ "illuminate/support": "5.1.*",
+ "symfony/http-foundation": "2.7.*",
+ "symfony/translation": "2.7.*"
+ },
+ "autoload": {
+ "psr-4": {
+ "Illuminate\\Validation\\": ""
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "suggest": {
+ "illuminate/database": "Required to use the database presence verifier (5.1.*)."
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/illuminate/view/Compilers/BladeCompiler.php b/vendor/illuminate/view/Compilers/BladeCompiler.php
new file mode 100644
index 00000000..c257a82b
--- /dev/null
+++ b/vendor/illuminate/view/Compilers/BladeCompiler.php
@@ -0,0 +1,889 @@
+setPath($path);
+ }
+
+ $contents = $this->compileString($this->files->get($this->getPath()));
+
+ if (! is_null($this->cachePath)) {
+ $this->files->put($this->getCompiledPath($this->getPath()), $contents);
+ }
+ }
+
+ /**
+ * Get the path currently being compiled.
+ *
+ * @return string
+ */
+ public function getPath()
+ {
+ return $this->path;
+ }
+
+ /**
+ * Set the path currently being compiled.
+ *
+ * @param string $path
+ * @return void
+ */
+ public function setPath($path)
+ {
+ $this->path = $path;
+ }
+
+ /**
+ * Compile the given Blade template contents.
+ *
+ * @param string $value
+ * @return string
+ */
+ public function compileString($value)
+ {
+ $result = '';
+
+ $this->footer = [];
+
+ // Here we will loop through all of the tokens returned by the Zend lexer and
+ // parse each one into the corresponding valid PHP. We will then have this
+ // template as the correctly rendered PHP that can be rendered natively.
+ foreach (token_get_all($value) as $token) {
+ $result .= is_array($token) ? $this->parseToken($token) : $token;
+ }
+
+ // If there are any footer lines that need to get added to a template we will
+ // add them here at the end of the template. This gets used mainly for the
+ // template inheritance via the extends keyword that should be appended.
+ if (count($this->footer) > 0) {
+ $result = ltrim($result, PHP_EOL)
+ .PHP_EOL.implode(PHP_EOL, array_reverse($this->footer));
+ }
+
+ return $result;
+ }
+
+ /**
+ * Parse the tokens from the template.
+ *
+ * @param array $token
+ * @return string
+ */
+ protected function parseToken($token)
+ {
+ list($id, $content) = $token;
+
+ if ($id == T_INLINE_HTML) {
+ foreach ($this->compilers as $type) {
+ $content = $this->{"compile{$type}"}($content);
+ }
+ }
+
+ return $content;
+ }
+
+ /**
+ * Execute the user defined extensions.
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function compileExtensions($value)
+ {
+ foreach ($this->extensions as $compiler) {
+ $value = call_user_func($compiler, $value, $this);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Compile Blade comments into valid PHP.
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function compileComments($value)
+ {
+ $pattern = sprintf('/%s--(.*?)--%s/s', $this->contentTags[0], $this->contentTags[1]);
+
+ return preg_replace($pattern, '', $value);
+ }
+
+ /**
+ * Compile Blade echos into valid PHP.
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function compileEchos($value)
+ {
+ foreach ($this->getEchoMethods() as $method => $length) {
+ $value = $this->$method($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Get the echo methods in the proper order for compilation.
+ *
+ * @return array
+ */
+ protected function getEchoMethods()
+ {
+ $methods = [
+ 'compileRawEchos' => strlen(stripcslashes($this->rawTags[0])),
+ 'compileEscapedEchos' => strlen(stripcslashes($this->escapedTags[0])),
+ 'compileRegularEchos' => strlen(stripcslashes($this->contentTags[0])),
+ ];
+
+ uksort($methods, function ($method1, $method2) use ($methods) {
+ // Ensure the longest tags are processed first
+ if ($methods[$method1] > $methods[$method2]) {
+ return -1;
+ }
+ if ($methods[$method1] < $methods[$method2]) {
+ return 1;
+ }
+
+ // Otherwise give preference to raw tags (assuming they've overridden)
+ if ($method1 === 'compileRawEchos') {
+ return -1;
+ }
+ if ($method2 === 'compileRawEchos') {
+ return 1;
+ }
+
+ if ($method1 === 'compileEscapedEchos') {
+ return -1;
+ }
+ if ($method2 === 'compileEscapedEchos') {
+ return 1;
+ }
+ });
+
+ return $methods;
+ }
+
+ /**
+ * Compile Blade statements that start with "@".
+ *
+ * @param string $value
+ * @return mixed
+ */
+ protected function compileStatements($value)
+ {
+ $callback = function ($match) {
+ if (method_exists($this, $method = 'compile'.ucfirst($match[1]))) {
+ $match[0] = $this->$method(Arr::get($match, 3));
+ } elseif (isset($this->customDirectives[$match[1]])) {
+ $match[0] = call_user_func($this->customDirectives[$match[1]], Arr::get($match, 3));
+ }
+
+ return isset($match[3]) ? $match[0] : $match[0].$match[2];
+ };
+
+ return preg_replace_callback('/\B@(\w+)([ \t]*)(\( ( (?>[^()]+) | (?3) )* \))?/x', $callback, $value);
+ }
+
+ /**
+ * Compile the "raw" echo statements.
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function compileRawEchos($value)
+ {
+ $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->rawTags[0], $this->rawTags[1]);
+
+ $callback = function ($matches) {
+ $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3];
+
+ return $matches[1] ? substr($matches[0], 1) : 'compileEchoDefaults($matches[2]).'; ?>'.$whitespace;
+ };
+
+ return preg_replace_callback($pattern, $callback, $value);
+ }
+
+ /**
+ * Compile the "regular" echo statements.
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function compileRegularEchos($value)
+ {
+ $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->contentTags[0], $this->contentTags[1]);
+
+ $callback = function ($matches) {
+ $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3];
+
+ $wrapped = sprintf($this->echoFormat, $this->compileEchoDefaults($matches[2]));
+
+ return $matches[1] ? substr($matches[0], 1) : ''.$whitespace;
+ };
+
+ return preg_replace_callback($pattern, $callback, $value);
+ }
+
+ /**
+ * Compile the escaped echo statements.
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function compileEscapedEchos($value)
+ {
+ $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->escapedTags[0], $this->escapedTags[1]);
+
+ $callback = function ($matches) {
+ $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3];
+
+ return $matches[1] ? $matches[0] : 'compileEchoDefaults($matches[2]).'); ?>'.$whitespace;
+ };
+
+ return preg_replace_callback($pattern, $callback, $value);
+ }
+
+ /**
+ * Compile the default values for the echo statement.
+ *
+ * @param string $value
+ * @return string
+ */
+ public function compileEchoDefaults($value)
+ {
+ return preg_replace('/^(?=\$)(.+?)(?:\s+or\s+)(.+?)$/s', 'isset($1) ? $1 : $2', $value);
+ }
+
+ /**
+ * Compile the each statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEach($expression)
+ {
+ return "renderEach{$expression}; ?>";
+ }
+
+ /**
+ * Compile the inject statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileInject($expression)
+ {
+ $segments = explode(',', preg_replace("/[\(\)\\\"\']/", '', $expression));
+
+ return '";
+ }
+
+ /**
+ * Compile the yield statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileYield($expression)
+ {
+ return "yieldContent{$expression}; ?>";
+ }
+
+ /**
+ * Compile the show statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileShow($expression)
+ {
+ return 'yieldSection(); ?>';
+ }
+
+ /**
+ * Compile the section statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileSection($expression)
+ {
+ return "startSection{$expression}; ?>";
+ }
+
+ /**
+ * Compile the append statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileAppend($expression)
+ {
+ return 'appendSection(); ?>';
+ }
+
+ /**
+ * Compile the end-section statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndsection($expression)
+ {
+ return 'stopSection(); ?>';
+ }
+
+ /**
+ * Compile the stop statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileStop($expression)
+ {
+ return 'stopSection(); ?>';
+ }
+
+ /**
+ * Compile the overwrite statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileOverwrite($expression)
+ {
+ return 'stopSection(true); ?>';
+ }
+
+ /**
+ * Compile the unless statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileUnless($expression)
+ {
+ return "";
+ }
+
+ /**
+ * Compile the end unless statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndunless($expression)
+ {
+ return '';
+ }
+
+ /**
+ * Compile the lang statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileLang($expression)
+ {
+ return "get$expression; ?>";
+ }
+
+ /**
+ * Compile the choice statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileChoice($expression)
+ {
+ return "choice$expression; ?>";
+ }
+
+ /**
+ * Compile the else statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileElse($expression)
+ {
+ return '';
+ }
+
+ /**
+ * Compile the for statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileFor($expression)
+ {
+ return "";
+ }
+
+ /**
+ * Compile the foreach statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileForeach($expression)
+ {
+ return "";
+ }
+
+ /**
+ * Compile the forelse statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileForelse($expression)
+ {
+ $empty = '$__empty_'.++$this->forelseCounter;
+
+ return "";
+ }
+
+ /**
+ * Compile the can statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileCan($expression)
+ {
+ return "check{$expression}): ?>";
+ }
+
+ /**
+ * Compile the cannot statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileCannot($expression)
+ {
+ return "denies{$expression}): ?>";
+ }
+
+ /**
+ * Compile the if statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileIf($expression)
+ {
+ return "";
+ }
+
+ /**
+ * Compile the else-if statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileElseif($expression)
+ {
+ return "";
+ }
+
+ /**
+ * Compile the forelse statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEmpty($expression)
+ {
+ $empty = '$__empty_'.$this->forelseCounter--;
+
+ return "";
+ }
+
+ /**
+ * Compile the while statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileWhile($expression)
+ {
+ return "";
+ }
+
+ /**
+ * Compile the end-while statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndwhile($expression)
+ {
+ return '';
+ }
+
+ /**
+ * Compile the end-for statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndfor($expression)
+ {
+ return '';
+ }
+
+ /**
+ * Compile the end-for-each statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndforeach($expression)
+ {
+ return '';
+ }
+
+ /**
+ * Compile the end-can statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndcan($expression)
+ {
+ return '';
+ }
+
+ /**
+ * Compile the end-cannot statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndcannot($expression)
+ {
+ return '';
+ }
+
+ /**
+ * Compile the end-if statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndif($expression)
+ {
+ return '';
+ }
+
+ /**
+ * Compile the end-for-else statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndforelse($expression)
+ {
+ return '';
+ }
+
+ /**
+ * Compile the extends statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileExtends($expression)
+ {
+ if (Str::startsWith($expression, '(')) {
+ $expression = substr($expression, 1, -1);
+ }
+
+ $data = "make($expression, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>";
+
+ $this->footer[] = $data;
+
+ return '';
+ }
+
+ /**
+ * Compile the include statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileInclude($expression)
+ {
+ if (Str::startsWith($expression, '(')) {
+ $expression = substr($expression, 1, -1);
+ }
+
+ return "make($expression, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>";
+ }
+
+ /**
+ * Compile the stack statements into the content.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileStack($expression)
+ {
+ return "yieldContent{$expression}; ?>";
+ }
+
+ /**
+ * Compile the push statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compilePush($expression)
+ {
+ return "startSection{$expression}; ?>";
+ }
+
+ /**
+ * Compile the endpush statements into valid PHP.
+ *
+ * @param string $expression
+ * @return string
+ */
+ protected function compileEndpush($expression)
+ {
+ return 'appendSection(); ?>';
+ }
+
+ /**
+ * Get the extensions used by the compiler.
+ *
+ * @return array
+ */
+ public function getExtensions()
+ {
+ return $this->extensions;
+ }
+
+ /**
+ * Register a custom Blade compiler.
+ *
+ * @param callable $compiler
+ * @return void
+ */
+ public function extend(callable $compiler)
+ {
+ $this->extensions[] = $compiler;
+ }
+
+ /**
+ * Register a handler for custom directives.
+ *
+ * @param string $name
+ * @param callable $handler
+ * @return void
+ */
+ public function directive($name, callable $handler)
+ {
+ $this->customDirectives[$name] = $handler;
+ }
+
+ /**
+ * Get the list of custom directives.
+ *
+ * @return array
+ */
+ public function getCustomDirectives()
+ {
+ return $this->customDirectives;
+ }
+
+ /**
+ * Gets the raw tags used by the compiler.
+ *
+ * @return array
+ */
+ public function getRawTags()
+ {
+ return $this->rawTags;
+ }
+
+ /**
+ * Sets the raw tags used for the compiler.
+ *
+ * @param string $openTag
+ * @param string $closeTag
+ * @return void
+ */
+ public function setRawTags($openTag, $closeTag)
+ {
+ $this->rawTags = [preg_quote($openTag), preg_quote($closeTag)];
+ }
+
+ /**
+ * Sets the content tags used for the compiler.
+ *
+ * @param string $openTag
+ * @param string $closeTag
+ * @param bool $escaped
+ * @return void
+ */
+ public function setContentTags($openTag, $closeTag, $escaped = false)
+ {
+ $property = ($escaped === true) ? 'escapedTags' : 'contentTags';
+
+ $this->{$property} = [preg_quote($openTag), preg_quote($closeTag)];
+ }
+
+ /**
+ * Sets the escaped content tags used for the compiler.
+ *
+ * @param string $openTag
+ * @param string $closeTag
+ * @return void
+ */
+ public function setEscapedContentTags($openTag, $closeTag)
+ {
+ $this->setContentTags($openTag, $closeTag, true);
+ }
+
+ /**
+ * Gets the content tags used for the compiler.
+ *
+ * @return string
+ */
+ public function getContentTags()
+ {
+ return $this->getTags();
+ }
+
+ /**
+ * Gets the escaped content tags used for the compiler.
+ *
+ * @return string
+ */
+ public function getEscapedContentTags()
+ {
+ return $this->getTags(true);
+ }
+
+ /**
+ * Gets the tags used for the compiler.
+ *
+ * @param bool $escaped
+ * @return array
+ */
+ protected function getTags($escaped = false)
+ {
+ $tags = $escaped ? $this->escapedTags : $this->contentTags;
+
+ return array_map('stripcslashes', $tags);
+ }
+
+ /**
+ * Set the echo format to be used by the compiler.
+ *
+ * @param string $format
+ * @return void
+ */
+ public function setEchoFormat($format)
+ {
+ $this->echoFormat = $format;
+ }
+}
diff --git a/vendor/illuminate/view/Compilers/Compiler.php b/vendor/illuminate/view/Compilers/Compiler.php
new file mode 100644
index 00000000..73ded293
--- /dev/null
+++ b/vendor/illuminate/view/Compilers/Compiler.php
@@ -0,0 +1,75 @@
+files = $files;
+ $this->cachePath = $cachePath;
+ }
+
+ /**
+ * Get the path to the compiled version of a view.
+ *
+ * @param string $path
+ * @return string
+ */
+ public function getCompiledPath($path)
+ {
+ return $this->cachePath.'/'.md5($path);
+ }
+
+ /**
+ * Determine if the view at the given path is expired.
+ *
+ * @param string $path
+ * @return bool
+ */
+ public function isExpired($path)
+ {
+ $compiled = $this->getCompiledPath($path);
+
+ // If the compiled file doesn't exist we will indicate that the view is expired
+ // so that it can be re-compiled. Else, we will verify the last modification
+ // of the views is less than the modification times of the compiled views.
+ if (! $this->files->exists($compiled)) {
+ return true;
+ }
+
+ $lastModified = $this->files->lastModified($path);
+
+ return $lastModified >= $this->files->lastModified($compiled);
+ }
+}
diff --git a/vendor/illuminate/view/Compilers/CompilerInterface.php b/vendor/illuminate/view/Compilers/CompilerInterface.php
new file mode 100644
index 00000000..dfcb023a
--- /dev/null
+++ b/vendor/illuminate/view/Compilers/CompilerInterface.php
@@ -0,0 +1,30 @@
+compiler = $compiler;
+ }
+
+ /**
+ * Get the evaluated contents of the view.
+ *
+ * @param string $path
+ * @param array $data
+ * @return string
+ */
+ public function get($path, array $data = [])
+ {
+ $this->lastCompiled[] = $path;
+
+ // If this given view has expired, which means it has simply been edited since
+ // it was last compiled, we will re-compile the views so we can evaluate a
+ // fresh copy of the view. We'll pass the compiler the path of the view.
+ if ($this->compiler->isExpired($path)) {
+ $this->compiler->compile($path);
+ }
+
+ $compiled = $this->compiler->getCompiledPath($path);
+
+ // Once we have the path to the compiled file, we will evaluate the paths with
+ // typical PHP just like any other templates. We also keep a stack of views
+ // which have been rendered for right exception messages to be generated.
+ $results = $this->evaluatePath($compiled, $data);
+
+ array_pop($this->lastCompiled);
+
+ return $results;
+ }
+
+ /**
+ * Handle a view exception.
+ *
+ * @param \Exception $e
+ * @param int $obLevel
+ * @return void
+ *
+ * @throws $e
+ */
+ protected function handleViewException($e, $obLevel)
+ {
+ $e = new ErrorException($this->getMessage($e), 0, 1, $e->getFile(), $e->getLine(), $e);
+
+ parent::handleViewException($e, $obLevel);
+ }
+
+ /**
+ * Get the exception message for an exception.
+ *
+ * @param \Exception $e
+ * @return string
+ */
+ protected function getMessage($e)
+ {
+ return $e->getMessage().' (View: '.realpath(last($this->lastCompiled)).')';
+ }
+
+ /**
+ * Get the compiler implementation.
+ *
+ * @return \Illuminate\View\Compilers\CompilerInterface
+ */
+ public function getCompiler()
+ {
+ return $this->compiler;
+ }
+}
diff --git a/vendor/illuminate/view/Engines/Engine.php b/vendor/illuminate/view/Engines/Engine.php
new file mode 100644
index 00000000..bf5c748d
--- /dev/null
+++ b/vendor/illuminate/view/Engines/Engine.php
@@ -0,0 +1,23 @@
+lastRendered;
+ }
+}
diff --git a/vendor/illuminate/view/Engines/EngineInterface.php b/vendor/illuminate/view/Engines/EngineInterface.php
new file mode 100644
index 00000000..a6f71d2a
--- /dev/null
+++ b/vendor/illuminate/view/Engines/EngineInterface.php
@@ -0,0 +1,15 @@
+resolved[$engine]);
+
+ $this->resolvers[$engine] = $resolver;
+ }
+
+ /**
+ * Resolver an engine instance by name.
+ *
+ * @param string $engine
+ * @return \Illuminate\View\Engines\EngineInterface
+ * @throws \InvalidArgumentException
+ */
+ public function resolve($engine)
+ {
+ if (isset($this->resolved[$engine])) {
+ return $this->resolved[$engine];
+ }
+
+ if (isset($this->resolvers[$engine])) {
+ return $this->resolved[$engine] = call_user_func($this->resolvers[$engine]);
+ }
+
+ throw new InvalidArgumentException("Engine $engine not found.");
+ }
+}
diff --git a/vendor/illuminate/view/Engines/PhpEngine.php b/vendor/illuminate/view/Engines/PhpEngine.php
new file mode 100644
index 00000000..7bbf3fc7
--- /dev/null
+++ b/vendor/illuminate/view/Engines/PhpEngine.php
@@ -0,0 +1,69 @@
+evaluatePath($path, $data);
+ }
+
+ /**
+ * Get the evaluated contents of the view at the given path.
+ *
+ * @param string $__path
+ * @param array $__data
+ * @return string
+ */
+ protected function evaluatePath($__path, $__data)
+ {
+ $obLevel = ob_get_level();
+
+ ob_start();
+
+ extract($__data, EXTR_SKIP);
+
+ // We'll evaluate the contents of the view inside a try/catch block so we can
+ // flush out any stray output that might get out before an error occurs or
+ // an exception is thrown. This prevents any partial views from leaking.
+ try {
+ include $__path;
+ } catch (Exception $e) {
+ $this->handleViewException($e, $obLevel);
+ } catch (Throwable $e) {
+ $this->handleViewException(new FatalThrowableError($e), $obLevel);
+ }
+
+ return ltrim(ob_get_clean());
+ }
+
+ /**
+ * Handle a view exception.
+ *
+ * @param \Exception $e
+ * @param int $obLevel
+ * @return void
+ *
+ * @throws $e
+ */
+ protected function handleViewException($e, $obLevel)
+ {
+ while (ob_get_level() > $obLevel) {
+ ob_end_clean();
+ }
+
+ throw $e;
+ }
+}
diff --git a/vendor/illuminate/view/Expression.php b/vendor/illuminate/view/Expression.php
new file mode 100644
index 00000000..4749b23d
--- /dev/null
+++ b/vendor/illuminate/view/Expression.php
@@ -0,0 +1,46 @@
+html = $html;
+ }
+
+ /**
+ * Get the the HTML string.
+ *
+ * @return string
+ */
+ public function toHtml()
+ {
+ return $this->html;
+ }
+
+ /**
+ * Get the the HTML string.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toHtml();
+ }
+}
diff --git a/vendor/illuminate/view/Factory.php b/vendor/illuminate/view/Factory.php
new file mode 100644
index 00000000..fbccf088
--- /dev/null
+++ b/vendor/illuminate/view/Factory.php
@@ -0,0 +1,886 @@
+ 'blade', 'php' => 'php'];
+
+ /**
+ * The view composer events.
+ *
+ * @var array
+ */
+ protected $composers = [];
+
+ /**
+ * All of the finished, captured sections.
+ *
+ * @var array
+ */
+ protected $sections = [];
+
+ /**
+ * The stack of in-progress sections.
+ *
+ * @var array
+ */
+ protected $sectionStack = [];
+
+ /**
+ * The number of active rendering operations.
+ *
+ * @var int
+ */
+ protected $renderCount = 0;
+
+ /**
+ * Create a new view factory instance.
+ *
+ * @param \Illuminate\View\Engines\EngineResolver $engines
+ * @param \Illuminate\View\ViewFinderInterface $finder
+ * @param \Illuminate\Contracts\Events\Dispatcher $events
+ * @return void
+ */
+ public function __construct(EngineResolver $engines, ViewFinderInterface $finder, Dispatcher $events)
+ {
+ $this->finder = $finder;
+ $this->events = $events;
+ $this->engines = $engines;
+
+ $this->share('__env', $this);
+ }
+
+ /**
+ * Get the evaluated view contents for the given view.
+ *
+ * @param string $path
+ * @param array $data
+ * @param array $mergeData
+ * @return \Illuminate\Contracts\View\View
+ */
+ public function file($path, $data = [], $mergeData = [])
+ {
+ $data = array_merge($mergeData, $this->parseData($data));
+
+ $this->callCreator($view = new View($this, $this->getEngineFromPath($path), $path, $path, $data));
+
+ return $view;
+ }
+
+ /**
+ * Get the evaluated view contents for the given view.
+ *
+ * @param string $view
+ * @param array $data
+ * @param array $mergeData
+ * @return \Illuminate\Contracts\View\View
+ */
+ public function make($view, $data = [], $mergeData = [])
+ {
+ if (isset($this->aliases[$view])) {
+ $view = $this->aliases[$view];
+ }
+
+ $view = $this->normalizeName($view);
+
+ $path = $this->finder->find($view);
+
+ $data = array_merge($mergeData, $this->parseData($data));
+
+ $this->callCreator($view = new View($this, $this->getEngineFromPath($path), $view, $path, $data));
+
+ return $view;
+ }
+
+ /**
+ * Normalize a view name.
+ *
+ * @param string $name
+ * @return string
+ */
+ protected function normalizeName($name)
+ {
+ $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER;
+
+ if (strpos($name, $delimiter) === false) {
+ return str_replace('/', '.', $name);
+ }
+
+ list($namespace, $name) = explode($delimiter, $name);
+
+ return $namespace.$delimiter.str_replace('/', '.', $name);
+ }
+
+ /**
+ * Parse the given data into a raw array.
+ *
+ * @param mixed $data
+ * @return array
+ */
+ protected function parseData($data)
+ {
+ return $data instanceof Arrayable ? $data->toArray() : $data;
+ }
+
+ /**
+ * Get the evaluated view contents for a named view.
+ *
+ * @param string $view
+ * @param mixed $data
+ * @return \Illuminate\Contracts\View\View
+ */
+ public function of($view, $data = [])
+ {
+ return $this->make($this->names[$view], $data);
+ }
+
+ /**
+ * Register a named view.
+ *
+ * @param string $view
+ * @param string $name
+ * @return void
+ */
+ public function name($view, $name)
+ {
+ $this->names[$name] = $view;
+ }
+
+ /**
+ * Add an alias for a view.
+ *
+ * @param string $view
+ * @param string $alias
+ * @return void
+ */
+ public function alias($view, $alias)
+ {
+ $this->aliases[$alias] = $view;
+ }
+
+ /**
+ * Determine if a given view exists.
+ *
+ * @param string $view
+ * @return bool
+ */
+ public function exists($view)
+ {
+ try {
+ $this->finder->find($view);
+ } catch (InvalidArgumentException $e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Get the rendered contents of a partial from a loop.
+ *
+ * @param string $view
+ * @param array $data
+ * @param string $iterator
+ * @param string $empty
+ * @return string
+ */
+ public function renderEach($view, $data, $iterator, $empty = 'raw|')
+ {
+ $result = '';
+
+ // If is actually data in the array, we will loop through the data and append
+ // an instance of the partial view to the final result HTML passing in the
+ // iterated value of this data array, allowing the views to access them.
+ if (count($data) > 0) {
+ foreach ($data as $key => $value) {
+ $data = ['key' => $key, $iterator => $value];
+
+ $result .= $this->make($view, $data)->render();
+ }
+ }
+
+ // If there is no data in the array, we will render the contents of the empty
+ // view. Alternatively, the "empty view" could be a raw string that begins
+ // with "raw|" for convenience and to let this know that it is a string.
+ else {
+ if (Str::startsWith($empty, 'raw|')) {
+ $result = substr($empty, 4);
+ } else {
+ $result = $this->make($empty)->render();
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Get the appropriate view engine for the given path.
+ *
+ * @param string $path
+ * @return \Illuminate\View\Engines\EngineInterface
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function getEngineFromPath($path)
+ {
+ if (! $extension = $this->getExtension($path)) {
+ throw new InvalidArgumentException("Unrecognized extension in file: $path");
+ }
+
+ $engine = $this->extensions[$extension];
+
+ return $this->engines->resolve($engine);
+ }
+
+ /**
+ * Get the extension used by the view file.
+ *
+ * @param string $path
+ * @return string
+ */
+ protected function getExtension($path)
+ {
+ $extensions = array_keys($this->extensions);
+
+ return Arr::first($extensions, function ($key, $value) use ($path) {
+ return Str::endsWith($path, '.'.$value);
+ });
+ }
+
+ /**
+ * Add a piece of shared data to the environment.
+ *
+ * @param array|string $key
+ * @param mixed $value
+ * @return mixed
+ */
+ public function share($key, $value = null)
+ {
+ if (! is_array($key)) {
+ return $this->shared[$key] = $value;
+ }
+
+ foreach ($key as $innerKey => $innerValue) {
+ $this->share($innerKey, $innerValue);
+ }
+ }
+
+ /**
+ * Register a view creator event.
+ *
+ * @param array|string $views
+ * @param \Closure|string $callback
+ * @return array
+ */
+ public function creator($views, $callback)
+ {
+ $creators = [];
+
+ foreach ((array) $views as $view) {
+ $creators[] = $this->addViewEvent($view, $callback, 'creating: ');
+ }
+
+ return $creators;
+ }
+
+ /**
+ * Register multiple view composers via an array.
+ *
+ * @param array $composers
+ * @return array
+ */
+ public function composers(array $composers)
+ {
+ $registered = [];
+
+ foreach ($composers as $callback => $views) {
+ $registered = array_merge($registered, $this->composer($views, $callback));
+ }
+
+ return $registered;
+ }
+
+ /**
+ * Register a view composer event.
+ *
+ * @param array|string $views
+ * @param \Closure|string $callback
+ * @param int|null $priority
+ * @return array
+ */
+ public function composer($views, $callback, $priority = null)
+ {
+ $composers = [];
+
+ foreach ((array) $views as $view) {
+ $composers[] = $this->addViewEvent($view, $callback, 'composing: ', $priority);
+ }
+
+ return $composers;
+ }
+
+ /**
+ * Add an event for a given view.
+ *
+ * @param string $view
+ * @param \Closure|string $callback
+ * @param string $prefix
+ * @param int|null $priority
+ * @return \Closure|null
+ */
+ protected function addViewEvent($view, $callback, $prefix = 'composing: ', $priority = null)
+ {
+ $view = $this->normalizeName($view);
+
+ if ($callback instanceof Closure) {
+ $this->addEventListener($prefix.$view, $callback, $priority);
+
+ return $callback;
+ } elseif (is_string($callback)) {
+ return $this->addClassEvent($view, $callback, $prefix, $priority);
+ }
+ }
+
+ /**
+ * Register a class based view composer.
+ *
+ * @param string $view
+ * @param string $class
+ * @param string $prefix
+ * @param int|null $priority
+ * @return \Closure
+ */
+ protected function addClassEvent($view, $class, $prefix, $priority = null)
+ {
+ $name = $prefix.$view;
+
+ // When registering a class based view "composer", we will simply resolve the
+ // classes from the application IoC container then call the compose method
+ // on the instance. This allows for convenient, testable view composers.
+ $callback = $this->buildClassEventCallback($class, $prefix);
+
+ $this->addEventListener($name, $callback, $priority);
+
+ return $callback;
+ }
+
+ /**
+ * Add a listener to the event dispatcher.
+ *
+ * @param string $name
+ * @param \Closure $callback
+ * @param int|null $priority
+ * @return void
+ */
+ protected function addEventListener($name, $callback, $priority = null)
+ {
+ if (is_null($priority)) {
+ $this->events->listen($name, $callback);
+ } else {
+ $this->events->listen($name, $callback, $priority);
+ }
+ }
+
+ /**
+ * Build a class based container callback Closure.
+ *
+ * @param string $class
+ * @param string $prefix
+ * @return \Closure
+ */
+ protected function buildClassEventCallback($class, $prefix)
+ {
+ list($class, $method) = $this->parseClassEvent($class, $prefix);
+
+ // Once we have the class and method name, we can build the Closure to resolve
+ // the instance out of the IoC container and call the method on it with the
+ // given arguments that are passed to the Closure as the composer's data.
+ return function () use ($class, $method) {
+ $callable = [$this->container->make($class), $method];
+
+ return call_user_func_array($callable, func_get_args());
+ };
+ }
+
+ /**
+ * Parse a class based composer name.
+ *
+ * @param string $class
+ * @param string $prefix
+ * @return array
+ */
+ protected function parseClassEvent($class, $prefix)
+ {
+ if (Str::contains($class, '@')) {
+ return explode('@', $class);
+ }
+
+ $method = Str::contains($prefix, 'composing') ? 'compose' : 'create';
+
+ return [$class, $method];
+ }
+
+ /**
+ * Call the composer for a given view.
+ *
+ * @param \Illuminate\Contracts\View\View $view
+ * @return void
+ */
+ public function callComposer(View $view)
+ {
+ $this->events->fire('composing: '.$view->getName(), [$view]);
+ }
+
+ /**
+ * Call the creator for a given view.
+ *
+ * @param \Illuminate\Contracts\View\View $view
+ * @return void
+ */
+ public function callCreator(View $view)
+ {
+ $this->events->fire('creating: '.$view->getName(), [$view]);
+ }
+
+ /**
+ * Start injecting content into a section.
+ *
+ * @param string $section
+ * @param string $content
+ * @return void
+ */
+ public function startSection($section, $content = '')
+ {
+ if ($content === '') {
+ if (ob_start()) {
+ $this->sectionStack[] = $section;
+ }
+ } else {
+ $this->extendSection($section, $content);
+ }
+ }
+
+ /**
+ * Inject inline content into a section.
+ *
+ * @param string $section
+ * @param string $content
+ * @return void
+ */
+ public function inject($section, $content)
+ {
+ return $this->startSection($section, $content);
+ }
+
+ /**
+ * Stop injecting content into a section and return its contents.
+ *
+ * @return string
+ */
+ public function yieldSection()
+ {
+ if (empty($this->sectionStack)) {
+ return '';
+ }
+
+ return $this->yieldContent($this->stopSection());
+ }
+
+ /**
+ * Stop injecting content into a section.
+ *
+ * @param bool $overwrite
+ * @return string
+ * @throws \InvalidArgumentException
+ */
+ public function stopSection($overwrite = false)
+ {
+ if (empty($this->sectionStack)) {
+ throw new InvalidArgumentException('Cannot end a section without first starting one.');
+ }
+
+ $last = array_pop($this->sectionStack);
+
+ if ($overwrite) {
+ $this->sections[$last] = ob_get_clean();
+ } else {
+ $this->extendSection($last, ob_get_clean());
+ }
+
+ return $last;
+ }
+
+ /**
+ * Stop injecting content into a section and append it.
+ *
+ * @return string
+ * @throws \InvalidArgumentException
+ */
+ public function appendSection()
+ {
+ if (empty($this->sectionStack)) {
+ throw new InvalidArgumentException('Cannot end a section without first starting one.');
+ }
+
+ $last = array_pop($this->sectionStack);
+
+ if (isset($this->sections[$last])) {
+ $this->sections[$last] .= ob_get_clean();
+ } else {
+ $this->sections[$last] = ob_get_clean();
+ }
+
+ return $last;
+ }
+
+ /**
+ * Append content to a given section.
+ *
+ * @param string $section
+ * @param string $content
+ * @return void
+ */
+ protected function extendSection($section, $content)
+ {
+ if (isset($this->sections[$section])) {
+ $content = str_replace('@parent', $content, $this->sections[$section]);
+ }
+
+ $this->sections[$section] = $content;
+ }
+
+ /**
+ * Get the string contents of a section.
+ *
+ * @param string $section
+ * @param string $default
+ * @return string
+ */
+ public function yieldContent($section, $default = '')
+ {
+ $sectionContent = $default;
+
+ if (isset($this->sections[$section])) {
+ $sectionContent = $this->sections[$section];
+ }
+
+ $sectionContent = str_replace('@@parent', '--parent--holder--', $sectionContent);
+
+ return str_replace(
+ '--parent--holder--', '@parent', str_replace('@parent', '', $sectionContent)
+ );
+ }
+
+ /**
+ * Flush all of the section contents.
+ *
+ * @return void
+ */
+ public function flushSections()
+ {
+ $this->renderCount = 0;
+
+ $this->sections = [];
+
+ $this->sectionStack = [];
+ }
+
+ /**
+ * Flush all of the section contents if done rendering.
+ *
+ * @return void
+ */
+ public function flushSectionsIfDoneRendering()
+ {
+ if ($this->doneRendering()) {
+ $this->flushSections();
+ }
+ }
+
+ /**
+ * Increment the rendering counter.
+ *
+ * @return void
+ */
+ public function incrementRender()
+ {
+ $this->renderCount++;
+ }
+
+ /**
+ * Decrement the rendering counter.
+ *
+ * @return void
+ */
+ public function decrementRender()
+ {
+ $this->renderCount--;
+ }
+
+ /**
+ * Check if there are no active render operations.
+ *
+ * @return bool
+ */
+ public function doneRendering()
+ {
+ return $this->renderCount == 0;
+ }
+
+ /**
+ * Add a location to the array of view locations.
+ *
+ * @param string $location
+ * @return void
+ */
+ public function addLocation($location)
+ {
+ $this->finder->addLocation($location);
+ }
+
+ /**
+ * Add a new namespace to the loader.
+ *
+ * @param string $namespace
+ * @param string|array $hints
+ * @return void
+ */
+ public function addNamespace($namespace, $hints)
+ {
+ $this->finder->addNamespace($namespace, $hints);
+ }
+
+ /**
+ * Prepend a new namespace to the loader.
+ *
+ * @param string $namespace
+ * @param string|array $hints
+ * @return void
+ */
+ public function prependNamespace($namespace, $hints)
+ {
+ $this->finder->prependNamespace($namespace, $hints);
+ }
+
+ /**
+ * Register a valid view extension and its engine.
+ *
+ * @param string $extension
+ * @param string $engine
+ * @param \Closure $resolver
+ * @return void
+ */
+ public function addExtension($extension, $engine, $resolver = null)
+ {
+ $this->finder->addExtension($extension);
+
+ if (isset($resolver)) {
+ $this->engines->register($engine, $resolver);
+ }
+
+ unset($this->extensions[$extension]);
+
+ $this->extensions = array_merge([$extension => $engine], $this->extensions);
+ }
+
+ /**
+ * Get the extension to engine bindings.
+ *
+ * @return array
+ */
+ public function getExtensions()
+ {
+ return $this->extensions;
+ }
+
+ /**
+ * Get the engine resolver instance.
+ *
+ * @return \Illuminate\View\Engines\EngineResolver
+ */
+ public function getEngineResolver()
+ {
+ return $this->engines;
+ }
+
+ /**
+ * Get the view finder instance.
+ *
+ * @return \Illuminate\View\ViewFinderInterface
+ */
+ public function getFinder()
+ {
+ return $this->finder;
+ }
+
+ /**
+ * Set the view finder instance.
+ *
+ * @param \Illuminate\View\ViewFinderInterface $finder
+ * @return void
+ */
+ public function setFinder(ViewFinderInterface $finder)
+ {
+ $this->finder = $finder;
+ }
+
+ /**
+ * Get the event dispatcher instance.
+ *
+ * @return \Illuminate\Contracts\Events\Dispatcher
+ */
+ public function getDispatcher()
+ {
+ return $this->events;
+ }
+
+ /**
+ * Set the event dispatcher instance.
+ *
+ * @param \Illuminate\Contracts\Events\Dispatcher $events
+ * @return void
+ */
+ public function setDispatcher(Dispatcher $events)
+ {
+ $this->events = $events;
+ }
+
+ /**
+ * Get the IoC container instance.
+ *
+ * @return \Illuminate\Contracts\Container\Container
+ */
+ public function getContainer()
+ {
+ return $this->container;
+ }
+
+ /**
+ * Set the IoC container instance.
+ *
+ * @param \Illuminate\Contracts\Container\Container $container
+ * @return void
+ */
+ public function setContainer(Container $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * Get an item from the shared data.
+ *
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public function shared($key, $default = null)
+ {
+ return Arr::get($this->shared, $key, $default);
+ }
+
+ /**
+ * Get all of the shared data for the environment.
+ *
+ * @return array
+ */
+ public function getShared()
+ {
+ return $this->shared;
+ }
+
+ /**
+ * Check if section exists.
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function hasSection($name)
+ {
+ return array_key_exists($name, $this->sections);
+ }
+
+ /**
+ * Get the entire array of sections.
+ *
+ * @return array
+ */
+ public function getSections()
+ {
+ return $this->sections;
+ }
+
+ /**
+ * Get all of the registered named views in environment.
+ *
+ * @return array
+ */
+ public function getNames()
+ {
+ return $this->names;
+ }
+}
diff --git a/vendor/illuminate/view/FileViewFinder.php b/vendor/illuminate/view/FileViewFinder.php
new file mode 100644
index 00000000..1c976b30
--- /dev/null
+++ b/vendor/illuminate/view/FileViewFinder.php
@@ -0,0 +1,265 @@
+files = $files;
+ $this->paths = $paths;
+
+ if (isset($extensions)) {
+ $this->extensions = $extensions;
+ }
+ }
+
+ /**
+ * Get the fully qualified location of the view.
+ *
+ * @param string $name
+ * @return string
+ */
+ public function find($name)
+ {
+ if (isset($this->views[$name])) {
+ return $this->views[$name];
+ }
+
+ if ($this->hasHintInformation($name = trim($name))) {
+ return $this->views[$name] = $this->findNamedPathView($name);
+ }
+
+ return $this->views[$name] = $this->findInPaths($name, $this->paths);
+ }
+
+ /**
+ * Get the path to a template with a named path.
+ *
+ * @param string $name
+ * @return string
+ */
+ protected function findNamedPathView($name)
+ {
+ list($namespace, $view) = $this->getNamespaceSegments($name);
+
+ return $this->findInPaths($view, $this->hints[$namespace]);
+ }
+
+ /**
+ * Get the segments of a template with a named path.
+ *
+ * @param string $name
+ * @return array
+ *
+ * @throws \InvalidArgumentException
+ */
+ protected function getNamespaceSegments($name)
+ {
+ $segments = explode(static::HINT_PATH_DELIMITER, $name);
+
+ if (count($segments) != 2) {
+ throw new InvalidArgumentException("View [$name] has an invalid name.");
+ }
+
+ if (! isset($this->hints[$segments[0]])) {
+ throw new InvalidArgumentException("No hint path defined for [{$segments[0]}].");
+ }
+
+ return $segments;
+ }
+
+ /**
+ * Find the given view in the list of paths.
+ *
+ * @param string $name
+ * @param array $paths
+ * @return string
+ *
+ * @throws \InvalidArgumentException
+ */
+ protected function findInPaths($name, $paths)
+ {
+ foreach ((array) $paths as $path) {
+ foreach ($this->getPossibleViewFiles($name) as $file) {
+ if ($this->files->exists($viewPath = $path.'/'.$file)) {
+ return $viewPath;
+ }
+ }
+ }
+
+ throw new InvalidArgumentException("View [$name] not found.");
+ }
+
+ /**
+ * Get an array of possible view files.
+ *
+ * @param string $name
+ * @return array
+ */
+ protected function getPossibleViewFiles($name)
+ {
+ return array_map(function ($extension) use ($name) {
+ return str_replace('.', '/', $name).'.'.$extension;
+ }, $this->extensions);
+ }
+
+ /**
+ * Add a location to the finder.
+ *
+ * @param string $location
+ * @return void
+ */
+ public function addLocation($location)
+ {
+ $this->paths[] = $location;
+ }
+
+ /**
+ * Add a namespace hint to the finder.
+ *
+ * @param string $namespace
+ * @param string|array $hints
+ * @return void
+ */
+ public function addNamespace($namespace, $hints)
+ {
+ $hints = (array) $hints;
+
+ if (isset($this->hints[$namespace])) {
+ $hints = array_merge($this->hints[$namespace], $hints);
+ }
+
+ $this->hints[$namespace] = $hints;
+ }
+
+ /**
+ * Prepend a namespace hint to the finder.
+ *
+ * @param string $namespace
+ * @param string|array $hints
+ * @return void
+ */
+ public function prependNamespace($namespace, $hints)
+ {
+ $hints = (array) $hints;
+
+ if (isset($this->hints[$namespace])) {
+ $hints = array_merge($hints, $this->hints[$namespace]);
+ }
+
+ $this->hints[$namespace] = $hints;
+ }
+
+ /**
+ * Register an extension with the view finder.
+ *
+ * @param string $extension
+ * @return void
+ */
+ public function addExtension($extension)
+ {
+ if (($index = array_search($extension, $this->extensions)) !== false) {
+ unset($this->extensions[$index]);
+ }
+
+ array_unshift($this->extensions, $extension);
+ }
+
+ /**
+ * Returns whether or not the view specify a hint information.
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function hasHintInformation($name)
+ {
+ return strpos($name, static::HINT_PATH_DELIMITER) > 0;
+ }
+
+ /**
+ * Get the filesystem instance.
+ *
+ * @return \Illuminate\Filesystem\Filesystem
+ */
+ public function getFilesystem()
+ {
+ return $this->files;
+ }
+
+ /**
+ * Get the active view paths.
+ *
+ * @return array
+ */
+ public function getPaths()
+ {
+ return $this->paths;
+ }
+
+ /**
+ * Get the namespace to file path hints.
+ *
+ * @return array
+ */
+ public function getHints()
+ {
+ return $this->hints;
+ }
+
+ /**
+ * Get registered extensions.
+ *
+ * @return array
+ */
+ public function getExtensions()
+ {
+ return $this->extensions;
+ }
+}
diff --git a/vendor/illuminate/view/Middleware/ShareErrorsFromSession.php b/vendor/illuminate/view/Middleware/ShareErrorsFromSession.php
new file mode 100644
index 00000000..812cf61a
--- /dev/null
+++ b/vendor/illuminate/view/Middleware/ShareErrorsFromSession.php
@@ -0,0 +1,51 @@
+view = $view;
+ }
+
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ * @return mixed
+ */
+ public function handle($request, Closure $next)
+ {
+ // If the current session has an "errors" variable bound to it, we will share
+ // its value with all view instances so the views can easily access errors
+ // without having to bind. An empty bag is set when there aren't errors.
+ $this->view->share(
+ 'errors', $request->session()->get('errors', new ViewErrorBag)
+ );
+
+ // Putting the errors in the view for every view allows the developer to just
+ // assume that some errors are always available, which is convenient since
+ // they don't have to continually run checks for the presence of errors.
+
+ return $next($request);
+ }
+}
diff --git a/vendor/illuminate/view/View.php b/vendor/illuminate/view/View.php
new file mode 100644
index 00000000..c49fa040
--- /dev/null
+++ b/vendor/illuminate/view/View.php
@@ -0,0 +1,404 @@
+view = $view;
+ $this->path = $path;
+ $this->engine = $engine;
+ $this->factory = $factory;
+
+ $this->data = $data instanceof Arrayable ? $data->toArray() : (array) $data;
+ }
+
+ /**
+ * Get the string contents of the view.
+ *
+ * @param callable|null $callback
+ * @return string
+ */
+ public function render(callable $callback = null)
+ {
+ try {
+ $contents = $this->renderContents();
+
+ $response = isset($callback) ? call_user_func($callback, $this, $contents) : null;
+
+ // Once we have the contents of the view, we will flush the sections if we are
+ // done rendering all views so that there is nothing left hanging over when
+ // another view gets rendered in the future by the application developer.
+ $this->factory->flushSectionsIfDoneRendering();
+
+ return ! is_null($response) ? $response : $contents;
+ } catch (Exception $e) {
+ $this->factory->flushSections();
+
+ throw $e;
+ } catch (Throwable $e) {
+ $this->factory->flushSections();
+
+ throw $e;
+ }
+ }
+
+ /**
+ * Get the contents of the view instance.
+ *
+ * @return string
+ */
+ protected function renderContents()
+ {
+ // We will keep track of the amount of views being rendered so we can flush
+ // the section after the complete rendering operation is done. This will
+ // clear out the sections for any separate views that may be rendered.
+ $this->factory->incrementRender();
+
+ $this->factory->callComposer($this);
+
+ $contents = $this->getContents();
+
+ // Once we've finished rendering the view, we'll decrement the render count
+ // so that each sections get flushed out next time a view is created and
+ // no old sections are staying around in the memory of an environment.
+ $this->factory->decrementRender();
+
+ return $contents;
+ }
+
+ /**
+ * Get the sections of the rendered view.
+ *
+ * @return array
+ */
+ public function renderSections()
+ {
+ return $this->render(function () {
+ return $this->factory->getSections();
+ });
+ }
+
+ /**
+ * Get the evaluated contents of the view.
+ *
+ * @return string
+ */
+ protected function getContents()
+ {
+ return $this->engine->get($this->path, $this->gatherData());
+ }
+
+ /**
+ * Get the data bound to the view instance.
+ *
+ * @return array
+ */
+ protected function gatherData()
+ {
+ $data = array_merge($this->factory->getShared(), $this->data);
+
+ foreach ($data as $key => $value) {
+ if ($value instanceof Renderable) {
+ $data[$key] = $value->render();
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Add a piece of data to the view.
+ *
+ * @param string|array $key
+ * @param mixed $value
+ * @return $this
+ */
+ public function with($key, $value = null)
+ {
+ if (is_array($key)) {
+ $this->data = array_merge($this->data, $key);
+ } else {
+ $this->data[$key] = $value;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add a view instance to the view data.
+ *
+ * @param string $key
+ * @param string $view
+ * @param array $data
+ * @return $this
+ */
+ public function nest($key, $view, array $data = [])
+ {
+ return $this->with($key, $this->factory->make($view, $data));
+ }
+
+ /**
+ * Add validation errors to the view.
+ *
+ * @param \Illuminate\Contracts\Support\MessageProvider|array $provider
+ * @return $this
+ */
+ public function withErrors($provider)
+ {
+ if ($provider instanceof MessageProvider) {
+ $this->with('errors', $provider->getMessageBag());
+ } else {
+ $this->with('errors', new MessageBag((array) $provider));
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get the view factory instance.
+ *
+ * @return \Illuminate\View\Factory
+ */
+ public function getFactory()
+ {
+ return $this->factory;
+ }
+
+ /**
+ * Get the view's rendering engine.
+ *
+ * @return \Illuminate\View\Engines\EngineInterface
+ */
+ public function getEngine()
+ {
+ return $this->engine;
+ }
+
+ /**
+ * Get the name of the view.
+ *
+ * @return string
+ */
+ public function name()
+ {
+ return $this->getName();
+ }
+
+ /**
+ * Get the name of the view.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->view;
+ }
+
+ /**
+ * Get the array of view data.
+ *
+ * @return array
+ */
+ public function getData()
+ {
+ return $this->data;
+ }
+
+ /**
+ * Get the path to the view file.
+ *
+ * @return string
+ */
+ public function getPath()
+ {
+ return $this->path;
+ }
+
+ /**
+ * Set the path to the view.
+ *
+ * @param string $path
+ * @return void
+ */
+ public function setPath($path)
+ {
+ $this->path = $path;
+ }
+
+ /**
+ * Determine if a piece of data is bound.
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function offsetExists($key)
+ {
+ return array_key_exists($key, $this->data);
+ }
+
+ /**
+ * Get a piece of bound data to the view.
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function offsetGet($key)
+ {
+ return $this->data[$key];
+ }
+
+ /**
+ * Set a piece of data on the view.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function offsetSet($key, $value)
+ {
+ $this->with($key, $value);
+ }
+
+ /**
+ * Unset a piece of data from the view.
+ *
+ * @param string $key
+ * @return void
+ */
+ public function offsetUnset($key)
+ {
+ unset($this->data[$key]);
+ }
+
+ /**
+ * Get a piece of data from the view.
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function &__get($key)
+ {
+ return $this->data[$key];
+ }
+
+ /**
+ * Set a piece of data on the view.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function __set($key, $value)
+ {
+ $this->with($key, $value);
+ }
+
+ /**
+ * Check if a piece of data is bound to the view.
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function __isset($key)
+ {
+ return isset($this->data[$key]);
+ }
+
+ /**
+ * Remove a piece of bound data from the view.
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function __unset($key)
+ {
+ unset($this->data[$key]);
+ }
+
+ /**
+ * Dynamically bind parameters to the view.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return \Illuminate\View\View
+ *
+ * @throws \BadMethodCallException
+ */
+ public function __call($method, $parameters)
+ {
+ if (Str::startsWith($method, 'with')) {
+ return $this->with(Str::snake(substr($method, 4)), $parameters[0]);
+ }
+
+ throw new BadMethodCallException("Method [$method] does not exist on view.");
+ }
+
+ /**
+ * Get the string contents of the view.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->render();
+ }
+}
diff --git a/vendor/illuminate/view/ViewFinderInterface.php b/vendor/illuminate/view/ViewFinderInterface.php
new file mode 100644
index 00000000..4af1f9d7
--- /dev/null
+++ b/vendor/illuminate/view/ViewFinderInterface.php
@@ -0,0 +1,55 @@
+registerEngineResolver();
+
+ $this->registerViewFinder();
+
+ $this->registerFactory();
+ }
+
+ /**
+ * Register the engine resolver instance.
+ *
+ * @return void
+ */
+ public function registerEngineResolver()
+ {
+ $this->app->singleton('view.engine.resolver', function () {
+ $resolver = new EngineResolver;
+
+ // Next we will register the various engines with the resolver so that the
+ // environment can resolve the engines it needs for various views based
+ // on the extension of view files. We call a method for each engines.
+ foreach (['php', 'blade'] as $engine) {
+ $this->{'register'.ucfirst($engine).'Engine'}($resolver);
+ }
+
+ return $resolver;
+ });
+ }
+
+ /**
+ * Register the PHP engine implementation.
+ *
+ * @param \Illuminate\View\Engines\EngineResolver $resolver
+ * @return void
+ */
+ public function registerPhpEngine($resolver)
+ {
+ $resolver->register('php', function () {
+ return new PhpEngine;
+ });
+ }
+
+ /**
+ * Register the Blade engine implementation.
+ *
+ * @param \Illuminate\View\Engines\EngineResolver $resolver
+ * @return void
+ */
+ public function registerBladeEngine($resolver)
+ {
+ $app = $this->app;
+
+ // The Compiler engine requires an instance of the CompilerInterface, which in
+ // this case will be the Blade compiler, so we'll first create the compiler
+ // instance to pass into the engine so it can compile the views properly.
+ $app->singleton('blade.compiler', function ($app) {
+ $cache = $app['config']['view.compiled'];
+
+ return new BladeCompiler($app['files'], $cache);
+ });
+
+ $resolver->register('blade', function () use ($app) {
+ return new CompilerEngine($app['blade.compiler']);
+ });
+ }
+
+ /**
+ * Register the view finder implementation.
+ *
+ * @return void
+ */
+ public function registerViewFinder()
+ {
+ $this->app->bind('view.finder', function ($app) {
+ $paths = $app['config']['view.paths'];
+
+ return new FileViewFinder($app['files'], $paths);
+ });
+ }
+
+ /**
+ * Register the view environment.
+ *
+ * @return void
+ */
+ public function registerFactory()
+ {
+ $this->app->singleton('view', function ($app) {
+ // Next we need to grab the engine resolver instance that will be used by the
+ // environment. The resolver will be used by an environment to get each of
+ // the various engine implementations such as plain PHP or Blade engine.
+ $resolver = $app['view.engine.resolver'];
+
+ $finder = $app['view.finder'];
+
+ $env = new Factory($resolver, $finder, $app['events']);
+
+ // We will also set the container instance on this view environment since the
+ // view composers may be classes registered in the container, which allows
+ // for great testable, flexible composers for the application developer.
+ $env->setContainer($app);
+
+ $env->share('app', $app);
+
+ return $env;
+ });
+ }
+}
diff --git a/vendor/illuminate/view/composer.json b/vendor/illuminate/view/composer.json
new file mode 100644
index 00000000..4eb012bb
--- /dev/null
+++ b/vendor/illuminate/view/composer.json
@@ -0,0 +1,36 @@
+{
+ "name": "illuminate/view",
+ "description": "The Illuminate View package.",
+ "license": "MIT",
+ "homepage": "http://laravel.com",
+ "support": {
+ "issues": "https://github.com/laravel/framework/issues",
+ "source": "https://github.com/laravel/framework"
+ },
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylorotwell@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.5.9",
+ "illuminate/container": "5.1.*",
+ "illuminate/contracts": "5.1.*",
+ "illuminate/events": "5.1.*",
+ "illuminate/filesystem": "5.1.*",
+ "illuminate/support": "5.1.*",
+ "symfony/debug": "2.7.*"
+ },
+ "autoload": {
+ "psr-4": {
+ "Illuminate\\View\\": ""
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/laravel/lumen-framework/.gitignore b/vendor/laravel/lumen-framework/.gitignore
new file mode 100644
index 00000000..f1223d13
--- /dev/null
+++ b/vendor/laravel/lumen-framework/.gitignore
@@ -0,0 +1,4 @@
+/lumen.log
+/vendor
+composer.lock
+.env
diff --git a/vendor/laravel/lumen-framework/.travis.yml b/vendor/laravel/lumen-framework/.travis.yml
new file mode 100644
index 00000000..087594f3
--- /dev/null
+++ b/vendor/laravel/lumen-framework/.travis.yml
@@ -0,0 +1,14 @@
+language: php
+
+php:
+ - 5.5.9
+ - 5.5
+ - 5.6
+ - 7.0
+ - hhvm
+
+sudo: false
+
+install: travis_retry composer install --no-interaction --prefer-source
+
+script: vendor/bin/phpunit
diff --git a/vendor/laravel/lumen-framework/LICENSE.txt b/vendor/laravel/lumen-framework/LICENSE.txt
new file mode 100644
index 00000000..1ce59636
--- /dev/null
+++ b/vendor/laravel/lumen-framework/LICENSE.txt
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/laravel/lumen-framework/composer.json b/vendor/laravel/lumen-framework/composer.json
new file mode 100644
index 00000000..6616ac1e
--- /dev/null
+++ b/vendor/laravel/lumen-framework/composer.json
@@ -0,0 +1,70 @@
+{
+ "name": "laravel/lumen-framework",
+ "description": "The Laravel Lumen Framework.",
+ "keywords": ["framework", "laravel", "lumen"],
+ "license": "MIT",
+ "homepage": "http://laravel.com",
+ "support": {
+ "issues": "https://github.com/laravel/lumen-framework/issues",
+ "source": "https://github.com/laravel/lumen-framework"
+ },
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylorotwell@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.5.9",
+ "illuminate/auth": "5.1.*",
+ "illuminate/bus": "5.1.*",
+ "illuminate/broadcasting": "5.1.*",
+ "illuminate/config": "5.1.*",
+ "illuminate/container": "5.1.*",
+ "illuminate/contracts": "5.1.*",
+ "illuminate/cache": "5.1.*",
+ "illuminate/console": "5.1.*",
+ "illuminate/cookie": "5.1.*",
+ "illuminate/database": "5.1.*",
+ "illuminate/encryption": "5.1.*",
+ "illuminate/events": "5.1.*",
+ "illuminate/filesystem": "5.1.*",
+ "illuminate/hashing": "5.1.*",
+ "illuminate/http": "5.1.*",
+ "illuminate/pagination": "5.1.*",
+ "illuminate/queue": "5.1.*",
+ "illuminate/session": "5.1.*",
+ "illuminate/support": "5.1.*",
+ "illuminate/translation": "5.1.*",
+ "illuminate/validation": "5.1.*",
+ "illuminate/view": "5.1.*",
+ "monolog/monolog": "~1.0",
+ "mtdowling/cron-expression": "~1.0",
+ "nikic/fast-route": "0.4.*",
+ "paragonie/random_compat": "^1.0.6",
+ "symfony/dom-crawler": "2.7.*",
+ "symfony/http-kernel": "2.7.*",
+ "symfony/http-foundation": "2.7.*",
+ "symfony/security-core": "2.7.*",
+ "symfony/var-dumper": "2.7.*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0",
+ "mockery/mockery": "~0.9"
+ },
+ "suggest": {
+ "vlucas/phpdotenv": "Required to use .env files (~1.0)."
+ },
+ "autoload": {
+ "psr-4": {
+ "Laravel\\Lumen\\": "src/"
+ },
+ "classmap": [
+ "src/Foundation"
+ ],
+ "files": [
+ "src/helpers.php"
+ ]
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/laravel/lumen-framework/config/app.php b/vendor/laravel/lumen-framework/config/app.php
new file mode 100644
index 00000000..bed4dc26
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/app.php
@@ -0,0 +1,46 @@
+ env('APP_KEY', 'SomeRandomString!!!'),
+
+ 'cipher' => 'AES-256-CBC',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application Locale Configuration
+ |--------------------------------------------------------------------------
+ |
+ | The application locale determines the default locale that will be used
+ | by the translation service provider. You are free to set this value
+ | to any of the locales which will be supported by the application.
+ |
+ */
+
+ 'locale' => env('APP_LOCALE', 'en'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application Fallback Locale
+ |--------------------------------------------------------------------------
+ |
+ | The fallback locale determines the locale to use when the current one
+ | is not available. You may change the value to correspond to any of
+ | the language folders that are provided through your application.
+ |
+ */
+
+ 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
+
+];
diff --git a/vendor/laravel/lumen-framework/config/auth.php b/vendor/laravel/lumen-framework/config/auth.php
new file mode 100644
index 00000000..cc6f6be4
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/auth.php
@@ -0,0 +1,67 @@
+ env('AUTH_DRIVER', 'eloquent'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Authentication Model
+ |--------------------------------------------------------------------------
+ |
+ | When using the "Eloquent" authentication driver, we need to know which
+ | Eloquent model should be used to retrieve your users. Of course, it
+ | is often just the "User" model but you may use whatever you like.
+ |
+ */
+
+ 'model' => env('AUTH_MODEL', 'App\User'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Authentication Table
+ |--------------------------------------------------------------------------
+ |
+ | When using the "Database" authentication driver, we need to know which
+ | table should be used to retrieve your users. We have chosen a basic
+ | default value but you may easily change it to any table you like.
+ |
+ */
+
+ 'table' => env('AUTH_TABLE', 'users'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Password Reset Settings
+ |--------------------------------------------------------------------------
+ |
+ | Here you may set the options for resetting passwords including the view
+ | that is your password reset e-mail. You can also set the name of the
+ | table that maintains all of the reset tokens for your application.
+ |
+ | The expire time is the number of minutes that the reset token should be
+ | considered valid. This security feature keeps tokens short-lived so
+ | they have less time to be guessed. You may change this as needed.
+ |
+ */
+
+ 'password' => [
+ 'email' => 'emails.password',
+ 'table' => 'password_resets',
+ 'expire' => 60,
+ ],
+
+];
diff --git a/vendor/laravel/lumen-framework/config/broadcasting.php b/vendor/laravel/lumen-framework/config/broadcasting.php
new file mode 100644
index 00000000..36f9b3c1
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/broadcasting.php
@@ -0,0 +1,49 @@
+ env('BROADCAST_DRIVER', 'pusher'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Broadcast Connections
+ |--------------------------------------------------------------------------
+ |
+ | Here you may define all of the broadcast connections that will be used
+ | to broadcast events to other systems or over websockets. Samples of
+ | each available type of connection are provided inside this array.
+ |
+ */
+
+ 'connections' => [
+
+ 'pusher' => [
+ 'driver' => 'pusher',
+ 'key' => env('PUSHER_KEY'),
+ 'secret' => env('PUSHER_SECRET'),
+ 'app_id' => env('PUSHER_APP_ID'),
+ ],
+
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ ],
+
+ 'log' => [
+ 'driver' => 'log',
+ ],
+
+ ],
+
+];
diff --git a/vendor/laravel/lumen-framework/config/cache.php b/vendor/laravel/lumen-framework/config/cache.php
new file mode 100644
index 00000000..9aa56515
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/cache.php
@@ -0,0 +1,75 @@
+ env('CACHE_DRIVER', 'memcached'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Cache Stores
+ |--------------------------------------------------------------------------
+ |
+ | Here you may define all of the cache "stores" for your application as
+ | well as their drivers. You may even define multiple stores for the
+ | same cache driver to group types of items stored in your caches.
+ |
+ */
+
+ 'stores' => [
+
+ 'array' => [
+ 'driver' => 'array',
+ ],
+
+ 'database' => [
+ 'driver' => 'database',
+ 'table' => env('CACHE_DATABASE_TABLE', 'cache'),
+ 'connection' => null,
+ ],
+
+ 'file' => [
+ 'driver' => 'file',
+ 'path' => storage_path('framework/cache'),
+ ],
+
+ 'memcached' => [
+ 'driver' => 'memcached',
+ 'servers' => [
+ [
+ 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100,
+ ],
+ ],
+ ],
+
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ ],
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Cache Key Prefix
+ |--------------------------------------------------------------------------
+ |
+ | When utilizing a RAM based store such as APC or Memcached, there might
+ | be other applications utilizing the same cache. So, we'll specify a
+ | value to get prefixed to all our keys so we can avoid collisions.
+ |
+ */
+
+ 'prefix' => 'laravel',
+
+];
diff --git a/vendor/laravel/lumen-framework/config/database.php b/vendor/laravel/lumen-framework/config/database.php
new file mode 100644
index 00000000..070fd13a
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/database.php
@@ -0,0 +1,134 @@
+ PDO::FETCH_CLASS,
+
+ /*
+ |--------------------------------------------------------------------------
+ | Default Database Connection Name
+ |--------------------------------------------------------------------------
+ |
+ | Here you may specify which of the database connections below you wish
+ | to use as your default connection for all database work. Of course
+ | you may use many connections at once using the Database library.
+ |
+ */
+
+ 'default' => env('DB_CONNECTION', 'sqlite'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Database Connections
+ |--------------------------------------------------------------------------
+ |
+ | Here are each of the database connections setup for your application.
+ | Of course, examples of configuring each database platform that is
+ | supported by Laravel is shown below to make development simple.
+ |
+ |
+ | All database work in Laravel is done through the PHP PDO facilities
+ | so make sure you have the driver for your particular database of
+ | choice installed on your machine before you begin development.
+ |
+ */
+
+ 'connections' => [
+
+ 'testing' => [
+ 'driver' => 'sqlite',
+ 'database' => ':memory:',
+ ],
+
+ 'sqlite' => [
+ 'driver' => 'sqlite',
+ 'database' => env('DB_DATABASE', storage_path('database/contacts.s3db')),
+ 'prefix' => env('DB_PREFIX', ''),
+ ],
+
+ 'mysql' => [
+ 'driver' => 'mysql',
+ 'host' => env('DB_HOST', 'localhost'),
+ 'port' => env('DB_PORT', 3306),
+ 'database' => env('DB_DATABASE', 'forge'),
+ 'username' => env('DB_USERNAME', 'forge'),
+ 'password' => env('DB_PASSWORD', ''),
+ 'charset' => 'utf8',
+ 'collation' => 'utf8_unicode_ci',
+ 'prefix' => env('DB_PREFIX', ''),
+ 'timezone' => env('DB_TIMEZONE', '+00:00'),
+ 'strict' => false,
+ ],
+
+ 'pgsql' => [
+ 'driver' => 'pgsql',
+ 'host' => env('DB_HOST', 'localhost'),
+ 'port' => env('DB_PORT', 5432),
+ 'database' => env('DB_DATABASE', 'forge'),
+ 'username' => env('DB_USERNAME', 'forge'),
+ 'password' => env('DB_PASSWORD', ''),
+ 'charset' => 'utf8',
+ 'prefix' => env('DB_PREFIX', ''),
+ 'schema' => 'public',
+ ],
+
+ 'sqlsrv' => [
+ 'driver' => 'sqlsrv',
+ 'host' => env('DB_HOST', 'localhost'),
+ 'database' => env('DB_DATABASE', 'forge'),
+ 'username' => env('DB_USERNAME', 'forge'),
+ 'password' => env('DB_PASSWORD', ''),
+ 'prefix' => env('DB_PREFIX', ''),
+ ],
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Migration Repository Table
+ |--------------------------------------------------------------------------
+ |
+ | This table keeps track of all the migrations that have already run for
+ | your application. Using this information, we can determine which of
+ | the migrations on disk haven't actually been run in the database.
+ |
+ */
+
+ 'migrations' => 'migrations',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Redis Databases
+ |--------------------------------------------------------------------------
+ |
+ | Redis is an open source, fast, and advanced key-value store that also
+ | provides a richer set of commands than a typical key-value systems
+ | such as APC or Memcached. Laravel makes it easy to dig right in.
+ |
+ */
+
+ 'redis' => [
+
+ 'cluster' => env('REDIS_CLUSTER', false),
+
+ 'default' => [
+ 'host' => env('REDIS_HOST', '127.0.0.1'),
+ 'port' => env('REDIS_PORT', 6379),
+ 'database' => env('REDIS_DATABASE', 0),
+ 'password' => env('REDIS_PASSWORD', null),
+ ],
+
+ ],
+
+];
diff --git a/vendor/laravel/lumen-framework/config/filesystems.php b/vendor/laravel/lumen-framework/config/filesystems.php
new file mode 100644
index 00000000..688db063
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/filesystems.php
@@ -0,0 +1,72 @@
+ env('FILESYSTEM_DRIVER', 'local'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Default Cloud Filesystem Disk
+ |--------------------------------------------------------------------------
+ |
+ | Many applications store files both locally and in the cloud. For this
+ | reason, you may specify a default "cloud" driver here. This driver
+ | will be bound as the Cloud disk implementation in the container.
+ |
+ */
+
+ 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Filesystem Disks
+ |--------------------------------------------------------------------------
+ |
+ | Here you may configure as many filesystem "disks" as you wish, and you
+ | may even configure multiple disks of the same driver. Defaults have
+ | been setup for each driver as an example of the required options.
+ |
+ */
+
+ 'disks' => [
+
+ 'local' => [
+ 'driver' => 'local',
+ 'root' => storage_path('app'),
+ ],
+
+ 's3' => [
+ 'driver' => 's3',
+ 'key' => env('S3_KEY'),
+ 'secret' => env('S3_SECRET'),
+ 'region' => env('S3_REGION'),
+ 'bucket' => env('S3_BUCKET'),
+ 'base_url' => env('S3_URL'),
+ ],
+
+ 'rackspace' => [
+ 'driver' => 'rackspace',
+ 'username' => env('RACKSPACE_USERNAME'),
+ 'key' => env('RACKSPACE_KEY'),
+ 'container' => env('RACKSPACE_CONTAINER'),
+ 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
+ 'region' => env('RACKSPACE_REGION'),
+ 'url_type' => 'publicURL',
+ ],
+
+ ],
+
+];
diff --git a/vendor/laravel/lumen-framework/config/mail.php b/vendor/laravel/lumen-framework/config/mail.php
new file mode 100644
index 00000000..1dd5d9f0
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/mail.php
@@ -0,0 +1,124 @@
+ env('MAIL_DRIVER', 'smtp'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | SMTP Host Address
+ |--------------------------------------------------------------------------
+ |
+ | Here you may provide the host address of the SMTP server used by your
+ | applications. A default option is provided that is compatible with
+ | the Mailgun mail service which will provide reliable deliveries.
+ |
+ */
+
+ 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | SMTP Host Port
+ |--------------------------------------------------------------------------
+ |
+ | This is the SMTP port used by your application to deliver e-mails to
+ | users of the application. Like the host we have set this value to
+ | stay compatible with the Mailgun e-mail application by default.
+ |
+ */
+
+ 'port' => env('MAIL_PORT', 587),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Global "From" Address
+ |--------------------------------------------------------------------------
+ |
+ | You may wish for all e-mails sent by your application to be sent from
+ | the same address. Here, you may specify a name and address that is
+ | used globally for all e-mails that are sent by your application.
+ |
+ */
+
+ 'from' => ['address' => env('MAIL_FROM_ADDRESS'), 'name' => env('MAIL_FROM_NAME')],
+
+ /*
+ |--------------------------------------------------------------------------
+ | E-Mail Encryption Protocol
+ |--------------------------------------------------------------------------
+ |
+ | Here you may specify the encryption protocol that should be used when
+ | the application send e-mail messages. A sensible default using the
+ | transport layer security protocol should provide great security.
+ |
+ */
+
+ 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | SMTP Server Username
+ |--------------------------------------------------------------------------
+ |
+ | If your SMTP server requires a username for authentication, you should
+ | set it here. This will get used to authenticate with your server on
+ | connection. You may also set the "password" value below this one.
+ |
+ */
+
+ 'username' => env('MAIL_USERNAME'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | SMTP Server Password
+ |--------------------------------------------------------------------------
+ |
+ | Here you may set the password required by your SMTP server to send out
+ | messages from your application. This will be given to the server on
+ | connection so that the application will be able to send messages.
+ |
+ */
+
+ 'password' => env('MAIL_PASSWORD'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Sendmail System Path
+ |--------------------------------------------------------------------------
+ |
+ | When using the "sendmail" driver to send e-mails, we will need to know
+ | the path to where Sendmail lives on this server. A default path has
+ | been provided here, which will work well on most of your systems.
+ |
+ */
+
+ 'sendmail' => '/usr/sbin/sendmail -bs',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Mail "Pretend"
+ |--------------------------------------------------------------------------
+ |
+ | When this option is enabled, e-mail will not actually be sent over the
+ | web and will instead be written to your application's logs files so
+ | you may inspect the message. This is great for local development.
+ |
+ */
+
+ 'pretend' => false,
+
+];
diff --git a/vendor/laravel/lumen-framework/config/queue.php b/vendor/laravel/lumen-framework/config/queue.php
new file mode 100644
index 00000000..a74cd447
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/queue.php
@@ -0,0 +1,93 @@
+ env('QUEUE_DRIVER', 'sync'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Queue Connections
+ |--------------------------------------------------------------------------
+ |
+ | Here you may configure the connection information for each server that
+ | is used by your application. A default configuration has been added
+ | for each back-end shipped with Laravel. You are free to add more.
+ |
+ */
+
+ 'connections' => [
+
+ 'sync' => [
+ 'driver' => 'sync',
+ ],
+
+ 'database' => [
+ 'driver' => 'database',
+ 'table' => 'jobs',
+ 'queue' => 'default',
+ 'expire' => 60,
+ ],
+
+ 'beanstalkd' => [
+ 'driver' => 'beanstalkd',
+ 'host' => 'localhost',
+ 'queue' => 'default',
+ 'ttr' => 60,
+ ],
+
+ 'sqs' => [
+ 'driver' => 'sqs',
+ 'key' => 'your-public-key',
+ 'secret' => 'your-secret-key',
+ 'queue' => 'your-queue-url',
+ 'region' => 'us-east-1',
+ ],
+
+ 'iron' => [
+ 'driver' => 'iron',
+ 'host' => 'mq-aws-us-east-1.iron.io',
+ 'token' => 'your-token',
+ 'project' => 'your-project-id',
+ 'queue' => 'your-queue-name',
+ 'encrypt' => true,
+ ],
+
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ 'queue' => 'default',
+ 'expire' => 60,
+ ],
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Failed Queue Jobs
+ |--------------------------------------------------------------------------
+ |
+ | These options configure the behavior of failed queue job logging so you
+ | can control which database and table are used to store the jobs that
+ | have failed. You may change them to any database / table you wish.
+ |
+ */
+
+ 'failed' => [
+ 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs',
+ ],
+
+];
diff --git a/vendor/laravel/lumen-framework/config/session.php b/vendor/laravel/lumen-framework/config/session.php
new file mode 100644
index 00000000..e7147427
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/session.php
@@ -0,0 +1,153 @@
+ env('SESSION_DRIVER', 'memcached'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Lifetime
+ |--------------------------------------------------------------------------
+ |
+ | Here you may specify the number of minutes that you wish the session
+ | to be allowed to remain idle before it expires. If you want them
+ | to immediately expire on the browser closing, set that option.
+ |
+ */
+
+ 'lifetime' => env('SESSION_LIFETIME', 120),
+
+ 'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Encryption
+ |--------------------------------------------------------------------------
+ |
+ | This option allows you to easily specify that all of your session data
+ | should be encrypted before it is stored. All encryption will be run
+ | automatically by Laravel and you can use the Session like normal.
+ |
+ */
+
+ 'encrypt' => false,
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session File Location
+ |--------------------------------------------------------------------------
+ |
+ | When using the native session driver, we need a location where session
+ | files may be stored. A default has been set for you but a different
+ | location may be specified. This is only needed for file sessions.
+ |
+ */
+
+ 'files' => storage_path('framework/sessions'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Database Connection
+ |--------------------------------------------------------------------------
+ |
+ | When using the "database" or "redis" session drivers, you may specify a
+ | connection that should be used to manage these sessions. This should
+ | correspond to a connection in your database configuration options.
+ |
+ */
+
+ 'connection' => env('SESSION_DATABASE_CONNECTION'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Database Table
+ |--------------------------------------------------------------------------
+ |
+ | When using the "database" session driver, you may specify the table we
+ | should use to manage the sessions. Of course, a sensible default is
+ | provided for you; however, you are free to change this as needed.
+ |
+ */
+
+ 'table' => env('SESSION_DATABASE_TABLE', 'sessions'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Sweeping Lottery
+ |--------------------------------------------------------------------------
+ |
+ | Some session drivers must manually sweep their storage location to get
+ | rid of old sessions from storage. Here are the chances that it will
+ | happen on a given request. By default, the odds are 2 out of 100.
+ |
+ */
+
+ 'lottery' => [2, 100],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Cookie Name
+ |--------------------------------------------------------------------------
+ |
+ | Here you may change the name of the cookie used to identify a session
+ | instance by ID. The name specified here will get used every time a
+ | new session cookie is created by the framework for every driver.
+ |
+ */
+
+ 'cookie' => 'laravel_session',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Cookie Path
+ |--------------------------------------------------------------------------
+ |
+ | The session cookie path determines the path for which the cookie will
+ | be regarded as available. Typically, this will be the root path of
+ | your application but you are free to change this when necessary.
+ |
+ */
+
+ 'path' => '/',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Cookie Domain
+ |--------------------------------------------------------------------------
+ |
+ | Here you may change the domain of the cookie used to identify a session
+ | in your application. This will determine which domains the cookie is
+ | available to in your application. A sensible default has been set.
+ |
+ */
+
+ 'domain' => null,
+
+ /*
+ |--------------------------------------------------------------------------
+ | HTTPS Only Cookies
+ |--------------------------------------------------------------------------
+ |
+ | By setting this option to true, session cookies will only be sent back
+ | to the server if the browser has a HTTPS connection. This will keep
+ | the cookie from being sent to you if it can not be done securely.
+ |
+ */
+
+ 'secure' => false,
+
+];
diff --git a/vendor/laravel/lumen-framework/config/view.php b/vendor/laravel/lumen-framework/config/view.php
new file mode 100644
index 00000000..e193ab61
--- /dev/null
+++ b/vendor/laravel/lumen-framework/config/view.php
@@ -0,0 +1,33 @@
+ [
+ realpath(base_path('resources/views')),
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Compiled View Path
+ |--------------------------------------------------------------------------
+ |
+ | This option determines where all the compiled Blade templates will be
+ | stored for your application. Typically, this is within the storage
+ | directory. However, as usual, you are free to change this value.
+ |
+ */
+
+ 'compiled' => realpath(storage_path('framework/views')),
+
+];
diff --git a/vendor/laravel/lumen-framework/lang/en/validation.php b/vendor/laravel/lumen-framework/lang/en/validation.php
new file mode 100644
index 00000000..ff1c0877
--- /dev/null
+++ b/vendor/laravel/lumen-framework/lang/en/validation.php
@@ -0,0 +1,107 @@
+ 'The :attribute must be accepted.',
+ 'active_url' => 'The :attribute is not a valid URL.',
+ 'after' => 'The :attribute must be a date after :date.',
+ 'alpha' => 'The :attribute may only contain letters.',
+ 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',
+ 'alpha_num' => 'The :attribute may only contain letters and numbers.',
+ 'array' => 'The :attribute must be an array.',
+ 'before' => 'The :attribute must be a date before :date.',
+ 'between' => [
+ 'numeric' => 'The :attribute must be between :min and :max.',
+ 'file' => 'The :attribute must be between :min and :max kilobytes.',
+ 'string' => 'The :attribute must be between :min and :max characters.',
+ 'array' => 'The :attribute must have between :min and :max items.',
+ ],
+ 'boolean' => 'The :attribute field must be true or false.',
+ 'confirmed' => 'The :attribute confirmation does not match.',
+ 'date' => 'The :attribute is not a valid date.',
+ 'date_format' => 'The :attribute does not match the format :format.',
+ 'different' => 'The :attribute and :other must be different.',
+ 'digits' => 'The :attribute must be :digits digits.',
+ 'digits_between' => 'The :attribute must be between :min and :max digits.',
+ 'email' => 'The :attribute must be a valid email address.',
+ 'filled' => 'The :attribute field is required.',
+ 'exists' => 'The selected :attribute is invalid.',
+ 'image' => 'The :attribute must be an image.',
+ 'in' => 'The selected :attribute is invalid.',
+ 'integer' => 'The :attribute must be an integer.',
+ 'ip' => 'The :attribute must be a valid IP address.',
+ 'max' => [
+ 'numeric' => 'The :attribute may not be greater than :max.',
+ 'file' => 'The :attribute may not be greater than :max kilobytes.',
+ 'string' => 'The :attribute may not be greater than :max characters.',
+ 'array' => 'The :attribute may not have more than :max items.',
+ ],
+ 'mimes' => 'The :attribute must be a file of type: :values.',
+ 'min' => [
+ 'numeric' => 'The :attribute must be at least :min.',
+ 'file' => 'The :attribute must be at least :min kilobytes.',
+ 'string' => 'The :attribute must be at least :min characters.',
+ 'array' => 'The :attribute must have at least :min items.',
+ ],
+ 'not_in' => 'The selected :attribute is invalid.',
+ 'numeric' => 'The :attribute must be a number.',
+ 'regex' => 'The :attribute format is invalid.',
+ 'required' => 'The :attribute field is required.',
+ 'required_if' => 'The :attribute field is required when :other is :value.',
+ 'required_with' => 'The :attribute field is required when :values is present.',
+ 'required_with_all' => 'The :attribute field is required when :values is present.',
+ 'required_without' => 'The :attribute field is required when :values is not present.',
+ 'required_without_all' => 'The :attribute field is required when none of :values are present.',
+ 'same' => 'The :attribute and :other must match.',
+ 'size' => [
+ 'numeric' => 'The :attribute must be :size.',
+ 'file' => 'The :attribute must be :size kilobytes.',
+ 'string' => 'The :attribute must be :size characters.',
+ 'array' => 'The :attribute must contain :size items.',
+ ],
+ 'unique' => 'The :attribute has already been taken.',
+ 'url' => 'The :attribute format is invalid.',
+ 'timezone' => 'The :attribute must be a valid zone.',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Custom Validation Language Lines
+ |--------------------------------------------------------------------------
+ |
+ | Here you may specify custom validation messages for attributes using the
+ | convention "attribute.rule" to name the lines. This makes it quick to
+ | specify a specific custom language line for a given attribute rule.
+ |
+ */
+
+ 'custom' => [
+ 'attribute-name' => [
+ 'rule-name' => 'custom-message',
+ ],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Custom Validation Attributes
+ |--------------------------------------------------------------------------
+ |
+ | The following language lines are used to swap attribute place-holders
+ | with something more reader friendly such as E-Mail Address instead
+ | of "email". This simply helps us make messages a little cleaner.
+ |
+ */
+
+ 'attributes' => [],
+
+];
diff --git a/vendor/laravel/lumen-framework/phpunit.php b/vendor/laravel/lumen-framework/phpunit.php
new file mode 100644
index 00000000..7e0cfdd0
--- /dev/null
+++ b/vendor/laravel/lumen-framework/phpunit.php
@@ -0,0 +1,30 @@
+
+
+
+
+ ./tests
+
+
+
+
+ ./src
+
+
+
diff --git a/vendor/laravel/lumen-framework/readme.md b/vendor/laravel/lumen-framework/readme.md
new file mode 100644
index 00000000..c2c286e7
--- /dev/null
+++ b/vendor/laravel/lumen-framework/readme.md
@@ -0,0 +1,25 @@
+## Lumen Framework (Kernel)
+
+[](https://travis-ci.org/laravel/lumen-framework)
+[](https://packagist.org/packages/laravel/lumen-framework)
+[](https://packagist.org/packages/laravel/lumen-framework)
+[](https://packagist.org/packages/laravel/lumen-framework)
+[](https://packagist.org/packages/laravel/lumen-framework)
+
+> **Note:** This repository contains the core code of the Laravel Lumen framework. If you want to build an application using Laravel Lumen, visit the main [Lumen repository](https://github.com/laravel/lumen).
+
+## Lumen PHP Framework
+
+Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.
+
+## Official Documentation
+
+Documentation for the framework can be found on the [Lumen website](http://lumen.laravel.com/docs).
+
+## Security Vulnerabilities
+
+If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.
+
+### License
+
+The Lumen framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
diff --git a/vendor/laravel/lumen-framework/src/Application.php b/vendor/laravel/lumen-framework/src/Application.php
new file mode 100644
index 00000000..1a33ade9
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Application.php
@@ -0,0 +1,1819 @@
+basePath = $basePath;
+ $this->bootstrapContainer();
+ $this->registerErrorHandling();
+ }
+
+ /**
+ * Bootstrap the application container.
+ *
+ * @return void
+ */
+ protected function bootstrapContainer()
+ {
+ static::setInstance($this);
+
+ $this->instance('app', $this);
+ $this->instance('path', $this->path());
+
+ $this->registerContainerAliases();
+ }
+
+ /**
+ * Get the version number of the application.
+ *
+ * @return string
+ */
+ public function version()
+ {
+ return 'Lumen (5.1.6) (Laravel Components 5.1.*)';
+ }
+
+ /**
+ * Get or check the current application environment.
+ *
+ * @param mixed
+ * @return string
+ */
+ public function environment()
+ {
+ $env = env('APP_ENV', 'production');
+
+ if (func_num_args() > 0) {
+ $patterns = is_array(func_get_arg(0)) ? func_get_arg(0) : func_get_args();
+
+ foreach ($patterns as $pattern) {
+ if (Str::is($pattern, $env)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ return $env;
+ }
+
+ /**
+ * Determine if the application is currently down for maintenance.
+ *
+ * @return bool
+ */
+ public function isDownForMaintenance()
+ {
+ return file_exists($this->storagePath().'/framework/down');
+ }
+
+ /**
+ * Register all of the configured providers.
+ *
+ * @return void
+ */
+ public function registerConfiguredProviders()
+ {
+ //
+ }
+
+ /**
+ * Get the path to the cached "compiled.php" file.
+ *
+ * @return string
+ */
+ public function getCachedCompilePath()
+ {
+ throw new Exception(__FUNCTION__.' is not implemented by Lumen.');
+ }
+
+ /**
+ * Get the path to the cached services.json file.
+ *
+ * @return string
+ */
+ public function getCachedServicesPath()
+ {
+ throw new Exception(__FUNCTION__.' is not implemented by Lumen.');
+ }
+
+ /**
+ * Register a service provider with the application.
+ *
+ * @param \Illuminate\Support\ServiceProvider|string $provider
+ * @param array $options
+ * @param bool $force
+ * @return \Illuminate\Support\ServiceProvider
+ */
+ public function register($provider, $options = [], $force = false)
+ {
+ if (! $provider instanceof ServiceProvider) {
+ $provider = new $provider($this);
+ }
+
+ if (array_key_exists($providerName = get_class($provider), $this->loadedProviders)) {
+ return;
+ }
+
+ $this->loadedProviders[$providerName] = true;
+
+ $provider->register();
+ $provider->boot();
+ }
+
+ /**
+ * Register a deferred provider and service.
+ *
+ * @param string $provider
+ * @param string|null $service
+ * @return void
+ */
+ public function registerDeferredProvider($provider, $service = null)
+ {
+ return $this->register($provider);
+ }
+
+ /**
+ * Boot the application's service providers.
+ *
+ * @return void
+ */
+ public function boot()
+ {
+ //
+ }
+
+ /**
+ * Register a new boot listener.
+ *
+ * @param mixed $callback
+ * @return void
+ */
+ public function booting($callback)
+ {
+ //
+ }
+
+ /**
+ * Register a new "booted" listener.
+ *
+ * @param mixed $callback
+ * @return void
+ */
+ public function booted($callback)
+ {
+ //
+ }
+
+ /**
+ * Set the error handling for the application.
+ *
+ * @return void
+ */
+ protected function registerErrorHandling()
+ {
+ error_reporting(-1);
+
+ set_error_handler(function ($level, $message, $file = '', $line = 0) {
+ if (error_reporting() & $level) {
+ throw new ErrorException($message, 0, $level, $file, $line);
+ }
+ });
+
+ set_exception_handler(function ($e) {
+ $this->handleUncaughtException($e);
+ });
+
+ register_shutdown_function(function () {
+ if (! is_null($error = error_get_last()) && $this->isFatalError($error['type'])) {
+ $this->handleUncaughtException(new FatalErrorException(
+ $error['message'], $error['type'], 0, $error['file'], $error['line']
+ ));
+ }
+ });
+ }
+
+ /**
+ * Determine if the error type is fatal.
+ *
+ * @param int $type
+ * @return bool
+ */
+ protected function isFatalError($type)
+ {
+ $errorCodes = [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE];
+
+ if (defined('FATAL_ERROR')) {
+ $errorCodes[] = FATAL_ERROR;
+ }
+
+ return in_array($type, $errorCodes);
+ }
+
+ /**
+ * Send the exception to the handler and return the response.
+ *
+ * @param \Throwable $e
+ * @return Response
+ */
+ protected function sendExceptionToHandler($e)
+ {
+ $handler = $this->make('Illuminate\Contracts\Debug\ExceptionHandler');
+
+ if ($e instanceof Error) {
+ $e = new FatalThrowableError($e);
+ }
+
+ $handler->report($e);
+
+ return $handler->render($this->make('request'), $e);
+ }
+
+ /**
+ * Handle an uncaught exception instance.
+ *
+ * @param \Throwable $e
+ * @return void
+ */
+ protected function handleUncaughtException($e)
+ {
+ $handler = $this->make('Illuminate\Contracts\Debug\ExceptionHandler');
+
+ if ($e instanceof Error) {
+ $e = new FatalThrowableError($e);
+ }
+
+ $handler->report($e);
+
+ if ($this->runningInConsole()) {
+ $handler->renderForConsole(new ConsoleOutput, $e);
+ } else {
+ $handler->render($this->make('request'), $e)->send();
+ }
+ }
+
+ /**
+ * Throw an HttpException with the given data.
+ *
+ * @param int $code
+ * @param string $message
+ * @param array $headers
+ * @return void
+ *
+ * @throws \Symfony\Component\HttpKernel\Exception\HttpException
+ */
+ public function abort($code, $message = '', array $headers = [])
+ {
+ if ($code == 404) {
+ throw new NotFoundHttpException($message);
+ }
+
+ throw new HttpException($code, $message, null, $headers);
+ }
+
+ /**
+ * Resolve the given type from the container.
+ *
+ * @param string $abstract
+ * @param array $parameters
+ * @return mixed
+ */
+ public function make($abstract, array $parameters = [])
+ {
+ if (array_key_exists($abstract, $this->availableBindings) &&
+ ! array_key_exists($this->availableBindings[$abstract], $this->ranServiceBinders)) {
+ $this->{$method = $this->availableBindings[$abstract]}();
+
+ $this->ranServiceBinders[$method] = true;
+ }
+
+ return parent::make($abstract, $parameters);
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerAuthBindings()
+ {
+ $this->singleton('auth', function () {
+ return $this->loadComponent('auth', 'Illuminate\Auth\AuthServiceProvider', 'auth');
+ });
+
+ $this->singleton('auth.driver', function () {
+ return $this->loadComponent('auth', 'Illuminate\Auth\AuthServiceProvider', 'auth.driver');
+ });
+
+ $this->singleton('auth.password', function () {
+ return $this->loadComponent('auth', 'Illuminate\Auth\Passwords\PasswordResetServiceProvider', 'auth.password');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerBroadcastingBindings()
+ {
+ $this->singleton('Illuminate\Contracts\Broadcasting\Broadcaster', function () {
+ $this->configure('broadcasting');
+
+ $this->register('Illuminate\Broadcasting\BroadcastServiceProvider');
+
+ return $this->make('Illuminate\Contracts\Broadcasting\Broadcaster');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerBusBindings()
+ {
+ $this->singleton('Illuminate\Contracts\Bus\Dispatcher', function () {
+ $this->register('Illuminate\Bus\BusServiceProvider');
+
+ return $this->make('Illuminate\Contracts\Bus\Dispatcher');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerCacheBindings()
+ {
+ $this->singleton('cache', function () {
+ return $this->loadComponent('cache', 'Illuminate\Cache\CacheServiceProvider');
+ });
+
+ $this->singleton('cache.store', function () {
+ return $this->loadComponent('cache', 'Illuminate\Cache\CacheServiceProvider', 'cache.store');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerConfigBindings()
+ {
+ $this->singleton('config', function () {
+ return new ConfigRepository;
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerComposerBindings()
+ {
+ $this->singleton('composer', function ($app) {
+ return new Composer($app->make('files'), $this->basePath());
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerCookieBindings()
+ {
+ $this->singleton('cookie', function () {
+ return $this->loadComponent('session', 'Illuminate\Cookie\CookieServiceProvider', 'cookie');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerDatabaseBindings()
+ {
+ $this->singleton('db', function () {
+ return $this->loadComponent(
+ 'database', [
+ 'Illuminate\Database\DatabaseServiceProvider',
+ 'Illuminate\Pagination\PaginationServiceProvider', ],
+ 'db'
+ );
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerEncrypterBindings()
+ {
+ $this->singleton('encrypter', function () {
+ return $this->loadComponent('app', 'Illuminate\Encryption\EncryptionServiceProvider', 'encrypter');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerEventBindings()
+ {
+ $this->singleton('events', function () {
+ $this->register('Illuminate\Events\EventServiceProvider');
+
+ return $this->make('events');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerErrorBindings()
+ {
+ if (! $this->bound('Illuminate\Contracts\Debug\ExceptionHandler')) {
+ $this->singleton(
+ 'Illuminate\Contracts\Debug\ExceptionHandler', 'Laravel\Lumen\Exceptions\Handler'
+ );
+ }
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerFilesBindings()
+ {
+ $this->singleton('files', function () {
+ return new Filesystem;
+ });
+
+ $this->singleton('filesystem', function () {
+ return $this->loadComponent('filesystems', 'Illuminate\Filesystem\FilesystemServiceProvider', 'filesystem');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerHashBindings()
+ {
+ $this->singleton('hash', function () {
+ $this->register('Illuminate\Hashing\HashServiceProvider');
+
+ return $this->make('hash');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerLogBindings()
+ {
+ $this->singleton('Psr\Log\LoggerInterface', function () {
+ return new Logger('lumen', [$this->getMonologHandler()]);
+ });
+ }
+
+ /**
+ * Get the Monolog handler for the application.
+ *
+ * @return \Monolog\Handler\AbstractHandler
+ */
+ protected function getMonologHandler()
+ {
+ return (new StreamHandler(storage_path('logs/lumen.log'), Logger::DEBUG))
+ ->setFormatter(new LineFormatter(null, null, true, true));
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerMailBindings()
+ {
+ $this->singleton('mailer', function () {
+ $this->configure('services');
+
+ return $this->loadComponent('mail', 'Illuminate\Mail\MailServiceProvider', 'mailer');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerQueueBindings()
+ {
+ $this->singleton('queue', function () {
+ return $this->loadComponent('queue', 'Illuminate\Queue\QueueServiceProvider', 'queue');
+ });
+
+ $this->singleton('queue.connection', function () {
+ return $this->loadComponent('queue', 'Illuminate\Queue\QueueServiceProvider', 'queue.connection');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerRedisBindings()
+ {
+ $this->singleton('redis', function () {
+ return $this->loadComponent('database', 'Illuminate\Redis\RedisServiceProvider', 'redis');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerRequestBindings()
+ {
+ $this->singleton('Illuminate\Http\Request', function () {
+ return Request::capture()->setUserResolver(function () {
+ return $this->make('auth')->user();
+ })->setRouteResolver(function () {
+ return $this->currentRoute;
+ });
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerSessionBindings()
+ {
+ $this->singleton('session', function () {
+ return $this->loadComponent('session', 'Illuminate\Session\SessionServiceProvider');
+ });
+
+ $this->singleton('session.store', function () {
+ return $this->loadComponent('session', 'Illuminate\Session\SessionServiceProvider', 'session.store');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerTranslationBindings()
+ {
+ $this->singleton('translator', function () {
+ $this->configure('app');
+
+ $this->instance('path.lang', $this->getLanguagePath());
+
+ $this->register('Illuminate\Translation\TranslationServiceProvider');
+
+ return $this->make('translator');
+ });
+ }
+
+ /**
+ * Get the path to the application's language files.
+ *
+ * @return string
+ */
+ protected function getLanguagePath()
+ {
+ if (is_dir($appPath = $this->resourcePath('lang'))) {
+ return $appPath;
+ } else {
+ return __DIR__.'/../lang';
+ }
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerUrlGeneratorBindings()
+ {
+ $this->singleton('url', function () {
+ return new Routing\UrlGenerator($this);
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerValidatorBindings()
+ {
+ $this->singleton('validator', function () {
+ $this->register('Illuminate\Validation\ValidationServiceProvider');
+
+ return $this->make('validator');
+ });
+ }
+
+ /**
+ * Register container bindings for the application.
+ *
+ * @return void
+ */
+ protected function registerViewBindings()
+ {
+ $this->singleton('view', function () {
+ return $this->loadComponent('view', 'Illuminate\View\ViewServiceProvider');
+ });
+ }
+
+ /**
+ * Configure and load the given component and provider.
+ *
+ * @param string $config
+ * @param array|string $providers
+ * @param string|null $return
+ * @return mixed
+ */
+ protected function loadComponent($config, $providers, $return = null)
+ {
+ $this->configure($config);
+
+ foreach ((array) $providers as $provider) {
+ $this->register($provider);
+ }
+
+ return $this->make($return ?: $config);
+ }
+
+ /**
+ * Load a configuration file into the application.
+ *
+ * @param string $name
+ * @return void
+ */
+ public function configure($name)
+ {
+ if (isset($this->loadedConfigurations[$name])) {
+ return;
+ }
+
+ $this->loadedConfigurations[$name] = true;
+
+ $path = $this->getConfigurationPath($name);
+
+ if ($path) {
+ $this->make('config')->set($name, require $path);
+ }
+ }
+
+ /**
+ * Get the path to the given configuration file.
+ *
+ * If no name is provided, then we'll return the path to the config folder.
+ *
+ * @param string|null $name
+ * @return string
+ */
+ public function getConfigurationPath($name = null)
+ {
+ if (! $name) {
+ $appConfigDir = ($this->configPath ?: $this->basePath('config')).'/';
+
+ if (file_exists($appConfigDir)) {
+ return $appConfigDir;
+ } elseif (file_exists($path = __DIR__.'/../config/')) {
+ return $path;
+ }
+ } else {
+ $appConfigPath = ($this->configPath ?: $this->basePath('config')).'/'.$name.'.php';
+
+ if (file_exists($appConfigPath)) {
+ return $appConfigPath;
+ } elseif (file_exists($path = __DIR__.'/../config/'.$name.'.php')) {
+ return $path;
+ }
+ }
+ }
+
+ /**
+ * Register the facades for the application.
+ *
+ * @return void
+ */
+ public function withFacades()
+ {
+ Facade::setFacadeApplication($this);
+
+ if (! static::$aliasesRegistered) {
+ static::$aliasesRegistered = true;
+
+ class_alias('Illuminate\Support\Facades\App', 'App');
+ class_alias('Illuminate\Support\Facades\Auth', 'Auth');
+ class_alias('Illuminate\Support\Facades\Bus', 'Bus');
+ class_alias('Illuminate\Support\Facades\DB', 'DB');
+ class_alias('Illuminate\Support\Facades\Cache', 'Cache');
+ class_alias('Illuminate\Support\Facades\Cookie', 'Cookie');
+ class_alias('Illuminate\Support\Facades\Crypt', 'Crypt');
+ class_alias('Illuminate\Support\Facades\Event', 'Event');
+ class_alias('Illuminate\Support\Facades\Hash', 'Hash');
+ class_alias('Illuminate\Support\Facades\Log', 'Log');
+ class_alias('Illuminate\Support\Facades\Mail', 'Mail');
+ class_alias('Illuminate\Support\Facades\Queue', 'Queue');
+ class_alias('Illuminate\Support\Facades\Request', 'Request');
+ class_alias('Illuminate\Support\Facades\Schema', 'Schema');
+ class_alias('Illuminate\Support\Facades\Session', 'Session');
+ class_alias('Illuminate\Support\Facades\Storage', 'Storage');
+ class_alias('Illuminate\Support\Facades\Validator', 'Validator');
+ }
+ }
+
+ /**
+ * Load the Eloquent library for the application.
+ *
+ * @return void
+ */
+ public function withEloquent()
+ {
+ $this->make('db');
+ }
+
+ /**
+ * Register a set of routes with a set of shared attributes.
+ *
+ * @param array $attributes
+ * @param \Closure $callback
+ * @return void
+ */
+ public function group(array $attributes, Closure $callback)
+ {
+ $parentGroupAttributes = $this->groupAttributes;
+
+ $this->groupAttributes = $attributes;
+
+ call_user_func($callback, $this);
+
+ $this->groupAttributes = $parentGroupAttributes;
+ }
+
+ /**
+ * Register a route with the application.
+ *
+ * @param string $uri
+ * @param mixed $action
+ * @return $this
+ */
+ public function get($uri, $action)
+ {
+ $this->addRoute('GET', $uri, $action);
+
+ return $this;
+ }
+
+ /**
+ * Register a route with the application.
+ *
+ * @param string $uri
+ * @param mixed $action
+ * @return $this
+ */
+ public function post($uri, $action)
+ {
+ $this->addRoute('POST', $uri, $action);
+
+ return $this;
+ }
+
+ /**
+ * Register a route with the application.
+ *
+ * @param string $uri
+ * @param mixed $action
+ * @return $this
+ */
+ public function put($uri, $action)
+ {
+ $this->addRoute('PUT', $uri, $action);
+
+ return $this;
+ }
+
+ /**
+ * Register a route with the application.
+ *
+ * @param string $uri
+ * @param mixed $action
+ * @return $this
+ */
+ public function patch($uri, $action)
+ {
+ $this->addRoute('PATCH', $uri, $action);
+
+ return $this;
+ }
+
+ /**
+ * Register a route with the application.
+ *
+ * @param string $uri
+ * @param mixed $action
+ * @return $this
+ */
+ public function delete($uri, $action)
+ {
+ $this->addRoute('DELETE', $uri, $action);
+
+ return $this;
+ }
+
+ /**
+ * Register a route with the application.
+ *
+ * @param string $uri
+ * @param mixed $action
+ * @return $this
+ */
+ public function options($uri, $action)
+ {
+ $this->addRoute('OPTIONS', $uri, $action);
+
+ return $this;
+ }
+
+ /**
+ * Add a route to the collection.
+ *
+ * @param string $method
+ * @param string $uri
+ * @param mixed $action
+ */
+ public function addRoute($method, $uri, $action)
+ {
+ $action = $this->parseAction($action);
+
+ if (isset($this->groupAttributes)) {
+ if (isset($this->groupAttributes['prefix'])) {
+ $uri = trim($this->groupAttributes['prefix'], '/').'/'.trim($uri, '/');
+ }
+
+ $action = $this->mergeGroupAttributes($action);
+ }
+
+ $uri = '/'.trim($uri, '/');
+
+ if (isset($action['as'])) {
+ $this->namedRoutes[$action['as']] = $uri;
+ }
+
+ $this->routes[$method.$uri] = ['method' => $method, 'uri' => $uri, 'action' => $action];
+ }
+
+ /**
+ * Parse the action into an array format.
+ *
+ * @param mixed $action
+ * @return array
+ */
+ protected function parseAction($action)
+ {
+ if (is_string($action)) {
+ return ['uses' => $action];
+ } elseif (! is_array($action)) {
+ return [$action];
+ }
+
+ return $action;
+ }
+
+ /**
+ * Merge the group attributes into the action.
+ *
+ * @param array $action
+ * @return array
+ */
+ protected function mergeGroupAttributes(array $action)
+ {
+ return $this->mergeNamespaceGroup(
+ $this->mergeMiddlewareGroup($action)
+ );
+ }
+
+ /**
+ * Merge the namespace group into the action.
+ *
+ * @param array $action
+ * @return array
+ */
+ protected function mergeNamespaceGroup(array $action)
+ {
+ if (isset($this->groupAttributes['namespace']) && isset($action['uses'])) {
+ $action['uses'] = $this->groupAttributes['namespace'].'\\'.$action['uses'];
+ }
+
+ return $action;
+ }
+
+ /**
+ * Merge the middleware group into the action.
+ *
+ * @param array $action
+ * @return array
+ */
+ protected function mergeMiddlewareGroup($action)
+ {
+ if (isset($this->groupAttributes['middleware'])) {
+ if (isset($action['middleware'])) {
+ $action['middleware'] = $this->groupAttributes['middleware'].'|'.$action['middleware'];
+ } else {
+ $action['middleware'] = $this->groupAttributes['middleware'];
+ }
+ }
+
+ return $action;
+ }
+
+ /**
+ * Add new middleware to the application.
+ *
+ * @param array $middleware
+ * @return $this
+ */
+ public function middleware(array $middleware)
+ {
+ $this->middleware = array_unique(array_merge($this->middleware, $middleware));
+
+ return $this;
+ }
+
+ /**
+ * Define the route middleware for the application.
+ *
+ * @param array $middleware
+ * @return $this
+ */
+ public function routeMiddleware(array $middleware)
+ {
+ $this->routeMiddleware = array_merge($this->routeMiddleware, $middleware);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+ {
+ return $this->dispatch($request);
+ }
+
+ /**
+ * Run the application and send the response.
+ *
+ * @param SymfonyRequest|null $request
+ * @return void
+ */
+ public function run($request = null)
+ {
+ $response = $this->dispatch($request);
+
+ if ($response instanceof SymfonyResponse) {
+ $response->send();
+ } else {
+ echo (string) $response;
+ }
+
+ if (count($this->middleware) > 0) {
+ $this->callTerminableMiddleware($response);
+ }
+ }
+
+ /**
+ * Call the terminable middleware.
+ *
+ * @param mixed $response
+ * @return void
+ */
+ protected function callTerminableMiddleware($response)
+ {
+ $response = $this->prepareResponse($response);
+
+ foreach ($this->middleware as $middleware) {
+ $instance = $this->make($middleware);
+
+ if (method_exists($instance, 'terminate')) {
+ $instance->terminate($this->make('request'), $response);
+ }
+ }
+ }
+
+ /**
+ * Dispatch the incoming request.
+ *
+ * @param SymfonyRequest|null $request
+ * @return Response
+ */
+ public function dispatch($request = null)
+ {
+ if ($request) {
+ $this->instance('Illuminate\Http\Request', $request);
+ $this->ranServiceBinders['registerRequestBindings'] = true;
+
+ $method = $request->getMethod();
+ $pathInfo = $request->getPathInfo();
+ } else {
+ $method = $this->getMethod();
+ $pathInfo = $this->getPathInfo();
+ }
+
+ try {
+ return $this->sendThroughPipeline($this->middleware, function () use ($method, $pathInfo) {
+ if (isset($this->routes[$method.$pathInfo])) {
+ return $this->handleFoundRoute([true, $this->routes[$method.$pathInfo]['action'], []]);
+ }
+
+ return $this->handleDispatcherResponse(
+ $this->createDispatcher()->dispatch($method, $pathInfo)
+ );
+ });
+ } catch (Exception $e) {
+ return $this->sendExceptionToHandler($e);
+ } catch (Throwable $e) {
+ return $this->sendExceptionToHandler($e);
+ }
+ }
+
+ /**
+ * Create a FastRoute dispatcher instance for the application.
+ *
+ * @return Dispatcher
+ */
+ protected function createDispatcher()
+ {
+ return $this->dispatcher ?: \FastRoute\simpleDispatcher(function ($r) {
+ foreach ($this->routes as $route) {
+ $r->addRoute($route['method'], $route['uri'], $route['action']);
+ }
+ });
+ }
+
+ /**
+ * Set the FastRoute dispatcher instance.
+ *
+ * @param \FastRoute\Dispatcher $dispatcher
+ * @return void
+ */
+ public function setDispatcher(Dispatcher $dispatcher)
+ {
+ $this->dispatcher = $dispatcher;
+ }
+
+ /**
+ * Handle the response from the FastRoute dispatcher.
+ *
+ * @param array $routeInfo
+ * @return mixed
+ */
+ protected function handleDispatcherResponse($routeInfo)
+ {
+ switch ($routeInfo[0]) {
+ case Dispatcher::NOT_FOUND:
+ throw new NotFoundHttpException;
+
+ case Dispatcher::METHOD_NOT_ALLOWED:
+ throw new MethodNotAllowedHttpException($routeInfo[1]);
+
+ case Dispatcher::FOUND:
+ return $this->handleFoundRoute($routeInfo);
+ }
+ }
+
+ /**
+ * Handle a route found by the dispatcher.
+ *
+ * @param array $routeInfo
+ * @return mixed
+ */
+ protected function handleFoundRoute($routeInfo)
+ {
+ $this->currentRoute = $routeInfo;
+
+ $action = $routeInfo[1];
+
+ // Pipe through route middleware...
+ if (isset($action['middleware'])) {
+ $middleware = $this->gatherMiddlewareClassNames($action['middleware']);
+
+ return $this->prepareResponse($this->sendThroughPipeline($middleware, function () use ($routeInfo) {
+ return $this->callActionOnArrayBasedRoute($routeInfo);
+ }));
+ }
+
+ return $this->prepareResponse(
+ $this->callActionOnArrayBasedRoute($routeInfo)
+ );
+ }
+
+ /**
+ * Call the Closure on the array based route.
+ *
+ * @param array $routeInfo
+ * @return mixed
+ */
+ protected function callActionOnArrayBasedRoute($routeInfo)
+ {
+ $action = $routeInfo[1];
+
+ if (isset($action['uses'])) {
+ return $this->prepareResponse($this->callControllerAction($routeInfo));
+ }
+
+ foreach ($action as $value) {
+ if ($value instanceof Closure) {
+ $closure = $value->bindTo(new Routing\Closure);
+ break;
+ }
+ }
+
+ try {
+ return $this->prepareResponse($this->call($closure, $routeInfo[2]));
+ } catch (HttpResponseException $e) {
+ return $e->getResponse();
+ }
+ }
+
+ /**
+ * Call a controller based route.
+ *
+ * @param array $routeInfo
+ * @return mixed
+ */
+ protected function callControllerAction($routeInfo)
+ {
+ list($controller, $method) = explode('@', $routeInfo[1]['uses']);
+
+ if (! method_exists($instance = $this->make($controller), $method)) {
+ throw new NotFoundHttpException;
+ }
+
+ if ($instance instanceof Routing\Controller) {
+ return $this->callLumenController($instance, $method, $routeInfo);
+ } else {
+ return $this->callControllerCallable(
+ [$instance, $method], $routeInfo[2]
+ );
+ }
+ }
+
+ /**
+ * Send the request through a Lumen controller.
+ *
+ * @param mixed $instance
+ * @param string $method
+ * @param array $routeInfo
+ * @return mixed
+ */
+ protected function callLumenController($instance, $method, $routeInfo)
+ {
+ $middleware = $instance->getMiddlewareForMethod(
+ $method
+ );
+
+ if (count($middleware) > 0) {
+ return $this->callLumenControllerWithMiddleware(
+ $instance, $method, $routeInfo, $middleware
+ );
+ } else {
+ return $this->callControllerCallable(
+ [$instance, $method], $routeInfo[2]
+ );
+ }
+ }
+
+ /**
+ * Send the request through a set of controller middleware.
+ *
+ * @param mixed $instance
+ * @param string $method
+ * @param array $routeInfo
+ * @param array $middleware
+ * @return mixed
+ */
+ protected function callLumenControllerWithMiddleware($instance, $method, $routeInfo, $middleware)
+ {
+ $middleware = $this->gatherMiddlewareClassNames($middleware);
+
+ return $this->sendThroughPipeline($middleware, function () use ($instance, $method, $routeInfo) {
+ return $this->callControllerCallable(
+ [$instance, $method], $routeInfo[2]
+ );
+ });
+ }
+
+ /**
+ * Call the callable for a controller action with the given parameters.
+ *
+ * @param array $callable
+ * @param array $parameters
+ * @return mixed
+ */
+ protected function callControllerCallable(array $callable, array $parameters)
+ {
+ try {
+ return $this->prepareResponse(
+ $this->call($callable, $parameters)
+ );
+ } catch (HttpResponseException $e) {
+ return $e->getResponse();
+ }
+ }
+
+ /**
+ * Gather the full class names for the middleware short-cut string.
+ *
+ * @param string $middleware
+ * @return array
+ */
+ protected function gatherMiddlewareClassNames($middleware)
+ {
+ $middleware = is_string($middleware) ? explode('|', $middleware) : (array) $middleware;
+
+ return array_map(function ($name) {
+ list($name, $parameters) = array_pad(explode(':', $name, 2), 2, null);
+
+ return array_get($this->routeMiddleware, $name, $name).($parameters ? ':'.$parameters : '');
+ }, $middleware);
+ }
+
+ /**
+ * Send the request through the pipeline with the given callback.
+ *
+ * @param array $middleware
+ * @param \Closure $then
+ * @return mixed
+ */
+ protected function sendThroughPipeline(array $middleware, Closure $then)
+ {
+ $shouldSkipMiddleware = $this->bound('middleware.disable') &&
+ $this->make('middleware.disable') === true;
+
+ if (count($middleware) > 0 && ! $shouldSkipMiddleware) {
+ return (new Pipeline($this))
+ ->send($this->make('request'))
+ ->through($middleware)
+ ->then($then);
+ }
+
+ return $then();
+ }
+
+ /**
+ * Prepare the response for sending.
+ *
+ * @param mixed $response
+ * @return Response
+ */
+ public function prepareResponse($response)
+ {
+ if (! $response instanceof SymfonyResponse) {
+ $response = new Response($response);
+ } elseif ($response instanceof BinaryFileResponse) {
+ $response = $response->prepare(Request::capture());
+ }
+
+ return $response;
+ }
+
+ /**
+ * Get the current HTTP request method.
+ *
+ * @return string
+ */
+ protected function getMethod()
+ {
+ if (isset($_POST['_method'])) {
+ return strtoupper($_POST['_method']);
+ } else {
+ return $_SERVER['REQUEST_METHOD'];
+ }
+ }
+
+ /**
+ * Get the current HTTP path info.
+ *
+ * @return string
+ */
+ public function getPathInfo()
+ {
+ $query = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
+
+ return '/'.trim(str_replace('?'.$query, '', $_SERVER['REQUEST_URI']), '/');
+ }
+
+ /**
+ * Get the application namespace.
+ *
+ * @return string
+ *
+ * @throws \RuntimeException
+ */
+ public function getNamespace()
+ {
+ if (! is_null($this->namespace)) {
+ return $this->namespace;
+ }
+
+ $composer = json_decode(file_get_contents($this->basePath().'/composer.json'), true);
+
+ foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
+ foreach ((array) $path as $pathChoice) {
+ if (realpath($this->path()) == realpath($this->basePath().'/'.$pathChoice)) {
+ return $this->namespace = $namespace;
+ }
+ }
+ }
+
+ throw new RuntimeException('Unable to detect application namespace.');
+ }
+
+ /**
+ * Get the path to the application "app" directory.
+ *
+ * @return string
+ */
+ public function path()
+ {
+ return $this->basePath.DIRECTORY_SEPARATOR.'app';
+ }
+
+ /**
+ * Get the base path for the application.
+ *
+ * @param string|null $path
+ * @return string
+ */
+ public function basePath($path = null)
+ {
+ if (isset($this->basePath)) {
+ return $this->basePath.($path ? '/'.$path : $path);
+ }
+
+ if ($this->runningInConsole()) {
+ $this->basePath = getcwd();
+ } else {
+ $this->basePath = realpath(getcwd().'/../');
+ }
+
+ return $this->basePath($path);
+ }
+
+ /**
+ * Get the storage path for the application.
+ *
+ * @param string|null $path
+ * @return string
+ */
+ public function storagePath($path = null)
+ {
+ if ($this->storagePath) {
+ return $this->storagePath.($path ? '/'.$path : $path);
+ }
+
+ return $this->basePath().'/storage'.($path ? '/'.$path : $path);
+ }
+
+ /**
+ * Set a custom storage path for the application.
+ *
+ * @param string $path
+ * @return $this
+ */
+ public function useStoragePath($path)
+ {
+ $this->storagePath = $path;
+
+ return $this;
+ }
+
+ /**
+ * Get the database path for the application.
+ *
+ * @return string
+ */
+ public function databasePath()
+ {
+ return $this->basePath().'/database';
+ }
+
+ /**
+ * Set a custom configuration path for the application.
+ *
+ * @param string $path
+ * @return $this
+ */
+ public function useConfigPath($path)
+ {
+ $this->configPath = $path;
+
+ return $this;
+ }
+
+ /**
+ * Get the resource path for the application.
+ *
+ * @param string|null $path
+ * @return string
+ */
+ public function resourcePath($path = null)
+ {
+ if ($this->resourcePath) {
+ return $this->resourcePath.($path ? '/'.$path : $path);
+ }
+
+ return $this->basePath().'/resources'.($path ? '/'.$path : $path);
+ }
+
+ /**
+ * Set a custom resource path for the application.
+ *
+ * @param string $path
+ * @return $this
+ */
+ public function useResourcePath($path)
+ {
+ $this->resourcePath = $path;
+
+ return $this;
+ }
+
+ /**
+ * Determine if the application is running in the console.
+ *
+ * @return bool
+ */
+ public function runningInConsole()
+ {
+ return php_sapi_name() == 'cli';
+ }
+
+ /**
+ * Prepare the application to execute a console command.
+ *
+ * @return void
+ */
+ public function prepareForConsoleCommand()
+ {
+ $this->withFacades();
+
+ $this->make('cache');
+ $this->make('queue');
+
+ $this->configure('database');
+
+ $this->register('Illuminate\Database\MigrationServiceProvider');
+ $this->register('Illuminate\Database\SeedServiceProvider');
+ $this->register('Illuminate\Queue\ConsoleServiceProvider');
+ }
+
+ /**
+ * Get the raw routes for the application.
+ *
+ * @return array
+ */
+ public function getRoutes()
+ {
+ return $this->routes;
+ }
+
+ /**
+ * Set the cached routes.
+ *
+ * @param array $routes
+ * @return void
+ */
+ public function setRoutes(array $routes)
+ {
+ $this->routes = $routes;
+ }
+
+ /**
+ * Register the core container aliases.
+ *
+ * @return void
+ */
+ protected function registerContainerAliases()
+ {
+ $this->aliases = [
+ 'Illuminate\Contracts\Foundation\Application' => 'app',
+ 'Illuminate\Contracts\Auth\Guard' => 'auth.driver',
+ 'Illuminate\Contracts\Auth\PasswordBroker' => 'auth.password',
+ 'Illuminate\Contracts\Cache\Factory' => 'cache',
+ 'Illuminate\Contracts\Cache\Repository' => 'cache.store',
+ 'Illuminate\Contracts\Config\Repository' => 'config',
+ 'Illuminate\Container\Container' => 'app',
+ 'Illuminate\Contracts\Container\Container' => 'app',
+ 'Illuminate\Contracts\Cookie\Factory' => 'cookie',
+ 'Illuminate\Contracts\Cookie\QueueingFactory' => 'cookie',
+ 'Illuminate\Contracts\Encryption\Encrypter' => 'encrypter',
+ 'Illuminate\Contracts\Events\Dispatcher' => 'events',
+ 'Illuminate\Contracts\Filesystem\Factory' => 'filesystem',
+ 'Illuminate\Contracts\Hashing\Hasher' => 'hash',
+ 'log' => 'Psr\Log\LoggerInterface',
+ 'Illuminate\Contracts\Mail\Mailer' => 'mailer',
+ 'Illuminate\Contracts\Queue\Factory' => 'queue',
+ 'Illuminate\Contracts\Queue\Queue' => 'queue.connection',
+ 'Illuminate\Redis\Database' => 'redis',
+ 'Illuminate\Contracts\Redis\Database' => 'redis',
+ 'request' => 'Illuminate\Http\Request',
+ 'Illuminate\Session\SessionManager' => 'session',
+ 'Illuminate\Contracts\View\Factory' => 'view',
+ ];
+ }
+
+ /**
+ * The available container bindings and their respective load methods.
+ *
+ * @var array
+ */
+ public $availableBindings = [
+ 'auth' => 'registerAuthBindings',
+ 'auth.driver' => 'registerAuthBindings',
+ 'Illuminate\Contracts\Auth\Guard' => 'registerAuthBindings',
+ 'auth.password' => 'registerAuthBindings',
+ 'Illuminate\Contracts\Auth\PasswordBroker' => 'registerAuthBindings',
+ 'Illuminate\Contracts\Broadcasting\Broadcaster' => 'registerBroadcastingBindings',
+ 'Illuminate\Contracts\Bus\Dispatcher' => 'registerBusBindings',
+ 'cache' => 'registerCacheBindings',
+ 'Illuminate\Contracts\Cache\Factory' => 'registerCacheBindings',
+ 'Illuminate\Contracts\Cache\Repository' => 'registerCacheBindings',
+ 'config' => 'registerConfigBindings',
+ 'composer' => 'registerComposerBindings',
+ 'cookie' => 'registerCookieBindings',
+ 'Illuminate\Contracts\Cookie\Factory' => 'registerCookieBindings',
+ 'Illuminate\Contracts\Cookie\QueueingFactory' => 'registerCookieBindings',
+ 'db' => 'registerDatabaseBindings',
+ 'Illuminate\Database\Eloquent\Factory' => 'registerDatabaseBindings',
+ 'encrypter' => 'registerEncrypterBindings',
+ 'Illuminate\Contracts\Encryption\Encrypter' => 'registerEncrypterBindings',
+ 'events' => 'registerEventBindings',
+ 'Illuminate\Contracts\Events\Dispatcher' => 'registerEventBindings',
+ 'Illuminate\Contracts\Debug\ExceptionHandler' => 'registerErrorBindings',
+ 'files' => 'registerFilesBindings',
+ 'filesystem' => 'registerFilesBindings',
+ 'Illuminate\Contracts\Filesystem\Factory' => 'registerFilesBindings',
+ 'hash' => 'registerHashBindings',
+ 'Illuminate\Contracts\Hashing\Hasher' => 'registerHashBindings',
+ 'log' => 'registerLogBindings',
+ 'Psr\Log\LoggerInterface' => 'registerLogBindings',
+ 'mailer' => 'registerMailBindings',
+ 'Illuminate\Contracts\Mail\Mailer' => 'registerMailBindings',
+ 'queue' => 'registerQueueBindings',
+ 'queue.connection' => 'registerQueueBindings',
+ 'Illuminate\Contracts\Queue\Factory' => 'registerQueueBindings',
+ 'Illuminate\Contracts\Queue\Queue' => 'registerQueueBindings',
+ 'redis' => 'registerRedisBindings',
+ 'request' => 'registerRequestBindings',
+ 'Illuminate\Http\Request' => 'registerRequestBindings',
+ 'session' => 'registerSessionBindings',
+ 'session.store' => 'registerSessionBindings',
+ 'Illuminate\Session\SessionManager' => 'registerSessionBindings',
+ 'translator' => 'registerTranslationBindings',
+ 'url' => 'registerUrlGeneratorBindings',
+ 'validator' => 'registerValidatorBindings',
+ 'view' => 'registerViewBindings',
+ 'Illuminate\Contracts\View\Factory' => 'registerViewBindings',
+ ];
+
+ /**
+ * Get the HTML from the Lumen welcome screen.
+ *
+ * @return string
+ */
+ public function welcome()
+ {
+ return "
+
+
+ Lumen
+
+
+
+
+
+
+
+
+
Lumen.
+
+
+
+
+ ";
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Console/Commands/ServeCommand.php b/vendor/laravel/lumen-framework/src/Console/Commands/ServeCommand.php
new file mode 100644
index 00000000..4ad0af53
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Console/Commands/ServeCommand.php
@@ -0,0 +1,57 @@
+input->getOption('host');
+
+ $port = $this->input->getOption('port');
+
+ $base = $this->laravel->basePath();
+
+ $this->info("Lumen development server started on http://{$host}:{$port}/");
+
+ passthru('"'.PHP_BINARY.'"'." -S {$host}:{$port} \"{$base}\"/server.php");
+ }
+
+ /**
+ * Get the console command options.
+ *
+ * @return array
+ */
+ protected function getOptions()
+ {
+ return [
+ ['host', null, InputOption::VALUE_OPTIONAL, 'The host address to serve the application on.', 'localhost'],
+
+ ['port', null, InputOption::VALUE_OPTIONAL, 'The port to serve the application on.', 8000],
+ ];
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Console/Commands/stubs/DatabaseSeeder.stub b/vendor/laravel/lumen-framework/src/Console/Commands/stubs/DatabaseSeeder.stub
new file mode 100644
index 00000000..74a56056
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Console/Commands/stubs/DatabaseSeeder.stub
@@ -0,0 +1,20 @@
+call('UserTableSeeder');
+ }
+
+}
diff --git a/vendor/laravel/lumen-framework/src/Console/Commands/stubs/routes.stub b/vendor/laravel/lumen-framework/src/Console/Commands/stubs/routes.stub
new file mode 100644
index 00000000..6852d402
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Console/Commands/stubs/routes.stub
@@ -0,0 +1,16 @@
+setRoutes(
+ unserialize(base64_decode('{{routes}}'))
+);
diff --git a/vendor/laravel/lumen-framework/src/Console/Kernel.php b/vendor/laravel/lumen-framework/src/Console/Kernel.php
new file mode 100644
index 00000000..7b9d1b3b
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Console/Kernel.php
@@ -0,0 +1,205 @@
+app = $app;
+
+ if ($this->includeDefaultCommands) {
+ $this->app->prepareForConsoleCommand();
+ }
+
+ $this->defineConsoleSchedule();
+ }
+
+ /**
+ * Define the application's command schedule.
+ *
+ * @return void
+ */
+ protected function defineConsoleSchedule()
+ {
+ $this->app->instance(
+ 'Illuminate\Console\Scheduling\Schedule', $schedule = new Schedule
+ );
+
+ $this->schedule($schedule);
+ }
+
+ /**
+ * Run the console application.
+ *
+ * @param \Symfony\Component\Console\Input\InputInterface $input
+ * @param \Symfony\Component\Console\Output\OutputInterface $output
+ * @return int
+ */
+ public function handle($input, $output = null)
+ {
+ try {
+ return $this->getArtisan()->run($input, $output);
+ } catch (Exception $e) {
+ $this->reportException($e);
+
+ $this->renderException($output, $e);
+
+ return 1;
+ } catch (Throwable $e) {
+ $e = new FatalThrowableError($e);
+
+ $this->reportException($e);
+
+ $this->renderException($output, $e);
+
+ return 1;
+ }
+ }
+
+ /**
+ * Define the application's command schedule.
+ *
+ * @param \Illuminate\Console\Scheduling\Schedule $schedule
+ * @return void
+ */
+ protected function schedule(Schedule $schedule)
+ {
+ //
+ }
+
+ /**
+ * Run an Artisan console command by name.
+ *
+ * @param string $command
+ * @param array $parameters
+ * @return int
+ */
+ public function call($command, array $parameters = [])
+ {
+ return $this->getArtisan()->call($command, $parameters);
+ }
+
+ /**
+ * Queue the given console command.
+ *
+ * @param string $command
+ * @param array $parameters
+ * @return void
+ */
+ public function queue($command, array $parameters = [])
+ {
+ throw new RuntimeException('Queueing Artisan commands is not supported by Lumen.');
+ }
+
+ /**
+ * Get all of the commands registered with the console.
+ *
+ * @return array
+ */
+ public function all()
+ {
+ return $this->getArtisan()->all();
+ }
+
+ /**
+ * Get the output for the last run command.
+ *
+ * @return string
+ */
+ public function output()
+ {
+ return $this->getArtisan()->output();
+ }
+
+ /**
+ * Get the Artisan application instance.
+ *
+ * @return \Illuminate\Console\Application
+ */
+ protected function getArtisan()
+ {
+ if (is_null($this->artisan)) {
+ return $this->artisan = (new Artisan($this->app, $this->app->make('events'), $this->app->version()))
+ ->resolveCommands($this->getCommands());
+ }
+
+ return $this->artisan;
+ }
+
+ /**
+ * Get the commands to add to the application.
+ *
+ * @return array
+ */
+ protected function getCommands()
+ {
+ if ($this->includeDefaultCommands) {
+ return array_merge($this->commands, [
+ 'Illuminate\Console\Scheduling\ScheduleRunCommand',
+ 'Laravel\Lumen\Console\Commands\ServeCommand',
+ ]);
+ } else {
+ return $this->commands;
+ }
+ }
+
+ /**
+ * Report the exception to the exception handler.
+ *
+ * @param \Exception $e
+ * @return void
+ */
+ protected function reportException(Exception $e)
+ {
+ $this->app['Illuminate\Contracts\Debug\ExceptionHandler']->report($e);
+ }
+
+ /**
+ * Report the exception to the exception handler.
+ *
+ * @param \Symfony\Component\Console\Output\OutputInterface $output
+ * @param \Exception $e
+ * @return void
+ */
+ protected function renderException($output, Exception $e)
+ {
+ $this->app['Illuminate\Contracts\Debug\ExceptionHandler']->renderForConsole($output, $e);
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Exceptions/Handler.php b/vendor/laravel/lumen-framework/src/Exceptions/Handler.php
new file mode 100644
index 00000000..fc0d4e46
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Exceptions/Handler.php
@@ -0,0 +1,102 @@
+shouldReport($e)) {
+ app('Psr\Log\LoggerInterface')->error($e);
+ }
+ }
+
+ /**
+ * Determine if the exception should be reported.
+ *
+ * @param \Exception $e
+ * @return bool
+ */
+ public function shouldReport(Exception $e)
+ {
+ return ! $this->shouldntReport($e);
+ }
+
+ /**
+ * Determine if the exception is in the "do not report" list.
+ *
+ * @param \Exception $e
+ * @return bool
+ */
+ protected function shouldntReport(Exception $e)
+ {
+ foreach ($this->dontReport as $type) {
+ if ($e instanceof $type) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Render an exception into an HTTP response.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Exception $e
+ * @return \Symfony\Component\HttpFoundation\Response
+ */
+ public function render($request, Exception $e)
+ {
+ $response = (new SymfonyExceptionHandler(env('APP_DEBUG', false)))->createResponse($e);
+
+ return $this->toIlluminateResponse($response, $e);
+ }
+
+ /**
+ * Map exception into an illuminate response.
+ *
+ * @param \Symfony\Component\HttpFoundation\Response $response
+ * @param \Exception $e
+ * @return \Illuminate\Http\Response
+ */
+ protected function toIlluminateResponse($response, Exception $e)
+ {
+ $response = new Response($response->getContent(), $response->getStatusCode(), $response->headers->all());
+
+ $response->exception = $e;
+
+ return $response;
+ }
+
+ /**
+ * Render an exception to the console.
+ *
+ * @param \Symfony\Component\Console\Output\OutputInterface $output
+ * @param \Exception $e
+ * @return void
+ */
+ public function renderForConsole($output, Exception $e)
+ {
+ (new ConsoleApplication)->renderException($e, $output);
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Foundation/Composer.php b/vendor/laravel/lumen-framework/src/Foundation/Composer.php
new file mode 100644
index 00000000..5cd87331
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Foundation/Composer.php
@@ -0,0 +1,98 @@
+files = $files;
+ $this->workingPath = $workingPath;
+ }
+
+ /**
+ * Regenerate the Composer autoloader files.
+ *
+ * @param string $extra
+ * @return void
+ */
+ public function dumpAutoloads($extra = '')
+ {
+ $process = $this->getProcess();
+
+ $process->setCommandLine(trim($this->findComposer().' dump-autoload '.$extra));
+
+ $process->run();
+ }
+
+ /**
+ * Regenerate the optimized Composer autoloader files.
+ *
+ * @return void
+ */
+ public function dumpOptimized()
+ {
+ $this->dumpAutoloads('--optimize');
+ }
+
+ /**
+ * Get the composer command for the environment.
+ *
+ * @return string
+ */
+ protected function findComposer()
+ {
+ if ($this->files->exists($this->workingPath.'/composer.phar')) {
+ return '"'.PHP_BINARY.'" composer.phar';
+ }
+
+ return 'composer';
+ }
+
+ /**
+ * Get a new Symfony process instance.
+ *
+ * @return \Symfony\Component\Process\Process
+ */
+ protected function getProcess()
+ {
+ return (new Process('', $this->workingPath))->setTimeout(null);
+ }
+
+ /**
+ * Set the working path used by the class.
+ *
+ * @param string $path
+ * @return $this
+ */
+ public function setWorkingPath($path)
+ {
+ $this->workingPath = realpath($path);
+
+ return $this;
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Foundation/Support/Providers/EventServiceProvider.php b/vendor/laravel/lumen-framework/src/Foundation/Support/Providers/EventServiceProvider.php
new file mode 100644
index 00000000..4fd83d2f
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Foundation/Support/Providers/EventServiceProvider.php
@@ -0,0 +1,60 @@
+listen as $event => $listeners) {
+ foreach ($listeners as $listener) {
+ $events->listen($event, $listener);
+ }
+ }
+
+ foreach ($this->subscribe as $subscriber) {
+ $events->subscribe($subscriber);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function register()
+ {
+ //
+ }
+
+ /**
+ * Get the events and handlers.
+ *
+ * @return array
+ */
+ public function listens()
+ {
+ return $this->listen;
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Foundation/Testing/DatabaseMigrations.php b/vendor/laravel/lumen-framework/src/Foundation/Testing/DatabaseMigrations.php
new file mode 100644
index 00000000..d53b34e4
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Foundation/Testing/DatabaseMigrations.php
@@ -0,0 +1,18 @@
+artisan('migrate');
+
+ $this->beforeApplicationDestroyed(function () {
+ $this->artisan('migrate:rollback');
+ });
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Foundation/Testing/DatabaseTransactions.php b/vendor/laravel/lumen-framework/src/Foundation/Testing/DatabaseTransactions.php
new file mode 100644
index 00000000..e580f5af
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Foundation/Testing/DatabaseTransactions.php
@@ -0,0 +1,18 @@
+app->make('db')->beginTransaction();
+
+ $this->beforeApplicationDestroyed(function () {
+ $this->app->make('db')->rollBack();
+ });
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Foundation/Testing/WithoutMiddleware.php b/vendor/laravel/lumen-framework/src/Foundation/Testing/WithoutMiddleware.php
new file mode 100644
index 00000000..91d1bf56
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Foundation/Testing/WithoutMiddleware.php
@@ -0,0 +1,20 @@
+withoutMiddleware();
+ } else {
+ throw new Exception('Unable to disable middleware. CrawlerTrait not used.');
+ }
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Http/Middleware/VerifyCsrfToken.php b/vendor/laravel/lumen-framework/src/Http/Middleware/VerifyCsrfToken.php
new file mode 100644
index 00000000..4d334d63
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Http/Middleware/VerifyCsrfToken.php
@@ -0,0 +1,92 @@
+encrypter = $encrypter;
+ }
+
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ * @return \Illuminate\Http\Response
+ *
+ * @throws \Illuminate\Session\TokenMismatchException
+ */
+ public function handle($request, Closure $next)
+ {
+ if ($this->isReading($request) || $this->tokensMatch($request)) {
+ return $this->addCookieToResponse($request, $next($request));
+ }
+
+ throw new TokenMismatchException;
+ }
+
+ /**
+ * Determine if the session and input CSRF tokens match.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @return bool
+ */
+ protected function tokensMatch($request)
+ {
+ $token = $request->input('_token') ?: $request->header('X-CSRF-TOKEN');
+
+ if (! $token && $header = $request->header('X-XSRF-TOKEN')) {
+ $token = $this->encrypter->decrypt($header);
+ }
+
+ return StringUtils::equals($request->session()->token(), $token);
+ }
+
+ /**
+ * Add the CSRF token to the response cookies.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Illuminate\Http\Response $response
+ * @return \Illuminate\Http\Response
+ */
+ protected function addCookieToResponse($request, $response)
+ {
+ $response->headers->setCookie(
+ new Cookie('XSRF-TOKEN', $request->session()->token(), time() + 60 * 120, '/', null, false, false)
+ );
+
+ return $response;
+ }
+
+ /**
+ * Determine if the HTTP request uses a ‘read’ verb.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @return bool
+ */
+ protected function isReading($request)
+ {
+ return in_array($request->method(), ['HEAD', 'GET', 'OPTIONS']);
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Http/Redirector.php b/vendor/laravel/lumen-framework/src/Http/Redirector.php
new file mode 100644
index 00000000..83be7f50
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Http/Redirector.php
@@ -0,0 +1,96 @@
+app = $app;
+ }
+
+ /**
+ * Create a new redirect response to the given path.
+ *
+ * @param string $path
+ * @param int $status
+ * @param array $headers
+ * @param bool $secure
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ public function to($path, $status = 302, $headers = [], $secure = null)
+ {
+ $path = $this->app->make('url')->to($path, [], $secure);
+
+ return $this->createRedirect($path, $status, $headers);
+ }
+
+ /**
+ * Create a new redirect response to a named route.
+ *
+ * @param string $route
+ * @param array $parameters
+ * @param int $status
+ * @param array $headers
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ public function route($route, $parameters = [], $status = 302, $headers = [])
+ {
+ $path = $this->app->make('url')->route($route, $parameters);
+
+ return $this->to($path, $status, $headers);
+ }
+
+ /**
+ * Create a new redirect response to the previous location.
+ *
+ * @param int $status
+ * @param array $headers
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ public function back($status = 302, $headers = [])
+ {
+ $referrer = $this->app->make('request')
+ ->headers->get('referer');
+
+ $url = $referrer ? $this->app->make('url')->to($referrer)
+ : $this->app->make('session')->previousUrl();
+
+ return $this->createRedirect($url, $status, $headers);
+ }
+
+ /**
+ * Create a new redirect response.
+ *
+ * @param string $path
+ * @param int $status
+ * @param array $headers
+ * @return \Illuminate\Http\RedirectResponse
+ */
+ protected function createRedirect($path, $status, $headers)
+ {
+ $redirect = new RedirectResponse($path, $status, $headers);
+
+ $redirect->setRequest($this->app->make('request'));
+
+ $redirect->setSession($this->app->make('session.store'));
+
+ return $redirect;
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Http/ResponseFactory.php b/vendor/laravel/lumen-framework/src/Http/ResponseFactory.php
new file mode 100644
index 00000000..aad2ac8f
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Http/ResponseFactory.php
@@ -0,0 +1,63 @@
+toArray();
+ }
+
+ return new JsonResponse($data, $status, $headers, $options);
+ }
+
+ /**
+ * Create a new file download response.
+ *
+ * @param \SplFileInfo|string $file
+ * @param string $name
+ * @param array $headers
+ * @param null|string $disposition
+ * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
+ */
+ public function download($file, $name = null, array $headers = [], $disposition = 'attachment')
+ {
+ $response = new BinaryFileResponse($file, 200, $headers, true, $disposition);
+
+ if (! is_null($name)) {
+ return $response->setContentDisposition($disposition, $name, str_replace('%', '', Str::ascii($name)));
+ }
+
+ return $response;
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Providers/CacheServiceProvider.php b/vendor/laravel/lumen-framework/src/Providers/CacheServiceProvider.php
new file mode 100644
index 00000000..9f79119a
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Providers/CacheServiceProvider.php
@@ -0,0 +1,23 @@
+app->singleton('command.cache.clear', function ($app) {
+ return new ClearCommand($app['cache']);
+ });
+
+ $this->commands('command.cache.clear');
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Routing/Closure.php b/vendor/laravel/lumen-framework/src/Routing/Closure.php
new file mode 100644
index 00000000..26568c33
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Routing/Closure.php
@@ -0,0 +1,75 @@
+baseBuildFailedValidationResponse($request, $errors);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function formatValidationErrors(Validator $validator)
+ {
+ if (isset(static::$errorFormatter)) {
+ return call_user_func(static::$errorFormatter, $validator);
+ }
+
+ return $this->baseFormatValidationErrors($validator);
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Routing/Controller.php b/vendor/laravel/lumen-framework/src/Routing/Controller.php
new file mode 100644
index 00000000..42716e13
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Routing/Controller.php
@@ -0,0 +1,52 @@
+middleware[$middleware] = $options;
+ }
+
+ /**
+ * Get the middleware for a given method.
+ *
+ * @param string $method
+ * @return array
+ */
+ public function getMiddlewareForMethod($method)
+ {
+ $middleware = [];
+
+ foreach ($this->middleware as $name => $options) {
+ if (isset($options['only']) && ! in_array($method, (array) $options['only'])) {
+ continue;
+ }
+
+ if (isset($options['except']) && in_array($method, (array) $options['except'])) {
+ continue;
+ }
+
+ $middleware[] = $name;
+ }
+
+ return $middleware;
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Routing/DispatchesJobs.php b/vendor/laravel/lumen-framework/src/Routing/DispatchesJobs.php
new file mode 100644
index 00000000..26fa7727
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Routing/DispatchesJobs.php
@@ -0,0 +1,44 @@
+dispatch($job);
+ }
+
+ /**
+ * Marshal a job and dispatch it to its appropriate handler.
+ *
+ * @param mixed $job
+ * @param array $array
+ * @return mixed
+ */
+ protected function dispatchFromArray($job, array $array)
+ {
+ return app('Illuminate\Contracts\Bus\Dispatcher')->dispatchFromArray($job, $array);
+ }
+
+ /**
+ * Marshal a job and dispatch it to its appropriate handler.
+ *
+ * @param mixed $job
+ * @param \ArrayAccess $source
+ * @param array $extras
+ * @return mixed
+ */
+ protected function dispatchFrom($job, ArrayAccess $source, $extras = [])
+ {
+ return app('Illuminate\Contracts\Bus\Dispatcher')->dispatchFrom($job, $source, $extras);
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Routing/UrlGenerator.php b/vendor/laravel/lumen-framework/src/Routing/UrlGenerator.php
new file mode 100644
index 00000000..c8ba0d27
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Routing/UrlGenerator.php
@@ -0,0 +1,333 @@
+app = $app;
+ }
+
+ /**
+ * Get the full URL for the current request.
+ *
+ * @return string
+ */
+ public function full()
+ {
+ return $this->app->make('request')->fullUrl();
+ }
+
+ /**
+ * Get the current URL for the request.
+ *
+ * @return string
+ */
+ public function current()
+ {
+ return $this->to($this->app->make('request')->getPathInfo());
+ }
+
+ /**
+ * Generate a url for the application.
+ *
+ * @param string $path
+ * @param array $extra
+ * @param bool $secure
+ * @return string
+ */
+ public function to($path, $extra = [], $secure = null)
+ {
+ // First we will check if the URL is already a valid URL. If it is we will not
+ // try to generate a new one but will simply return the URL as is, which is
+ // convenient since developers do not always have to check if it's valid.
+ if ($this->isValidUrl($path)) {
+ return $path;
+ }
+
+ $scheme = $this->getSchemeForUrl($secure);
+
+ $extra = $this->formatParametersForUrl($extra);
+
+ $tail = implode('/', array_map(
+ 'rawurlencode', (array) $extra)
+ );
+
+ // Once we have the scheme we will compile the "tail" by collapsing the values
+ // into a single string delimited by slashes. This just makes it convenient
+ // for passing the array of parameters to this URL as a list of segments.
+ $root = $this->getRootUrl($scheme);
+
+ return $this->trimUrl($root, $path, $tail);
+ }
+
+ /**
+ * Generate a secure, absolute URL to the given path.
+ *
+ * @param string $path
+ * @param array $parameters
+ * @return string
+ */
+ public function secure($path, $parameters = [])
+ {
+ return $this->to($path, $parameters, true);
+ }
+
+ /**
+ * Generate a URL to an application asset.
+ *
+ * @param string $path
+ * @param bool|null $secure
+ * @return string
+ */
+ public function asset($path, $secure = null)
+ {
+ if ($this->isValidUrl($path)) {
+ return $path;
+ }
+
+ // Once we get the root URL, we will check to see if it contains an index.php
+ // file in the paths. If it does, we will remove it since it is not needed
+ // for asset paths, but only for routes to endpoints in the application.
+ $root = $this->getRootUrl($this->getScheme($secure));
+
+ return $this->removeIndex($root).'/'.trim($path, '/');
+ }
+
+ /**
+ * Generate a URL to an application asset from a root domain such as CDN etc.
+ *
+ * @param string $root
+ * @param string $path
+ * @param bool|null $secure
+ * @return string
+ */
+ public function assetFrom($root, $path, $secure = null)
+ {
+ // Once we get the root URL, we will check to see if it contains an index.php
+ // file in the paths. If it does, we will remove it since it is not needed
+ // for asset paths, but only for routes to endpoints in the application.
+ $root = $this->getRootUrl($this->getScheme($secure), $root);
+
+ return $this->removeIndex($root).'/'.trim($path, '/');
+ }
+
+ /**
+ * Remove the index.php file from a path.
+ *
+ * @param string $root
+ * @return string
+ */
+ protected function removeIndex($root)
+ {
+ $i = 'index.php';
+
+ return str_contains($root, $i) ? str_replace('/'.$i, '', $root) : $root;
+ }
+
+ /**
+ * Generate a URL to a secure asset.
+ *
+ * @param string $path
+ * @return string
+ */
+ public function secureAsset($path)
+ {
+ return $this->asset($path, true);
+ }
+
+ /**
+ * Get the scheme for a raw URL.
+ *
+ * @param bool|null $secure
+ * @return string
+ */
+ protected function getScheme($secure)
+ {
+ if (is_null($secure)) {
+ return $this->forceSchema ?: $this->app->make('request')->getScheme().'://';
+ }
+
+ return $secure ? 'https://' : 'http://';
+ }
+
+ /**
+ * Force the schema for URLs.
+ *
+ * @param string $schema
+ * @return void
+ */
+ public function forceSchema($schema)
+ {
+ $this->forceSchema = $schema.'://';
+ }
+
+ /**
+ * Get the URL to a named route.
+ *
+ * @param string $name
+ * @param mixed $parameters
+ * @return string
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function route($name, $parameters = [])
+ {
+ if (! isset($this->app->namedRoutes[$name])) {
+ throw new \InvalidArgumentException("Route [{$name}] not defined.");
+ }
+
+ $uri = $this->app->namedRoutes[$name];
+
+ $parameters = $this->formatParametersForUrl($parameters);
+
+ $uri = preg_replace_callback('/\{(.*?)(:.*?)?(\{[0-9,]+\})?\}/', function ($m) use (&$parameters) {
+ return isset($parameters[$m[1]]) ? array_pull($parameters, $m[1]) : $m[0];
+ }, $uri);
+
+ $uri = $this->to($uri, []);
+
+ if (! empty($parameters)) {
+ $uri .= '?'.http_build_query($parameters);
+ }
+
+ return $uri;
+ }
+
+ /**
+ * Determine if the given path is a valid URL.
+ *
+ * @param string $path
+ * @return bool
+ */
+ protected function isValidUrl($path)
+ {
+ if (starts_with($path, ['#', '//', 'mailto:', 'tel:', 'http://', 'https://'])) {
+ return true;
+ }
+
+ return filter_var($path, FILTER_VALIDATE_URL) !== false;
+ }
+
+ /**
+ * Get the scheme for a raw URL.
+ *
+ * @param bool|null $secure
+ * @return string
+ */
+ protected function getSchemeForUrl($secure)
+ {
+ if (is_null($secure)) {
+ if (is_null($this->cachedScheme)) {
+ $this->cachedScheme = $this->app->make('request')->getScheme().'://';
+ }
+
+ return $this->cachedScheme;
+ }
+
+ return $secure ? 'https://' : 'http://';
+ }
+
+ /**
+ * Format the array of URL parameters.
+ *
+ * @param mixed|array $parameters
+ * @return array
+ */
+ protected function formatParametersForUrl($parameters)
+ {
+ return $this->replaceRoutableParametersForUrl($parameters);
+ }
+
+ /**
+ * Replace UrlRoutable parameters with their route parameter.
+ *
+ * @param array $parameters
+ * @return array
+ */
+ protected function replaceRoutableParametersForUrl($parameters = [])
+ {
+ $parameters = is_array($parameters) ? $parameters : [$parameters];
+
+ foreach ($parameters as $key => $parameter) {
+ if ($parameter instanceof UrlRoutable) {
+ $parameters[$key] = $parameter->getRouteKey();
+ }
+ }
+
+ return $parameters;
+ }
+
+ /**
+ * Get the base URL for the request.
+ *
+ * @param string $scheme
+ * @param string $root
+ * @return string
+ */
+ protected function getRootUrl($scheme, $root = null)
+ {
+ if (is_null($root)) {
+ if (is_null($this->cachedRoot)) {
+ $this->cachedRoot = $this->app->make('request')->root();
+ }
+
+ $root = $this->cachedRoot;
+ }
+
+ $start = starts_with($root, 'http://') ? 'http://' : 'https://';
+
+ return preg_replace('~'.$start.'~', $scheme, $root, 1);
+ }
+
+ /**
+ * Format the given URL segments into a single URL.
+ *
+ * @param string $root
+ * @param string $path
+ * @param string $tail
+ * @return string
+ */
+ protected function trimUrl($root, $path, $tail = '')
+ {
+ return trim($root.'/'.trim($path.'/'.$tail, '/'), '/');
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Routing/ValidatesRequests.php b/vendor/laravel/lumen-framework/src/Routing/ValidatesRequests.php
new file mode 100644
index 00000000..72a336fd
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Routing/ValidatesRequests.php
@@ -0,0 +1,102 @@
+getValidationFactory()->make($request->all(), $rules, $messages, $customAttributes);
+
+ if ($validator->fails()) {
+ $this->throwValidationException($request, $validator);
+ }
+ }
+
+ /**
+ * Throw the failed validation exception.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Illuminate\Contracts\Validation\Validator $validator
+ * @return void
+ */
+ protected function throwValidationException(Request $request, $validator)
+ {
+ throw new HttpResponseException($this->buildFailedValidationResponse(
+ $request, $this->formatValidationErrors($validator)
+ ));
+ }
+
+ /**
+ * Create the response for when a request fails validation.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param array $errors
+ * @return \Illuminate\Http\Response
+ */
+ protected function buildFailedValidationResponse(Request $request, array $errors)
+ {
+ if ($request->ajax() || $request->wantsJson()) {
+ return new JsonResponse($errors, 422);
+ }
+
+ return redirect()->to($this->getRedirectUrl())
+ ->withInput($request->input())
+ ->withErrors($errors, $this->errorBag());
+ }
+
+ /**
+ * Format the validation errors to be returned.
+ *
+ * @param \Illuminate\Validation\Validator $validator
+ * @return array
+ */
+ protected function formatValidationErrors(Validator $validator)
+ {
+ return $validator->errors()->getMessages();
+ }
+
+ /**
+ * Get the URL we should redirect to.
+ *
+ * @return string
+ */
+ protected function getRedirectUrl()
+ {
+ return app('session')->previousUrl();
+ }
+
+ /**
+ * Get a validation factory instance.
+ *
+ * @return \Illuminate\Contracts\Validation\Factory
+ */
+ protected function getValidationFactory()
+ {
+ return app('validator');
+ }
+
+ /**
+ * Get the key to be used for the view error bag.
+ *
+ * @return string
+ */
+ protected function errorBag()
+ {
+ return 'default';
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Testing/ApplicationTrait.php b/vendor/laravel/lumen-framework/src/Testing/ApplicationTrait.php
new file mode 100644
index 00000000..c29765f2
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Testing/ApplicationTrait.php
@@ -0,0 +1,267 @@
+app = $this->createApplication();
+
+ Facade::clearResolvedInstances();
+ }
+
+ /**
+ * Specify a list of events that should be fired for the given operation.
+ *
+ * These events will be mocked, so that handlers will not actually be executed.
+ *
+ * @param array|dynamic $events
+ * @return $this
+ */
+ public function expectsEvents($events)
+ {
+ $events = is_array($events) ? $events : func_get_args();
+
+ $mock = Mockery::spy('Illuminate\Contracts\Events\Dispatcher');
+
+ $mock->shouldReceive('fire')->andReturnUsing(function ($called) use (&$events) {
+ foreach ($events as $key => $event) {
+ if ((is_string($called) && $called === $event) ||
+ (is_string($called) && is_subclass_of($called, $event)) ||
+ (is_object($called) && $called instanceof $event)) {
+ unset($events[$key]);
+ }
+ }
+ });
+
+ $this->beforeApplicationDestroyed(function () use (&$events) {
+ if ($events) {
+ throw new Exception(
+ 'The following events were not fired: ['.implode(', ', $events).']'
+ );
+ }
+ });
+
+ $this->app->instance('events', $mock);
+
+ return $this;
+ }
+
+ /**
+ * Mock the event dispatcher so all events are silenced.
+ *
+ * @return $this
+ */
+ protected function withoutEvents()
+ {
+ $mock = Mockery::mock('Illuminate\Contracts\Events\Dispatcher');
+
+ $mock->shouldReceive('fire');
+
+ $this->app->instance('events', $mock);
+
+ return $this;
+ }
+
+ /**
+ * Specify a list of jobs that should be dispatched for the given operation.
+ *
+ * These jobs will be mocked, so that handlers will not actually be executed.
+ *
+ * @param array|dynamic $jobs
+ * @return $this
+ */
+ protected function expectsJobs($jobs)
+ {
+ $jobs = is_array($jobs) ? $jobs : func_get_args();
+
+ $mock = Mockery::mock('Illuminate\Bus\Dispatcher[dispatch]', [$this->app]);
+
+ foreach ($jobs as $job) {
+ $mock->shouldReceive('dispatch')->atLeast()->once()
+ ->with(Mockery::type($job));
+ }
+
+ $this->app->instance(
+ 'Illuminate\Contracts\Bus\Dispatcher', $mock
+ );
+
+ return $this;
+ }
+
+ /**
+ * Set the session to the given array.
+ *
+ * @param array $data
+ * @return $this
+ */
+ public function withSession(array $data)
+ {
+ $this->session($data);
+
+ return $this;
+ }
+
+ /**
+ * Set the session to the given array.
+ *
+ * @param array $data
+ * @return void
+ */
+ public function session(array $data)
+ {
+ $this->startSession();
+
+ foreach ($data as $key => $value) {
+ $this->app['session']->put($key, $value);
+ }
+ }
+
+ /**
+ * Flush all of the current session data.
+ *
+ * @return void
+ */
+ public function flushSession()
+ {
+ $this->startSession();
+
+ $this->app['session']->flush();
+ }
+
+ /**
+ * Start the session for the application.
+ *
+ * @return void
+ */
+ protected function startSession()
+ {
+ if (! $this->app['session']->isStarted()) {
+ $this->app['session']->start();
+ }
+ }
+
+ /**
+ * Set the currently logged in user for the application.
+ *
+ * @param \Illuminate\Contracts\Auth\Authenticatable $user
+ * @param string|null $driver
+ * @return $this
+ */
+ public function actingAs(UserContract $user, $driver = null)
+ {
+ $this->be($user, $driver);
+
+ return $this;
+ }
+
+ /**
+ * Set the currently logged in user for the application.
+ *
+ * @param \Illuminate\Contracts\Auth\Authenticatable $user
+ * @param string $driver
+ * @return void
+ */
+ public function be(UserContract $user, $driver = null)
+ {
+ $this->app['auth']->driver($driver)->setUser($user);
+ }
+
+ /**
+ * Assert that a given where condition exists in the database.
+ *
+ * @param string $table
+ * @param array $data
+ * @return $this
+ */
+ protected function seeInDatabase($table, array $data)
+ {
+ $count = $this->app->make('db')->table($table)->where($data)->count();
+
+ $this->assertGreaterThan(0, $count, sprintf(
+ 'Unable to find row in database table [%s] that matched attributes [%s].', $table, json_encode($data)
+ ));
+
+ return $this;
+ }
+
+ /**
+ * Assert that a given where condition does not exist in the database.
+ *
+ * @param string $table
+ * @param array $data
+ * @return $this
+ */
+ protected function missingFromDatabase($table, array $data)
+ {
+ return $this->notSeeInDatabase($table, $data);
+ }
+
+ /**
+ * Assert that a given where condition does not exist in the database.
+ *
+ * @param string $table
+ * @param array $data
+ * @return $this
+ */
+ protected function notSeeInDatabase($table, array $data)
+ {
+ $count = $this->app->make('db')->table($table)->where($data)->count();
+
+ $this->assertEquals(0, $count, sprintf(
+ 'Found unexpected records in database table [%s] that matched attributes [%s].', $table, json_encode($data)
+ ));
+
+ return $this;
+ }
+
+ /**
+ * Seed a given database connection.
+ *
+ * @param string $class
+ * @return void
+ */
+ public function seed($class = 'DatabaseSeeder')
+ {
+ $this->artisan('db:seed', ['--class' => $class]);
+ }
+
+ /**
+ * Call artisan command and return code.
+ *
+ * @param string $command
+ * @param array $parameters
+ * @return int
+ */
+ public function artisan($command, $parameters = [])
+ {
+ return $this->code = $this->app['Illuminate\Contracts\Console\Kernel']->call($command, $parameters);
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Testing/AssertionsTrait.php b/vendor/laravel/lumen-framework/src/Testing/AssertionsTrait.php
new file mode 100644
index 00000000..d8afcf76
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Testing/AssertionsTrait.php
@@ -0,0 +1,190 @@
+response->getStatusCode();
+
+ return PHPUnit::assertTrue($this->response->isOk(), "Expected status code 200, got {$actual}.");
+ }
+
+ /**
+ * Assert that the client response has a given code.
+ *
+ * @param int $code
+ * @return void
+ */
+ public function assertResponseStatus($code)
+ {
+ $actual = $this->response->getStatusCode();
+
+ return PHPUnit::assertEquals($code, $this->response->getStatusCode(), "Expected status code {$code}, got {$actual}.");
+ }
+
+ /**
+ * Assert that the response view has a given piece of bound data.
+ *
+ * @param string|array $key
+ * @param mixed $value
+ * @return void
+ */
+ public function assertViewHas($key, $value = null)
+ {
+ if (is_array($key)) {
+ return $this->assertViewHasAll($key);
+ }
+
+ if (! isset($this->response->original) || ! $this->response->original instanceof View) {
+ return PHPUnit::assertTrue(false, 'The response was not a view.');
+ }
+
+ if (is_null($value)) {
+ PHPUnit::assertArrayHasKey($key, $this->response->original->getData());
+ } else {
+ PHPUnit::assertEquals($value, $this->response->original->$key);
+ }
+ }
+
+ /**
+ * Assert that the view has a given list of bound data.
+ *
+ * @param array $bindings
+ * @return void
+ */
+ public function assertViewHasAll(array $bindings)
+ {
+ foreach ($bindings as $key => $value) {
+ if (is_int($key)) {
+ $this->assertViewHas($value);
+ } else {
+ $this->assertViewHas($key, $value);
+ }
+ }
+ }
+
+ /**
+ * Assert that the response view is missing a piece of bound data.
+ *
+ * @param string $key
+ * @return void
+ */
+ public function assertViewMissing($key)
+ {
+ if (! isset($this->response->original) || ! $this->response->original instanceof View) {
+ return PHPUnit::assertTrue(false, 'The response was not a view.');
+ }
+
+ PHPUnit::assertArrayNotHasKey($key, $this->response->original->getData());
+ }
+
+ /**
+ * Assert whether the client was redirected to a given URI.
+ *
+ * @param string $uri
+ * @param array $with
+ * @return void
+ */
+ public function assertRedirectedTo($uri, $with = [])
+ {
+ PHPUnit::assertInstanceOf('Illuminate\Http\RedirectResponse', $this->response);
+
+ PHPUnit::assertEquals($this->app['url']->to($uri), $this->response->headers->get('Location'));
+
+ $this->assertSessionHasAll($with);
+ }
+
+ /**
+ * Assert whether the client was redirected to a given route.
+ *
+ * @param string $name
+ * @param array $parameters
+ * @param array $with
+ * @return void
+ */
+ public function assertRedirectedToRoute($name, $parameters = [], $with = [])
+ {
+ $this->assertRedirectedTo($this->app['url']->route($name, $parameters), $with);
+ }
+
+ /**
+ * Assert that the session has a given list of values.
+ *
+ * @param string|array $key
+ * @param mixed $value
+ * @return void
+ */
+ public function assertSessionHas($key, $value = null)
+ {
+ if (is_array($key)) {
+ return $this->assertSessionHasAll($key);
+ }
+
+ if (is_null($value)) {
+ PHPUnit::assertTrue($this->app['session.store']->has($key), "Session missing key: $key");
+ } else {
+ PHPUnit::assertEquals($value, $this->app['session.store']->get($key));
+ }
+ }
+
+ /**
+ * Assert that the session has a given list of values.
+ *
+ * @param array $bindings
+ * @return void
+ */
+ public function assertSessionHasAll(array $bindings)
+ {
+ foreach ($bindings as $key => $value) {
+ if (is_int($key)) {
+ $this->assertSessionHas($value);
+ } else {
+ $this->assertSessionHas($key, $value);
+ }
+ }
+ }
+
+ /**
+ * Assert that the session has errors bound.
+ *
+ * @param string|array $bindings
+ * @param mixed $format
+ * @return void
+ */
+ public function assertSessionHasErrors($bindings = [], $format = null)
+ {
+ $this->assertSessionHas('errors');
+
+ $bindings = (array) $bindings;
+
+ $errors = $this->app['session.store']->get('errors');
+
+ foreach ($bindings as $key => $value) {
+ if (is_int($key)) {
+ PHPUnit::assertTrue($errors->has($value), "Session missing error: $value");
+ } else {
+ PHPUnit::assertContains($value, $errors->get($key, $format));
+ }
+ }
+ }
+
+ /**
+ * Assert that the session has old input.
+ *
+ * @return void
+ */
+ public function assertHasOldInput()
+ {
+ $this->assertSessionHas('_old_input');
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Testing/CrawlerTrait.php b/vendor/laravel/lumen-framework/src/Testing/CrawlerTrait.php
new file mode 100644
index 00000000..f42971b3
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Testing/CrawlerTrait.php
@@ -0,0 +1,772 @@
+makeRequest('GET', $uri);
+ }
+
+ /**
+ * Visit the given URI with a GET request.
+ *
+ * @param string $uri
+ * @param array $headers
+ * @return $this
+ */
+ public function get($uri, array $headers = [])
+ {
+ $server = $this->transformHeadersToServerVars($headers);
+
+ $this->call('GET', $uri, [], [], [], $server);
+
+ return $this;
+ }
+
+ /**
+ * Visit the given URI with a POST request.
+ *
+ * @param string $uri
+ * @param array $data
+ * @param array $headers
+ * @return $this
+ */
+ public function post($uri, array $data = [], array $headers = [])
+ {
+ $server = $this->transformHeadersToServerVars($headers);
+
+ $this->call('POST', $uri, $data, [], [], $server);
+
+ return $this;
+ }
+
+ /**
+ * Visit the given URI with a PUT request.
+ *
+ * @param string $uri
+ * @param array $data
+ * @param array $headers
+ * @return $this
+ */
+ public function put($uri, array $data = [], array $headers = [])
+ {
+ $server = $this->transformHeadersToServerVars($headers);
+
+ $this->call('PUT', $uri, $data, [], [], $server);
+
+ return $this;
+ }
+
+ /**
+ * Visit the given URI with a PATCH request.
+ *
+ * @param string $uri
+ * @param array $data
+ * @param array $headers
+ * @return $this
+ */
+ public function patch($uri, array $data = [], array $headers = [])
+ {
+ $server = $this->transformHeadersToServerVars($headers);
+
+ $this->call('PATCH', $uri, $data, [], [], $server);
+
+ return $this;
+ }
+
+ /**
+ * Visit the given URI with a DELETE request.
+ *
+ * @param string $uri
+ * @param array $data
+ * @param array $headers
+ * @return $this
+ */
+ public function delete($uri, array $data = [], array $headers = [])
+ {
+ $server = $this->transformHeadersToServerVars($headers);
+
+ $this->call('DELETE', $uri, $data, [], [], $server);
+
+ return $this;
+ }
+
+ /**
+ * Send the given request through the application.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @return $this
+ */
+ public function handle(Request $request)
+ {
+ $this->currentUri = $request->fullUrl();
+
+ $this->response = $this->app->prepareResponse($this->app->handle($request));
+
+ return $this;
+ }
+
+ /**
+ * Transform headers array to array of $_SERVER vars with HTTP_* format.
+ *
+ * @param array $headers
+ *
+ * @return array
+ */
+ protected function transformHeadersToServerVars(array $headers)
+ {
+ $server = [];
+ $prefix = 'HTTP_';
+
+ foreach ($headers as $name => $value) {
+ $name = strtr(strtoupper($name), '-', '_');
+
+ if (! starts_with($name, $prefix) && $name != 'CONTENT_TYPE') {
+ $name = $prefix.$name;
+ }
+
+ $server[$name] = $value;
+ }
+
+ return $server;
+ }
+
+ /**
+ * Make a request to the application and create a Crawler instance.
+ *
+ * @param string $method
+ * @param string $uri
+ * @param array $parameters
+ * @param array $cookies
+ * @param array $files
+ * @return $this
+ */
+ protected function makeRequest($method, $uri, $parameters = [], $cookies = [], $files = [])
+ {
+ $uri = $this->prepareUrlForRequest($uri);
+
+ $this->call($method, $uri, $parameters, $cookies, $files);
+
+ $this->clearInputs()->followRedirects()->assertPageLoaded($uri);
+
+ $this->currentUri = $this->app->make('request')->fullUrl();
+
+ $this->crawler = new Crawler($this->response->getContent(), $uri);
+
+ return $this;
+ }
+
+ /**
+ * Make a request to the application using the given form.
+ *
+ * @param \Symfony\Component\DomCrawler\Form $form
+ * @return $this
+ */
+ protected function makeRequestUsingForm(Form $form)
+ {
+ return $this->makeRequest(
+ $form->getMethod(), $form->getUri(), $this->extractParametersFromForm($form), [], $form->getFiles()
+ );
+ }
+
+ /**
+ * Extract the parameters from the given form.
+ *
+ * @param \Symfony\Component\DomCrawler\Form $form
+ * @return array
+ */
+ protected function extractParametersFromForm(Form $form)
+ {
+ parse_str(http_build_query($form->getValues()), $parameters);
+
+ return $parameters;
+ }
+
+ /**
+ * Follow redirects from the last response.
+ *
+ * @return $this
+ */
+ protected function followRedirects()
+ {
+ while ($this->response->isRedirect()) {
+ $this->makeRequest('GET', $this->response->getTargetUrl());
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clear the inputs for the current page.
+ *
+ * @return $this
+ */
+ protected function clearInputs()
+ {
+ $this->inputs = [];
+
+ return $this;
+ }
+
+ /**
+ * Assert that a given page successfully loaded.
+ *
+ * @param string $uri
+ * @param string|null $message
+ * @return void
+ */
+ protected function assertPageLoaded($uri, $message = null)
+ {
+ $status = $this->response->getStatusCode();
+
+ try {
+ $this->assertEquals(200, $status);
+ } catch (PHPUnitException $e) {
+ $message = $message ?: "A request to [{$uri}] failed. Received status code [{$status}].";
+
+ throw new PHPUnitException($message, null, $this->response->exception);
+ }
+ }
+
+ /**
+ * Assert that a given string is seen on the page.
+ *
+ * @param string $text
+ * @param bool $negate
+ * @return $this
+ */
+ protected function see($text, $negate = false)
+ {
+ $method = $negate ? 'assertNotRegExp' : 'assertRegExp';
+
+ $this->$method('/'.preg_quote($text, '/').'/i', $this->response->getContent());
+
+ return $this;
+ }
+
+ /**
+ * Assert that a given string is not seen on the page.
+ *
+ * @param string $text
+ * @return $this
+ */
+ protected function dontSee($text)
+ {
+ return $this->see($text, true);
+ }
+
+ /**
+ * Assert that the response contains JSON.
+ *
+ * @param array|null $data
+ * @return $this
+ */
+ protected function shouldReturnJson(array $data = null)
+ {
+ return $this->receiveJson($data);
+ }
+
+ /**
+ * Assert that the response contains JSON.
+ *
+ * @param array|null $data
+ * @return $this
+ */
+ protected function receiveJson($data = null)
+ {
+ $this->seeJson();
+
+ if (! is_null($data)) {
+ return $this->seeJson($data);
+ }
+ }
+
+ /**
+ * Assert that the response contains an exact JSON array.
+ *
+ * @param array $data
+ * @return $this
+ */
+ public function seeJsonEquals(array $data)
+ {
+ $actual = json_encode(array_sort_recursive(
+ json_decode($this->response->getContent(), true)
+ ));
+
+ $this->assertEquals(json_encode(array_sort_recursive($data)), $actual);
+
+ return $this;
+ }
+
+ /**
+ * Assert that the response contains JSON.
+ *
+ * @param array|null $data
+ * @return $this
+ */
+ public function seeJson(array $data = null)
+ {
+ $this->assertJson(
+ $this->response->getContent(), "Failed asserting that JSON returned [{$this->currentUri}]."
+ );
+
+ return is_null($data) ? $this : $this->seeJsonContains($data);
+ }
+
+ /**
+ * Assert that the response contains the given JSON.
+ *
+ * @param array $data
+ * @return $this
+ */
+ protected function seeJsonContains(array $data)
+ {
+ $actual = json_encode(array_sort_recursive(
+ json_decode($this->response->getContent(), true)
+ ));
+
+ foreach (array_sort_recursive(json_decode(json_encode($data), true)) as $key => $value) {
+ $expected = $this->formatToExpectedJson($key, $value);
+
+ $this->assertTrue(
+ str_contains($actual, $this->formatToExpectedJson($key, $value)),
+ "Unable to find JSON fragment [{$expected}] within [{$actual}]."
+ );
+ }
+
+ return $this;
+ }
+
+ /**
+ * Format the given key and value into a JSON string for expectation checks.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return string
+ */
+ protected function formatToExpectedJson($key, $value)
+ {
+ $expected = json_encode([$key => $value]);
+
+ if (starts_with($expected, '{')) {
+ $expected = substr($expected, 1);
+ }
+
+ if (ends_with($expected, '}')) {
+ $expected = substr($expected, 0, -1);
+ }
+
+ return $expected;
+ }
+
+ /**
+ * Asserts that the status code of the response matches the given code.
+ *
+ * @param int $status
+ * @return $this
+ */
+ protected function seeStatusCode($status)
+ {
+ $this->assertEquals($status, $this->response->getStatusCode());
+
+ return $this;
+ }
+
+ /**
+ * Assert that the current page matches a given URI.
+ *
+ * @param string $uri
+ * @return $this
+ */
+ protected function seePageIs($uri)
+ {
+ return $this->landOn($uri);
+ }
+
+ /**
+ * Assert that the current page matches a given URI.
+ *
+ * @param string $uri
+ * @return $this
+ */
+ protected function onPage($uri)
+ {
+ return $this->landOn($uri);
+ }
+
+ /**
+ * Assert that the current page matches a given URI.
+ *
+ * @param string $uri
+ * @return $this
+ */
+ protected function landOn($uri)
+ {
+ $this->assertPageLoaded($uri = $this->prepareUrlForRequest($uri));
+
+ $this->assertEquals(
+ $uri, $this->currentUri, "Did not land on expected page [{$uri}].\n"
+ );
+
+ return $this;
+ }
+
+ /**
+ * Click a link with the given body, name, or ID attribute.
+ *
+ * @param string $name
+ * @return $this
+ */
+ protected function click($name)
+ {
+ $link = $this->crawler->selectLink($name);
+
+ if (! count($link)) {
+ $link = $this->filterByNameOrId($name, 'a');
+
+ if (! count($link)) {
+ throw new InvalidArgumentException(
+ "Could not find a link with a body, name, or ID attribute of [{$name}]."
+ );
+ }
+ }
+
+ $this->visit($link->link()->getUri());
+
+ return $this;
+ }
+
+ /**
+ * Fill an input field with the given text.
+ *
+ * @param string $text
+ * @param string $element
+ * @return $this
+ */
+ protected function type($text, $element)
+ {
+ return $this->storeInput($element, $text);
+ }
+
+ /**
+ * Check a checkbox on the page.
+ *
+ * @param string $element
+ * @return $this
+ */
+ protected function check($element)
+ {
+ return $this->storeInput($element, true);
+ }
+
+ /**
+ * Select an option from a drop-down.
+ *
+ * @param string $option
+ * @param string $element
+ * @return $this
+ */
+ protected function select($option, $element)
+ {
+ return $this->storeInput($element, $option);
+ }
+
+ /**
+ * Attach a file to a form field on the page.
+ *
+ * @param string $absolutePath
+ * @param string $element
+ * @return $this
+ */
+ protected function attach($absolutePath, $element)
+ {
+ return $this->storeInput($element, $absolutePath);
+ }
+
+ /**
+ * Submit a form using the button with the given text value.
+ *
+ * @param string $buttonText
+ * @return $this
+ */
+ protected function press($buttonText)
+ {
+ return $this->submitForm($buttonText, $this->inputs);
+ }
+
+ /**
+ * Submit a form on the page with the given input.
+ *
+ * @param string $buttonText
+ * @param array $inputs
+ * @return $this
+ */
+ protected function submitForm($buttonText, $inputs = [])
+ {
+ $this->makeRequestUsingForm($this->fillForm($buttonText, $inputs));
+
+ return $this;
+ }
+
+ /**
+ * Fill the form with the given data.
+ *
+ * @param string $buttonText
+ * @param array $inputs
+ * @return \Symfony\Component\DomCrawler\Form
+ */
+ protected function fillForm($buttonText, $inputs = [])
+ {
+ if (! is_string($buttonText)) {
+ $inputs = $buttonText;
+
+ $buttonText = null;
+ }
+
+ return $this->getForm($buttonText)->setValues($inputs);
+ }
+
+ /**
+ * Get the form from the page with the given submit button text.
+ *
+ * @param string|null $buttonText
+ * @return \Symfony\Component\DomCrawler\Form
+ */
+ protected function getForm($buttonText = null)
+ {
+ try {
+ if ($buttonText) {
+ return $this->crawler->selectButton($buttonText)->form();
+ }
+
+ return $this->crawler->filter('form')->form();
+ } catch (InvalidArgumentException $e) {
+ throw new InvalidArgumentException(
+ "Could not find a form that has submit button [{$buttonText}]."
+ );
+ }
+ }
+
+ /**
+ * Store a form input in the local array.
+ *
+ * @param string $element
+ * @param string $text
+ * @return $this
+ */
+ protected function storeInput($element, $text)
+ {
+ $this->assertFilterProducesResults($element);
+
+ $element = str_replace('#', '', $element);
+
+ $this->inputs[$element] = $text;
+
+ return $this;
+ }
+
+ /**
+ * Assert that a filtered Crawler returns nodes.
+ *
+ * @param string $filter
+ * @return void
+ */
+ protected function assertFilterProducesResults($filter)
+ {
+ $crawler = $this->filterByNameOrId($filter);
+
+ if (! count($crawler)) {
+ throw new InvalidArgumentException(
+ "Nothing matched the filter [{$filter}] CSS query provided for [{$this->currentUri}]."
+ );
+ }
+ }
+
+ /**
+ * Filter elements according to the given name or ID attribute.
+ *
+ * @param string $name
+ * @param string $element
+ * @return \Symfony\Component\DomCrawler\Crawler
+ */
+ protected function filterByNameOrId($name, $element = '*')
+ {
+ $name = str_replace('#', '', $name);
+
+ return $this->crawler->filter("{$element}#{$name}, {$element}[name='{$name}']");
+ }
+
+ /**
+ * Call the given URI and return the Response.
+ *
+ * @param string $method
+ * @param string $uri
+ * @param array $parameters
+ * @param array $cookies
+ * @param array $files
+ * @param array $server
+ * @param string $content
+ * @return \Illuminate\Http\Response
+ */
+ public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
+ {
+ $this->currentUri = $this->prepareUrlForRequest($uri);
+
+ $request = Request::create(
+ $this->currentUri, $method, $parameters,
+ $cookies, $files, $server, $content
+ );
+
+ return $this->response = $this->app->prepareResponse($this->app->handle($request));
+ }
+
+ /**
+ * Call the given HTTPS URI and return the Response.
+ *
+ * @param string $method
+ * @param string $uri
+ * @param array $parameters
+ * @param array $cookies
+ * @param array $files
+ * @param array $server
+ * @param string $content
+ * @return \Illuminate\Http\Response
+ */
+ public function callSecure($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
+ {
+ $uri = $this->app['url']->secure(ltrim($uri, '/'));
+
+ return $this->response = $this->call($method, $uri, $parameters, $cookies, $files, $server, $content);
+ }
+
+ /**
+ * Call a controller action and return the Response.
+ *
+ * @param string $method
+ * @param string $action
+ * @param array $wildcards
+ * @param array $parameters
+ * @param array $cookies
+ * @param array $files
+ * @param array $server
+ * @param string $content
+ * @return \Illuminate\Http\Response
+ */
+ public function action($method, $action, $wildcards = [], $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
+ {
+ $uri = $this->app['url']->action($action, $wildcards, true);
+
+ return $this->response = $this->call($method, $uri, $parameters, $cookies, $files, $server, $content);
+ }
+
+ /**
+ * Call a named route and return the Response.
+ *
+ * @param string $method
+ * @param string $name
+ * @param array $routeParameters
+ * @param array $parameters
+ * @param array $cookies
+ * @param array $files
+ * @param array $server
+ * @param string $content
+ * @return \Illuminate\Http\Response
+ */
+ public function route($method, $name, $routeParameters = [], $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
+ {
+ $uri = $this->app['url']->route($name, $routeParameters);
+
+ return $this->response = $this->call($method, $uri, $parameters, $cookies, $files, $server, $content);
+ }
+
+ /**
+ * Turn the given URI into a fully qualified URL.
+ *
+ * @param string $uri
+ * @return string
+ */
+ protected function prepareUrlForRequest($uri)
+ {
+ if (starts_with($uri, '/')) {
+ $uri = substr($uri, 1);
+ }
+
+ if (! starts_with($uri, 'http')) {
+ $uri = $this->baseUrl.'/'.$uri;
+ }
+
+ return trim($uri, '/');
+ }
+
+ /**
+ * Disable middleware for the test.
+ *
+ * @return $this
+ */
+ public function withoutMiddleware()
+ {
+ $this->app->instance('middleware.disable', true);
+
+ return $this;
+ }
+
+ /**
+ * Dump the content from the last response.
+ *
+ * @return void
+ */
+ public function dump()
+ {
+ $content = $this->response->getContent();
+
+ $json = json_decode($content);
+
+ if (json_last_error() === JSON_ERROR_NONE) {
+ $content = $json;
+ }
+
+ dd($content);
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/Testing/TestCase.php b/vendor/laravel/lumen-framework/src/Testing/TestCase.php
new file mode 100644
index 00000000..591b44d5
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/Testing/TestCase.php
@@ -0,0 +1,78 @@
+app) {
+ $this->refreshApplication();
+ }
+ }
+
+ /**
+ * Clean up the testing environment before the next test.
+ *
+ * @return void
+ */
+ public function tearDown()
+ {
+ if (class_exists('Mockery')) {
+ Mockery::close();
+ }
+
+ if ($this->app) {
+ foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {
+ call_user_func($callback);
+ }
+
+ $this->app->flush();
+ $this->app = null;
+ }
+ }
+
+ /**
+ * Register a callback to be run before the application is destroyed.
+ *
+ * @param callable $callback
+ * @return void
+ */
+ protected function beforeApplicationDestroyed(callable $callback)
+ {
+ $this->beforeApplicationDestroyedCallbacks[] = $callback;
+ }
+}
diff --git a/vendor/laravel/lumen-framework/src/helpers.php b/vendor/laravel/lumen-framework/src/helpers.php
new file mode 100644
index 00000000..80f1cfb6
--- /dev/null
+++ b/vendor/laravel/lumen-framework/src/helpers.php
@@ -0,0 +1,427 @@
+abort($code, $message, $headers);
+ }
+}
+
+if (! function_exists('app')) {
+ /**
+ * Get the available container instance.
+ *
+ * @param string $make
+ * @param array $parameters
+ * @return mixed|\Laravel\Lumen\Application
+ */
+ function app($make = null, $parameters = [])
+ {
+ if (is_null($make)) {
+ return Container::getInstance();
+ }
+
+ return Container::getInstance()->make($make, $parameters);
+ }
+}
+
+if (! function_exists('base_path')) {
+ /**
+ * Get the path to the base of the install.
+ *
+ * @param string $path
+ * @return string
+ */
+ function base_path($path = '')
+ {
+ return app()->basePath().($path ? '/'.$path : $path);
+ }
+}
+
+if (! function_exists('bcrypt')) {
+ /**
+ * Hash the given value.
+ *
+ * @param string $value
+ * @param array $options
+ * @return string
+ */
+ function bcrypt($value, $options = [])
+ {
+ return app('hash')->make($value, $options);
+ }
+}
+
+if (! function_exists('config')) {
+ /**
+ * Get / set the specified configuration value.
+ *
+ * If an array is passed as the key, we will assume you want to set an array of values.
+ *
+ * @param array|string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ function config($key = null, $default = null)
+ {
+ if (is_null($key)) {
+ return app('config');
+ }
+
+ if (is_array($key)) {
+ return app('config')->set($key);
+ }
+
+ return app('config')->get($key, $default);
+ }
+}
+
+if (! function_exists('cookie')) {
+ /**
+ * Create a new cookie instance.
+ *
+ * @param string $name
+ * @param string $value
+ * @param int $minutes
+ * @param string $path
+ * @param string $domain
+ * @param bool $secure
+ * @param bool $httpOnly
+ * @return \Symfony\Component\HttpFoundation\Cookie
+ */
+ function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true)
+ {
+ $cookie = app('cookie');
+
+ if (is_null($name)) {
+ return $cookie;
+ }
+
+ return $cookie->make($name, $value, $minutes, $path, $domain, $secure, $httpOnly);
+ }
+}
+
+if (! function_exists('csrf_token')) {
+ /**
+ * Get the CSRF token value.
+ *
+ * @return string
+ *
+ * @throws RuntimeException
+ */
+ function csrf_token()
+ {
+ $session = app('session');
+ if (isset($session)) {
+ return $session->getToken();
+ }
+ throw new RuntimeException('Application session store not set.');
+ }
+}
+
+if (! function_exists('database_path')) {
+ /**
+ * Get the path to the database directory of the install.
+ *
+ * @param string $path
+ * @return string
+ */
+ function database_path($path = '')
+ {
+ return app()->databasePath().($path ? '/'.$path : $path);
+ }
+}
+
+if (! function_exists('env')) {
+ /**
+ * Gets the value of an environment variable. Supports boolean, empty and null.
+ *
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ function env($key, $default = null)
+ {
+ $value = getenv($key);
+
+ if ($value === false) {
+ return value($default);
+ }
+
+ switch (strtolower($value)) {
+ case 'true':
+ case '(true)':
+ return true;
+
+ case 'false':
+ case '(false)':
+ return false;
+
+ case 'empty':
+ case '(empty)':
+ return '';
+
+ case 'null':
+ case '(null)':
+ return;
+ }
+
+ if (Str::startsWith($value, '"') && Str::endsWith($value, '"')) {
+ return substr($value, 1, -1);
+ }
+
+ return $value;
+ }
+}
+
+if (! function_exists('event')) {
+ /**
+ * Fire an event and call the listeners.
+ *
+ * @param string $event
+ * @param mixed $payload
+ * @param bool $halt
+ * @return array|null
+ */
+ function event($event, $payload = [], $halt = false)
+ {
+ return app('events')->fire($event, $payload, $halt);
+ }
+}
+
+if (! function_exists('factory')) {
+ /**
+ * Create a model factory builder for a given class, name, and amount.
+ *
+ * @param dynamic class|class,name|class,amount|class,name,amount
+ * @return \Illuminate\Database\Eloquent\FactoryBuilder
+ */
+ function factory()
+ {
+ app('db');
+
+ $factory = app('Illuminate\Database\Eloquent\Factory');
+
+ $arguments = func_get_args();
+
+ if (isset($arguments[1]) && is_string($arguments[1])) {
+ return $factory->of($arguments[0], $arguments[1])->times(isset($arguments[2]) ? $arguments[2] : 1);
+ } elseif (isset($arguments[1])) {
+ return $factory->of($arguments[0])->times($arguments[1]);
+ } else {
+ return $factory->of($arguments[0]);
+ }
+ }
+}
+
+if (! function_exists('info')) {
+ /**
+ * Write some information to the log.
+ *
+ * @param string $message
+ * @param array $context
+ * @return void
+ */
+ function info($message, $context = [])
+ {
+ return app('Psr\Log\LoggerInterface')->info($message, $context);
+ }
+}
+
+if (! function_exists('old')) {
+ /**
+ * Retrieve an old input item.
+ *
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ function old($key = null, $default = null)
+ {
+ return app('request')->old($key, $default);
+ }
+}
+
+if (! function_exists('redirect')) {
+ /**
+ * Get an instance of the redirector.
+ *
+ * @param string|null $to
+ * @param int $status
+ * @param array $headers
+ * @param bool $secure
+ * @return \Laravel\Lumen\Http\Redirector|\Illuminate\Http\RedirectResponse
+ */
+ function redirect($to = null, $status = 302, $headers = [], $secure = null)
+ {
+ $redirector = new Laravel\Lumen\Http\Redirector(app());
+
+ if (is_null($to)) {
+ return $redirector;
+ }
+
+ return $redirector->to($to, $status, $headers, $secure);
+ }
+}
+
+if (! function_exists('response')) {
+ /**
+ * Return a new response from the application.
+ *
+ * @param string $content
+ * @param int $status
+ * @param array $headers
+ * @return \Symfony\Component\HttpFoundation\Response|\Laravel\Lumen\Http\ResponseFactory
+ */
+ function response($content = '', $status = 200, array $headers = [])
+ {
+ $factory = new Laravel\Lumen\Http\ResponseFactory;
+
+ if (func_num_args() === 0) {
+ return $factory;
+ }
+
+ return $factory->make($content, $status, $headers);
+ }
+}
+
+if (! function_exists('route')) {
+ /**
+ * Generate a URL to a named route.
+ *
+ * @param string $name
+ * @param array $parameters
+ * @return string
+ */
+ function route($name, $parameters = [])
+ {
+ return (new Laravel\Lumen\Routing\UrlGenerator(app()))
+ ->route($name, $parameters);
+ }
+}
+
+if (! function_exists('session')) {
+ /**
+ * Get / set the specified session value.
+ *
+ * If an array is passed as the key, we will assume you want to set an array of values.
+ *
+ * @param array|string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ function session($key = null, $default = null)
+ {
+ $session = app('session');
+
+ if (is_null($key)) {
+ return $session;
+ }
+ if (is_array($key)) {
+ return $session->put($key);
+ }
+
+ return $session->get($key, $default);
+ }
+}
+
+if (! function_exists('storage_path')) {
+ /**
+ * Get the path to the storage folder.
+ *
+ * @param string $path
+ * @return string
+ */
+ function storage_path($path = '')
+ {
+ return app()->storagePath($path);
+ }
+}
+
+if (! function_exists('trans')) {
+ /**
+ * Translate the given message.
+ *
+ * @param string $id
+ * @param array $parameters
+ * @param string $domain
+ * @param string $locale
+ * @return string
+ */
+ function trans($id = null, $parameters = [], $domain = 'messages', $locale = null)
+ {
+ if (is_null($id)) {
+ return app('translator');
+ }
+
+ return app('translator')->trans($id, $parameters, $domain, $locale);
+ }
+}
+
+if (! function_exists('trans_choice')) {
+ /**
+ * Translates the given message based on a count.
+ *
+ * @param string $id
+ * @param int $number
+ * @param array $parameters
+ * @param string $domain
+ * @param string $locale
+ * @return string
+ */
+ function trans_choice($id, $number, array $parameters = [], $domain = 'messages', $locale = null)
+ {
+ return app('translator')->transChoice($id, $number, $parameters, $domain, $locale);
+ }
+}
+
+if (! function_exists('url')) {
+ /**
+ * Generate a url for the application.
+ *
+ * @param string $path
+ * @param mixed $parameters
+ * @param bool $secure
+ * @return string
+ */
+ function url($path = null, $parameters = [], $secure = null)
+ {
+ return (new Laravel\Lumen\Routing\UrlGenerator(app()))
+ ->to($path, $parameters, $secure);
+ }
+}
+
+if (! function_exists('view')) {
+ /**
+ * Get the evaluated view contents for the given view.
+ *
+ * @param string $view
+ * @param array $data
+ * @param array $mergeData
+ * @return \Illuminate\View\View
+ */
+ function view($view = null, $data = [], $mergeData = [])
+ {
+ $factory = app('view');
+
+ if (func_num_args() === 0) {
+ return $factory;
+ }
+
+ return $factory->make($view, $data, $mergeData);
+ }
+}
diff --git a/vendor/laravel/lumen-framework/storage/logs/.gitignore b/vendor/laravel/lumen-framework/storage/logs/.gitignore
new file mode 100644
index 00000000..d6b7ef32
--- /dev/null
+++ b/vendor/laravel/lumen-framework/storage/logs/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/vendor/laravel/lumen-framework/tests/FullApplicationTest.php b/vendor/laravel/lumen-framework/tests/FullApplicationTest.php
new file mode 100644
index 00000000..0dd3a7c5
--- /dev/null
+++ b/vendor/laravel/lumen-framework/tests/FullApplicationTest.php
@@ -0,0 +1,496 @@
+get('/', function () {
+ return response('Hello World');
+ });
+
+ $response = $app->handle(Request::create('/', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Hello World', $response->getContent());
+ }
+
+ public function testRequestWithoutSymfonyClass()
+ {
+ $app = new Application;
+
+ $app->get('/', function () {
+ return response('Hello World');
+ });
+
+ $_SERVER['REQUEST_METHOD'] = 'GET';
+ $_SERVER['REQUEST_URI'] = '/';
+
+ $response = $app->dispatch();
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Hello World', $response->getContent());
+
+ unset($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);
+ }
+
+ public function testRequestWithoutSymfonyClassTrailingSlash()
+ {
+ $app = new Application;
+
+ $app->get('/foo', function () {
+ return response('Hello World');
+ });
+
+ $_SERVER['REQUEST_METHOD'] = 'GET';
+ $_SERVER['REQUEST_URI'] = '/foo/';
+
+ $response = $app->dispatch();
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Hello World', $response->getContent());
+
+ unset($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);
+ }
+
+ public function testRequestWithParameters()
+ {
+ $app = new Application;
+
+ $app->get('/foo/{bar}/{baz}', function ($bar, $baz) {
+ return response($bar.$baz);
+ });
+
+ $response = $app->handle(Request::create('/foo/1/2', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('12', $response->getContent());
+ }
+
+ public function testRequestToControllerWithParameters()
+ {
+ $app = new Application;
+
+ $app->get('/foo/{bar}', 'LumenTestController@actionWithParameter');
+
+ $response = $app->handle(Request::create('/foo/1', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('1', $response->getContent());
+ }
+
+ public function testCallbackRouteWithDefaultParameter()
+ {
+ $app = new Application;
+ $app->get('/foo-bar/{baz}', function ($baz = 'default-value') {
+ return response($baz);
+ });
+
+ $response = $app->handle(Request::create('/foo-bar/something', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('something', $response->getContent());
+ }
+
+ public function testControllerRouteWithDefaultParameter()
+ {
+ $app = new Application;
+ $app->get('/foo-bar/{baz}', 'LumenTestController@actionWithDefaultParameter');
+
+ $response = $app->handle(Request::create('/foo-bar/something2', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('something2', $response->getContent());
+ }
+
+ public function testGlobalMiddleware()
+ {
+ $app = new Application;
+
+ $app->middleware(['LumenTestMiddleware']);
+
+ $app->get('/', function () {
+ return response('Hello World');
+ });
+
+ $response = $app->handle(Request::create('/', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Middleware', $response->getContent());
+ }
+
+ public function testRouteMiddleware()
+ {
+ $app = new Application;
+
+ $app->routeMiddleware(['foo' => 'LumenTestMiddleware']);
+
+ $app->get('/', function () {
+ return response('Hello World');
+ });
+
+ $app->get('/foo', ['middleware' => 'foo', function () {
+ return response('Hello World');
+ }]);
+
+ $response = $app->handle(Request::create('/', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Hello World', $response->getContent());
+
+ $response = $app->handle(Request::create('/foo', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Middleware', $response->getContent());
+ }
+
+ public function testGlobalMiddlewareParameters()
+ {
+ $app = new Application;
+
+ $app->middleware(['LumenTestParameterizedMiddleware:foo,bar']);
+
+ $app->get('/', function () {
+ return response('Hello World');
+ });
+
+ $response = $app->handle(Request::create('/', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Middleware - foo - bar', $response->getContent());
+ }
+
+ public function testRouteMiddlewareParameters()
+ {
+ $app = new Application;
+
+ $app->routeMiddleware(['foo' => 'LumenTestParameterizedMiddleware']);
+
+ $app->get('/', ['middleware' => 'foo:bar,boom', function () {
+ return response('Hello World');
+ }]);
+
+ $response = $app->handle(Request::create('/', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Middleware - bar - boom', $response->getContent());
+ }
+
+ public function testGroupRouteMiddleware()
+ {
+ $app = new Application;
+
+ $app->routeMiddleware(['foo' => 'LumenTestMiddleware']);
+
+ $app->group(['middleware' => 'foo'], function ($app) {
+ $app->get('/', function () {
+ return 'Hello World';
+ });
+ $app->group([], function () {});
+ $app->get('/fooBar', function () {
+ return 'Hello World';
+ });
+ });
+
+ $app->get('/foo', function () {
+ return 'Hello World';
+ });
+
+ $response = $app->handle(Request::create('/', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Middleware', $response->getContent());
+
+ $response = $app->handle(Request::create('/foo', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Hello World', $response->getContent());
+
+ $response = $app->handle(Request::create('/fooBar', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Middleware', $response->getContent());
+ }
+
+ public function testWithMiddlewareDisabled()
+ {
+ $app = new Application;
+
+ $app->middleware(['LumenTestMiddleware']);
+ $app->instance('middleware.disable', true);
+
+ $app->get('/', function () {
+ return response('Hello World');
+ });
+
+ $response = $app->handle(Request::create('/', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Hello World', $response->getContent());
+ }
+
+ public function testGroupPrefixRoutes()
+ {
+ $app = new Application;
+
+ $app->group(['prefix' => 'user'], function ($app) {
+ $app->get('/', function () {
+ return response('User Index');
+ });
+
+ $app->get('profile', function () {
+ return response('User Profile');
+ });
+
+ $app->get('/show', function () {
+ return response('User Show');
+ });
+ });
+
+ $response = $app->handle(Request::create('/user', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('User Index', $response->getContent());
+
+ $response = $app->handle(Request::create('/user/profile', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('User Profile', $response->getContent());
+
+ $response = $app->handle(Request::create('/user/show', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('User Show', $response->getContent());
+ }
+
+ public function testNotFoundResponse()
+ {
+ $app = new Application;
+ $app->instance('Illuminate\Contracts\Debug\ExceptionHandler', $mock = m::mock('Laravel\Lumen\Exceptions\Handler[report]'));
+ $mock->shouldIgnoreMissing();
+
+ $app->get('/', function () {
+ return response('Hello World');
+ });
+
+ $response = $app->handle(Request::create('/foo', 'GET'));
+
+ $this->assertEquals(404, $response->getStatusCode());
+ }
+
+ public function testMethodNotAllowedResponse()
+ {
+ $app = new Application;
+ $app->instance('Illuminate\Contracts\Debug\ExceptionHandler', $mock = m::mock('Laravel\Lumen\Exceptions\Handler[report]'));
+ $mock->shouldIgnoreMissing();
+
+ $app->post('/', function () {
+ return response('Hello World');
+ });
+
+ $response = $app->handle(Request::create('/', 'GET'));
+
+ $this->assertEquals(405, $response->getStatusCode());
+ }
+
+ public function testControllerResponse()
+ {
+ $app = new Application;
+
+ $app->get('/', 'LumenTestController@action');
+
+ $response = $app->handle(Request::create('/', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('LumenTestController', $response->getContent());
+ }
+
+ public function testNamespacedControllerResponse()
+ {
+ $app = new Application;
+
+ require_once __DIR__.'/fixtures/TestController.php';
+
+ $app->group(['namespace' => 'Lumen\Tests'], function ($app) {
+ $app->get('/', 'TestController@action');
+ $app->group([], function () {});
+ $app->get('/foo', 'TestController@action');
+ });
+
+ $response = $app->handle(Request::create('/', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Lumen\Tests\TestController', $response->getContent());
+
+ $response = $app->handle(Request::create('/foo', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Lumen\Tests\TestController', $response->getContent());
+ }
+
+ public function testGeneratingUrls()
+ {
+ $app = new Application;
+ $app->instance('request', Request::create('http://lumen.laravel.com', 'GET'));
+ unset($app->availableBindings['request']);
+
+ $app->get('/foo-bar', ['as' => 'foo', function () {
+ //
+ }]);
+
+ $app->get('/foo-bar/{baz}/{boom}', ['as' => 'bar', function () {
+ //
+ }]);
+
+ $this->assertEquals('http://lumen.laravel.com/something', url('something'));
+ $this->assertEquals('http://lumen.laravel.com/foo-bar', route('foo'));
+ $this->assertEquals('http://lumen.laravel.com/foo-bar/1/2', route('bar', ['baz' => 1, 'boom' => 2]));
+ $this->assertEquals('http://lumen.laravel.com/foo-bar?baz=1&boom=2', route('foo', ['baz' => 1, 'boom' => 2]));
+ }
+
+ public function testGeneratingUrlsForRegexParameters()
+ {
+ $app = new Application;
+ $app->instance('request', Request::create('http://lumen.laravel.com', 'GET'));
+ unset($app->availableBindings['request']);
+
+ $app->get('/foo-bar', ['as' => 'foo', function () {
+ //
+ }]);
+
+ $app->get('/foo-bar/{baz:[0-9]+}/{boom}', ['as' => 'bar', function () {
+ //
+ }]);
+
+ $app->get('/foo-bar/{baz:[0-9]+}/{boom:[0-9]+}', ['as' => 'baz', function () {
+ //
+ }]);
+
+ $app->get('/foo-bar/{baz:[0-9]{2,5}}', ['as' => 'boom', function () {
+ //
+ }]);
+
+ $this->assertEquals('http://lumen.laravel.com/something', url('something'));
+ $this->assertEquals('http://lumen.laravel.com/foo-bar', route('foo'));
+ $this->assertEquals('http://lumen.laravel.com/foo-bar/1/2', route('bar', ['baz' => 1, 'boom' => 2]));
+ $this->assertEquals('http://lumen.laravel.com/foo-bar/1/2', route('baz', ['baz' => 1, 'boom' => 2]));
+ $this->assertEquals('http://lumen.laravel.com/foo-bar/{baz:[0-9]+}/{boom:[0-9]+}?ba=1&bo=2', route('baz', ['ba' => 1, 'bo' => 2]));
+ $this->assertEquals('http://lumen.laravel.com/foo-bar/5', route('boom', ['baz' => 5]));
+ }
+
+ public function testRegisterServiceProvider()
+ {
+ $app = new Application;
+ $provider = new LumenTestServiceProvider($app);
+ $app->register($provider);
+ }
+
+ public function testUsingCustomDispatcher()
+ {
+ $routes = new FastRoute\RouteCollector(new FastRoute\RouteParser\Std, new FastRoute\DataGenerator\GroupCountBased);
+
+ $routes->addRoute('GET', '/', [function () {
+ return response('Hello World');
+ }]);
+
+ $app = new Application;
+
+ $app->setDispatcher(new FastRoute\Dispatcher\GroupCountBased($routes->getData()));
+
+ $response = $app->handle(Request::create('/', 'GET'));
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Hello World', $response->getContent());
+ }
+
+ public function testMiddlewareReceiveResponsesEvenWhenStringReturned()
+ {
+ unset($_SERVER['__middleware.response']);
+
+ $app = new Application;
+
+ $app->routeMiddleware(['foo' => 'LumenTestPlainMiddleware']);
+
+ $app->get('/', ['middleware' => 'foo', function () {
+ return 'Hello World';
+ }]);
+
+ $response = $app->handle(Request::create('/', 'GET'));
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('Hello World', $response->getContent());
+ $this->assertEquals(true, $_SERVER['__middleware.response']);
+ }
+
+ public function testEnvironmentDetection()
+ {
+ $app = new Application;
+
+ $this->assertEquals('production', $app->environment());
+ $this->assertTrue($app->environment('production'));
+ $this->assertTrue($app->environment(['production']));
+ }
+}
+
+class LumenTestService
+{
+}
+
+class LumenTestServiceProvider extends Illuminate\Support\ServiceProvider
+{
+ public function register()
+ {
+ }
+}
+
+class LumenTestMiddleware
+{
+ public function handle($request, $next)
+ {
+ return response('Middleware');
+ }
+}
+
+class LumenTestPlainMiddleware
+{
+ public function handle($request, $next)
+ {
+ $response = $next($request);
+ $_SERVER['__middleware.response'] = $response instanceof Illuminate\Http\Response;
+
+ return $response;
+ }
+}
+
+class LumenTestParameterizedMiddleware
+{
+ public function handle($request, $next, $parameter1, $parameter2)
+ {
+ return response("Middleware - $parameter1 - $parameter2");
+ }
+}
+
+class LumenTestController
+{
+ public $service;
+
+ public function __construct(LumenTestService $service)
+ {
+ $this->service = $service;
+ }
+
+ public function action()
+ {
+ return response(__CLASS__);
+ }
+
+ public function actionWithParameter($baz)
+ {
+ return response($baz);
+ }
+
+ public function actionWithDefaultParameter($baz = 'default-value')
+ {
+ return response($baz);
+ }
+}
diff --git a/vendor/laravel/lumen-framework/tests/fixtures/TestController.php b/vendor/laravel/lumen-framework/tests/fixtures/TestController.php
new file mode 100644
index 00000000..e7879920
--- /dev/null
+++ b/vendor/laravel/lumen-framework/tests/fixtures/TestController.php
@@ -0,0 +1,11 @@
+
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+EOF;
+
+$finder = Symfony\CS\Finder::create()
+ ->files()
+ ->name('*.php')
+ ->exclude('Fixtures')
+ ->in(__DIR__.'/src')
+ ->in(__DIR__.'/tests')
+;
+
+return Symfony\CS\Config::create()
+ ->setUsingCache(true)
+ //->setUsingLinter(false)
+ ->setRiskyAllowed(true)
+ ->setRules(array(
+ '@PSR2' => true,
+ 'binary_operator_spaces' => true,
+ 'blank_line_before_return' => true,
+ 'header_comment' => array('header' => $header),
+ 'include' => true,
+ 'long_array_syntax' => true,
+ 'method_separation' => true,
+ 'no_blank_lines_after_class_opening' => true,
+ 'no_blank_lines_after_phpdoc' => true,
+ 'no_blank_lines_between_uses' => true,
+ 'no_duplicate_semicolons' => true,
+ 'no_extra_consecutive_blank_lines' => true,
+ 'no_leading_import_slash' => true,
+ 'no_leading_namespace_whitespace' => true,
+ 'no_trailing_comma_in_singleline_array' => true,
+ 'no_unused_imports' => true,
+ 'object_operator_without_whitespace' => true,
+ 'phpdoc_align' => true,
+ 'phpdoc_indent' => true,
+ 'phpdoc_no_access' => true,
+ 'phpdoc_no_package' => true,
+ 'phpdoc_order' => true,
+ 'phpdoc_scalar' => true,
+ 'phpdoc_trim' => true,
+ 'phpdoc_type_to_var' => true,
+ 'psr0' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'spaces_cast' => true,
+ 'standardize_not_equals' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline_array' => true,
+ 'whitespacy_lines' => true,
+ ))
+ ->finder($finder)
+;
diff --git a/vendor/monolog/monolog/CHANGELOG.mdown b/vendor/monolog/monolog/CHANGELOG.mdown
new file mode 100644
index 00000000..76ea0ead
--- /dev/null
+++ b/vendor/monolog/monolog/CHANGELOG.mdown
@@ -0,0 +1,328 @@
+### 1.22.0 (2016-11-26)
+
+ * Added SlackbotHandler and SlackWebhookHandler to set up Slack integration more easily
+ * Added MercurialProcessor to add mercurial revision and branch names to log records
+ * Added support for AWS SDK v3 in DynamoDbHandler
+ * Fixed fatal errors occuring when normalizing generators that have been fully consumed
+ * Fixed RollbarHandler to include a level (rollbar level), monolog_level (original name), channel and datetime (unix)
+ * Fixed RollbarHandler not flushing records automatically, calling close() explicitly is not necessary anymore
+ * Fixed SyslogUdpHandler to avoid sending empty frames
+ * Fixed a few PHP 7.0 and 7.1 compatibility issues
+
+### 1.21.0 (2016-07-29)
+
+ * Break: Reverted the addition of $context when the ErrorHandler handles regular php errors from 1.20.0 as it was causing issues
+ * Added support for more formats in RotatingFileHandler::setFilenameFormat as long as they have Y, m and d in order
+ * Added ability to format the main line of text the SlackHandler sends by explictly setting a formatter on the handler
+ * Added information about SoapFault instances in NormalizerFormatter
+ * Added $handleOnlyReportedErrors option on ErrorHandler::registerErrorHandler (default true) to allow logging of all errors no matter the error_reporting level
+
+### 1.20.0 (2016-07-02)
+
+ * Added FingersCrossedHandler::activate() to manually trigger the handler regardless of the activation policy
+ * Added StreamHandler::getUrl to retrieve the stream's URL
+ * Added ability to override addRow/addTitle in HtmlFormatter
+ * Added the $context to context information when the ErrorHandler handles a regular php error
+ * Deprecated RotatingFileHandler::setFilenameFormat to only support 3 formats: Y, Y-m and Y-m-d
+ * Fixed WhatFailureGroupHandler to work with PHP7 throwables
+ * Fixed a few minor bugs
+
+### 1.19.0 (2016-04-12)
+
+ * Break: StreamHandler will not close streams automatically that it does not own. If you pass in a stream (not a path/url), then it will not close it for you. You can retrieve those using getStream() if needed
+ * Added DeduplicationHandler to remove duplicate records from notifications across multiple requests, useful for email or other notifications on errors
+ * Added ability to use `%message%` and other LineFormatter replacements in the subject line of emails sent with NativeMailHandler and SwiftMailerHandler
+ * Fixed HipChatHandler handling of long messages
+
+### 1.18.2 (2016-04-02)
+
+ * Fixed ElasticaFormatter to use more precise dates
+ * Fixed GelfMessageFormatter sending too long messages
+
+### 1.18.1 (2016-03-13)
+
+ * Fixed SlackHandler bug where slack dropped messages randomly
+ * Fixed RedisHandler issue when using with the PHPRedis extension
+ * Fixed AmqpHandler content-type being incorrectly set when using with the AMQP extension
+ * Fixed BrowserConsoleHandler regression
+
+### 1.18.0 (2016-03-01)
+
+ * Added optional reduction of timestamp precision via `Logger->useMicrosecondTimestamps(false)`, disabling it gets you a bit of performance boost but reduces the precision to the second instead of microsecond
+ * Added possibility to skip some extra stack frames in IntrospectionProcessor if you have some library wrapping Monolog that is always adding frames
+ * Added `Logger->withName` to clone a logger (keeping all handlers) with a new name
+ * Added FluentdFormatter for the Fluentd unix socket protocol
+ * Added HandlerWrapper base class to ease the creation of handler wrappers, just extend it and override as needed
+ * Added support for replacing context sub-keys using `%context.*%` in LineFormatter
+ * Added support for `payload` context value in RollbarHandler
+ * Added setRelease to RavenHandler to describe the application version, sent with every log
+ * Added support for `fingerprint` context value in RavenHandler
+ * Fixed JSON encoding errors that would gobble up the whole log record, we now handle those more gracefully by dropping chars as needed
+ * Fixed write timeouts in SocketHandler and derivatives, set to 10sec by default, lower it with `setWritingTimeout()`
+ * Fixed PHP7 compatibility with regard to Exception/Throwable handling in a few places
+
+### 1.17.2 (2015-10-14)
+
+ * Fixed ErrorHandler compatibility with non-Monolog PSR-3 loggers
+ * Fixed SlackHandler handling to use slack functionalities better
+ * Fixed SwiftMailerHandler bug when sending multiple emails they all had the same id
+ * Fixed 5.3 compatibility regression
+
+### 1.17.1 (2015-08-31)
+
+ * Fixed RollbarHandler triggering PHP notices
+
+### 1.17.0 (2015-08-30)
+
+ * Added support for `checksum` and `release` context/extra values in RavenHandler
+ * Added better support for exceptions in RollbarHandler
+ * Added UidProcessor::getUid
+ * Added support for showing the resource type in NormalizedFormatter
+ * Fixed IntrospectionProcessor triggering PHP notices
+
+### 1.16.0 (2015-08-09)
+
+ * Added IFTTTHandler to notify ifttt.com triggers
+ * Added Logger::setHandlers() to allow setting/replacing all handlers
+ * Added $capSize in RedisHandler to cap the log size
+ * Fixed StreamHandler creation of directory to only trigger when the first log write happens
+ * Fixed bug in the handling of curl failures
+ * Fixed duplicate logging of fatal errors when both error and fatal error handlers are registered in monolog's ErrorHandler
+ * Fixed missing fatal errors records with handlers that need to be closed to flush log records
+ * Fixed TagProcessor::addTags support for associative arrays
+
+### 1.15.0 (2015-07-12)
+
+ * Added addTags and setTags methods to change a TagProcessor
+ * Added automatic creation of directories if they are missing for a StreamHandler to open a log file
+ * Added retry functionality to Loggly, Cube and Mandrill handlers so they retry up to 5 times in case of network failure
+ * Fixed process exit code being incorrectly reset to 0 if ErrorHandler::registerExceptionHandler was used
+ * Fixed HTML/JS escaping in BrowserConsoleHandler
+ * Fixed JSON encoding errors being silently suppressed (PHP 5.5+ only)
+
+### 1.14.0 (2015-06-19)
+
+ * Added PHPConsoleHandler to send record to Chrome's PHP Console extension and library
+ * Added support for objects implementing __toString in the NormalizerFormatter
+ * Added support for HipChat's v2 API in HipChatHandler
+ * Added Logger::setTimezone() to initialize the timezone monolog should use in case date.timezone isn't correct for your app
+ * Added an option to send formatted message instead of the raw record on PushoverHandler via ->useFormattedMessage(true)
+ * Fixed curl errors being silently suppressed
+
+### 1.13.1 (2015-03-09)
+
+ * Fixed regression in HipChat requiring a new token to be created
+
+### 1.13.0 (2015-03-05)
+
+ * Added Registry::hasLogger to check for the presence of a logger instance
+ * Added context.user support to RavenHandler
+ * Added HipChat API v2 support in the HipChatHandler
+ * Added NativeMailerHandler::addParameter to pass params to the mail() process
+ * Added context data to SlackHandler when $includeContextAndExtra is true
+ * Added ability to customize the Swift_Message per-email in SwiftMailerHandler
+ * Fixed SwiftMailerHandler to lazily create message instances if a callback is provided
+ * Fixed serialization of INF and NaN values in Normalizer and LineFormatter
+
+### 1.12.0 (2014-12-29)
+
+ * Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers.
+ * Added PsrHandler to forward records to another PSR-3 logger
+ * Added SamplingHandler to wrap around a handler and include only every Nth record
+ * Added MongoDBFormatter to support better storage with MongoDBHandler (it must be enabled manually for now)
+ * Added exception codes in the output of most formatters
+ * Added LineFormatter::includeStacktraces to enable exception stack traces in logs (uses more than one line)
+ * Added $useShortAttachment to SlackHandler to minify attachment size and $includeExtra to append extra data
+ * Added $host to HipChatHandler for users of private instances
+ * Added $transactionName to NewRelicHandler and support for a transaction_name context value
+ * Fixed MandrillHandler to avoid outputing API call responses
+ * Fixed some non-standard behaviors in SyslogUdpHandler
+
+### 1.11.0 (2014-09-30)
+
+ * Break: The NewRelicHandler extra and context data are now prefixed with extra_ and context_ to avoid clashes. Watch out if you have scripts reading those from the API and rely on names
+ * Added WhatFailureGroupHandler to suppress any exception coming from the wrapped handlers and avoid chain failures if a logging service fails
+ * Added MandrillHandler to send emails via the Mandrillapp.com API
+ * Added SlackHandler to log records to a Slack.com account
+ * Added FleepHookHandler to log records to a Fleep.io account
+ * Added LogglyHandler::addTag to allow adding tags to an existing handler
+ * Added $ignoreEmptyContextAndExtra to LineFormatter to avoid empty [] at the end
+ * Added $useLocking to StreamHandler and RotatingFileHandler to enable flock() while writing
+ * Added support for PhpAmqpLib in the AmqpHandler
+ * Added FingersCrossedHandler::clear and BufferHandler::clear to reset them between batches in long running jobs
+ * Added support for adding extra fields from $_SERVER in the WebProcessor
+ * Fixed support for non-string values in PrsLogMessageProcessor
+ * Fixed SwiftMailer messages being sent with the wrong date in long running scripts
+ * Fixed minor PHP 5.6 compatibility issues
+ * Fixed BufferHandler::close being called twice
+
+### 1.10.0 (2014-06-04)
+
+ * Added Logger::getHandlers() and Logger::getProcessors() methods
+ * Added $passthruLevel argument to FingersCrossedHandler to let it always pass some records through even if the trigger level is not reached
+ * Added support for extra data in NewRelicHandler
+ * Added $expandNewlines flag to the ErrorLogHandler to create multiple log entries when a message has multiple lines
+
+### 1.9.1 (2014-04-24)
+
+ * Fixed regression in RotatingFileHandler file permissions
+ * Fixed initialization of the BufferHandler to make sure it gets flushed after receiving records
+ * Fixed ChromePHPHandler and FirePHPHandler's activation strategies to be more conservative
+
+### 1.9.0 (2014-04-20)
+
+ * Added LogEntriesHandler to send logs to a LogEntries account
+ * Added $filePermissions to tweak file mode on StreamHandler and RotatingFileHandler
+ * Added $useFormatting flag to MemoryProcessor to make it send raw data in bytes
+ * Added support for table formatting in FirePHPHandler via the table context key
+ * Added a TagProcessor to add tags to records, and support for tags in RavenHandler
+ * Added $appendNewline flag to the JsonFormatter to enable using it when logging to files
+ * Added sound support to the PushoverHandler
+ * Fixed multi-threading support in StreamHandler
+ * Fixed empty headers issue when ChromePHPHandler received no records
+ * Fixed default format of the ErrorLogHandler
+
+### 1.8.0 (2014-03-23)
+
+ * Break: the LineFormatter now strips newlines by default because this was a bug, set $allowInlineLineBreaks to true if you need them
+ * Added BrowserConsoleHandler to send logs to any browser's console via console.log() injection in the output
+ * Added FilterHandler to filter records and only allow those of a given list of levels through to the wrapped handler
+ * Added FlowdockHandler to send logs to a Flowdock account
+ * Added RollbarHandler to send logs to a Rollbar account
+ * Added HtmlFormatter to send prettier log emails with colors for each log level
+ * Added GitProcessor to add the current branch/commit to extra record data
+ * Added a Monolog\Registry class to allow easier global access to pre-configured loggers
+ * Added support for the new official graylog2/gelf-php lib for GelfHandler, upgrade if you can by replacing the mlehner/gelf-php requirement
+ * Added support for HHVM
+ * Added support for Loggly batch uploads
+ * Added support for tweaking the content type and encoding in NativeMailerHandler
+ * Added $skipClassesPartials to tweak the ignored classes in the IntrospectionProcessor
+ * Fixed batch request support in GelfHandler
+
+### 1.7.0 (2013-11-14)
+
+ * Added ElasticSearchHandler to send logs to an Elastic Search server
+ * Added DynamoDbHandler and ScalarFormatter to send logs to Amazon's Dynamo DB
+ * Added SyslogUdpHandler to send logs to a remote syslogd server
+ * Added LogglyHandler to send logs to a Loggly account
+ * Added $level to IntrospectionProcessor so it only adds backtraces when needed
+ * Added $version to LogstashFormatter to allow using the new v1 Logstash format
+ * Added $appName to NewRelicHandler
+ * Added configuration of Pushover notification retries/expiry
+ * Added $maxColumnWidth to NativeMailerHandler to change the 70 chars default
+ * Added chainability to most setters for all handlers
+ * Fixed RavenHandler batch processing so it takes the message from the record with highest priority
+ * Fixed HipChatHandler batch processing so it sends all messages at once
+ * Fixed issues with eAccelerator
+ * Fixed and improved many small things
+
+### 1.6.0 (2013-07-29)
+
+ * Added HipChatHandler to send logs to a HipChat chat room
+ * Added ErrorLogHandler to send logs to PHP's error_log function
+ * Added NewRelicHandler to send logs to NewRelic's service
+ * Added Monolog\ErrorHandler helper class to register a Logger as exception/error/fatal handler
+ * Added ChannelLevelActivationStrategy for the FingersCrossedHandler to customize levels by channel
+ * Added stack traces output when normalizing exceptions (json output & co)
+ * Added Monolog\Logger::API constant (currently 1)
+ * Added support for ChromePHP's v4.0 extension
+ * Added support for message priorities in PushoverHandler, see $highPriorityLevel and $emergencyLevel
+ * Added support for sending messages to multiple users at once with the PushoverHandler
+ * Fixed RavenHandler's support for batch sending of messages (when behind a Buffer or FingersCrossedHandler)
+ * Fixed normalization of Traversables with very large data sets, only the first 1000 items are shown now
+ * Fixed issue in RotatingFileHandler when an open_basedir restriction is active
+ * Fixed minor issues in RavenHandler and bumped the API to Raven 0.5.0
+ * Fixed SyslogHandler issue when many were used concurrently with different facilities
+
+### 1.5.0 (2013-04-23)
+
+ * Added ProcessIdProcessor to inject the PID in log records
+ * Added UidProcessor to inject a unique identifier to all log records of one request/run
+ * Added support for previous exceptions in the LineFormatter exception serialization
+ * Added Monolog\Logger::getLevels() to get all available levels
+ * Fixed ChromePHPHandler so it avoids sending headers larger than Chrome can handle
+
+### 1.4.1 (2013-04-01)
+
+ * Fixed exception formatting in the LineFormatter to be more minimalistic
+ * Fixed RavenHandler's handling of context/extra data, requires Raven client >0.1.0
+ * Fixed log rotation in RotatingFileHandler to work with long running scripts spanning multiple days
+ * Fixed WebProcessor array access so it checks for data presence
+ * Fixed Buffer, Group and FingersCrossed handlers to make use of their processors
+
+### 1.4.0 (2013-02-13)
+
+ * Added RedisHandler to log to Redis via the Predis library or the phpredis extension
+ * Added ZendMonitorHandler to log to the Zend Server monitor
+ * Added the possibility to pass arrays of handlers and processors directly in the Logger constructor
+ * Added `$useSSL` option to the PushoverHandler which is enabled by default
+ * Fixed ChromePHPHandler and FirePHPHandler issue when multiple instances are used simultaneously
+ * Fixed header injection capability in the NativeMailHandler
+
+### 1.3.1 (2013-01-11)
+
+ * Fixed LogstashFormatter to be usable with stream handlers
+ * Fixed GelfMessageFormatter levels on Windows
+
+### 1.3.0 (2013-01-08)
+
+ * Added PSR-3 compliance, the `Monolog\Logger` class is now an instance of `Psr\Log\LoggerInterface`
+ * Added PsrLogMessageProcessor that you can selectively enable for full PSR-3 compliance
+ * Added LogstashFormatter (combine with SocketHandler or StreamHandler to send logs to Logstash)
+ * Added PushoverHandler to send mobile notifications
+ * Added CouchDBHandler and DoctrineCouchDBHandler
+ * Added RavenHandler to send data to Sentry servers
+ * Added support for the new MongoClient class in MongoDBHandler
+ * Added microsecond precision to log records' timestamps
+ * Added `$flushOnOverflow` param to BufferHandler to flush by batches instead of losing
+ the oldest entries
+ * Fixed normalization of objects with cyclic references
+
+### 1.2.1 (2012-08-29)
+
+ * Added new $logopts arg to SyslogHandler to provide custom openlog options
+ * Fixed fatal error in SyslogHandler
+
+### 1.2.0 (2012-08-18)
+
+ * Added AmqpHandler (for use with AMQP servers)
+ * Added CubeHandler
+ * Added NativeMailerHandler::addHeader() to send custom headers in mails
+ * Added the possibility to specify more than one recipient in NativeMailerHandler
+ * Added the possibility to specify float timeouts in SocketHandler
+ * Added NOTICE and EMERGENCY levels to conform with RFC 5424
+ * Fixed the log records to use the php default timezone instead of UTC
+ * Fixed BufferHandler not being flushed properly on PHP fatal errors
+ * Fixed normalization of exotic resource types
+ * Fixed the default format of the SyslogHandler to avoid duplicating datetimes in syslog
+
+### 1.1.0 (2012-04-23)
+
+ * Added Monolog\Logger::isHandling() to check if a handler will
+ handle the given log level
+ * Added ChromePHPHandler
+ * Added MongoDBHandler
+ * Added GelfHandler (for use with Graylog2 servers)
+ * Added SocketHandler (for use with syslog-ng for example)
+ * Added NormalizerFormatter
+ * Added the possibility to change the activation strategy of the FingersCrossedHandler
+ * Added possibility to show microseconds in logs
+ * Added `server` and `referer` to WebProcessor output
+
+### 1.0.2 (2011-10-24)
+
+ * Fixed bug in IE with large response headers and FirePHPHandler
+
+### 1.0.1 (2011-08-25)
+
+ * Added MemoryPeakUsageProcessor and MemoryUsageProcessor
+ * Added Monolog\Logger::getName() to get a logger's channel name
+
+### 1.0.0 (2011-07-06)
+
+ * Added IntrospectionProcessor to get info from where the logger was called
+ * Fixed WebProcessor in CLI
+
+### 1.0.0-RC1 (2011-07-01)
+
+ * Initial release
diff --git a/vendor/monolog/monolog/LICENSE b/vendor/monolog/monolog/LICENSE
new file mode 100644
index 00000000..16473219
--- /dev/null
+++ b/vendor/monolog/monolog/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011-2016 Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/monolog/monolog/README.mdown b/vendor/monolog/monolog/README.mdown
new file mode 100644
index 00000000..7d8ade52
--- /dev/null
+++ b/vendor/monolog/monolog/README.mdown
@@ -0,0 +1,95 @@
+# Monolog - Logging for PHP [](https://travis-ci.org/Seldaek/monolog)
+
+[](https://packagist.org/packages/monolog/monolog)
+[](https://packagist.org/packages/monolog/monolog)
+[](https://www.versioneye.com/php/monolog:monolog/references)
+
+
+Monolog sends your logs to files, sockets, inboxes, databases and various
+web services. See the complete list of handlers below. Special handlers
+allow you to build advanced logging strategies.
+
+This library implements the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
+interface that you can type-hint against in your own libraries to keep
+a maximum of interoperability. You can also use it in your applications to
+make sure you can always use another compatible logger at a later time.
+As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels.
+Internally Monolog still uses its own level scheme since it predates PSR-3.
+
+## Installation
+
+Install the latest version with
+
+```bash
+$ composer require monolog/monolog
+```
+
+## Basic Usage
+
+```php
+pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
+
+// add records to the log
+$log->addWarning('Foo');
+$log->addError('Bar');
+```
+
+## Documentation
+
+- [Usage Instructions](doc/01-usage.md)
+- [Handlers, Formatters and Processors](doc/02-handlers-formatters-processors.md)
+- [Utility classes](doc/03-utilities.md)
+- [Extending Monolog](doc/04-extending.md)
+
+## Third Party Packages
+
+Third party handlers, formatters and processors are
+[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
+can also add your own there if you publish one.
+
+## About
+
+### Requirements
+
+- Monolog works with PHP 5.3 or above, and is also tested to work with HHVM.
+
+### Submitting bugs and feature requests
+
+Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues)
+
+### Framework Integrations
+
+- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
+ can be used very easily with Monolog since it implements the interface.
+- [Symfony2](http://symfony.com) comes out of the box with Monolog.
+- [Silex](http://silex.sensiolabs.org/) comes out of the box with Monolog.
+- [Laravel 4 & 5](http://laravel.com/) come out of the box with Monolog.
+- [Lumen](http://lumen.laravel.com/) comes out of the box with Monolog.
+- [PPI](http://www.ppi.io/) comes out of the box with Monolog.
+- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin.
+- [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer.
+- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog.
+- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog.
+- [Nette Framework](http://nette.org/en/) can be used with Monolog via [Kdyby/Monolog](https://github.com/Kdyby/Monolog) extension.
+- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog.
+
+### Author
+
+Jordi Boggiano - -
+See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) which participated in this project.
+
+### License
+
+Monolog is licensed under the MIT License - see the `LICENSE` file for details
+
+### Acknowledgements
+
+This library is heavily inspired by Python's [Logbook](http://packages.python.org/Logbook/)
+library, although most concepts have been adjusted to fit to the PHP world.
diff --git a/vendor/monolog/monolog/composer.json b/vendor/monolog/monolog/composer.json
new file mode 100644
index 00000000..f74b7b97
--- /dev/null
+++ b/vendor/monolog/monolog/composer.json
@@ -0,0 +1,66 @@
+{
+ "name": "monolog/monolog",
+ "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
+ "keywords": ["log", "logging", "psr-3"],
+ "homepage": "http://github.com/Seldaek/monolog",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "psr/log": "~1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.5",
+ "graylog2/gelf-php": "~1.0",
+ "sentry/sentry": "^0.13",
+ "ruflin/elastica": ">=0.90 <3.0",
+ "doctrine/couchdb": "~1.0@dev",
+ "aws/aws-sdk-php": "^2.4.9 || ^3.0",
+ "php-amqplib/php-amqplib": "~2.4",
+ "swiftmailer/swiftmailer": "~5.3",
+ "php-console/php-console": "^3.1.3",
+ "phpunit/phpunit-mock-objects": "2.3.0",
+ "jakub-onderka/php-parallel-lint": "0.9"
+ },
+ "_": "phpunit/phpunit-mock-objects required in 2.3.0 due to https://github.com/sebastianbergmann/phpunit-mock-objects/issues/223 - needs hhvm 3.8+ on travis",
+ "suggest": {
+ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
+ "sentry/sentry": "Allow sending log messages to a Sentry server",
+ "doctrine/couchdb": "Allow sending log messages to a CouchDB server",
+ "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
+ "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
+ "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
+ "ext-mongo": "Allow sending log messages to a MongoDB server",
+ "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
+ "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
+ "rollbar/rollbar": "Allow sending log messages to Rollbar",
+ "php-console/php-console": "Allow sending log messages to Google Chrome"
+ },
+ "autoload": {
+ "psr-4": {"Monolog\\": "src/Monolog"}
+ },
+ "autoload-dev": {
+ "psr-4": {"Monolog\\": "tests/Monolog"}
+ },
+ "provide": {
+ "psr/log-implementation": "1.0.0"
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "scripts": {
+ "test": [
+ "parallel-lint . --exclude vendor",
+ "phpunit"
+ ]
+ }
+}
diff --git a/vendor/monolog/monolog/doc/01-usage.md b/vendor/monolog/monolog/doc/01-usage.md
new file mode 100644
index 00000000..8e2551f3
--- /dev/null
+++ b/vendor/monolog/monolog/doc/01-usage.md
@@ -0,0 +1,231 @@
+# Using Monolog
+
+- [Installation](#installation)
+- [Core Concepts](#core-concepts)
+- [Log Levels](#log-levels)
+- [Configuring a logger](#configuring-a-logger)
+- [Adding extra data in the records](#adding-extra-data-in-the-records)
+- [Leveraging channels](#leveraging-channels)
+- [Customizing the log format](#customizing-the-log-format)
+
+## Installation
+
+Monolog is available on Packagist ([monolog/monolog](http://packagist.org/packages/monolog/monolog))
+and as such installable via [Composer](http://getcomposer.org/).
+
+```bash
+composer require monolog/monolog
+```
+
+If you do not use Composer, you can grab the code from GitHub, and use any
+PSR-0 compatible autoloader (e.g. the [Symfony2 ClassLoader component](https://github.com/symfony/ClassLoader))
+to load Monolog classes.
+
+## Core Concepts
+
+Every `Logger` instance has a channel (name) and a stack of handlers. Whenever
+you add a record to the logger, it traverses the handler stack. Each handler
+decides whether it fully handled the record, and if so, the propagation of the
+record ends there.
+
+This allows for flexible logging setups, for example having a `StreamHandler` at
+the bottom of the stack that will log anything to disk, and on top of that add
+a `MailHandler` that will send emails only when an error message is logged.
+Handlers also have a `$bubble` property which defines whether they block the
+record or not if they handled it. In this example, setting the `MailHandler`'s
+`$bubble` argument to false means that records handled by the `MailHandler` will
+not propagate to the `StreamHandler` anymore.
+
+You can create many `Logger`s, each defining a channel (e.g.: db, request,
+router, ..) and each of them combining various handlers, which can be shared
+or not. The channel is reflected in the logs and allows you to easily see or
+filter records.
+
+Each Handler also has a Formatter, a default one with settings that make sense
+will be created if you don't set one. The formatters normalize and format
+incoming records so that they can be used by the handlers to output useful
+information.
+
+Custom severity levels are not available. Only the eight
+[RFC 5424](http://tools.ietf.org/html/rfc5424) levels (debug, info, notice,
+warning, error, critical, alert, emergency) are present for basic filtering
+purposes, but for sorting and other use cases that would require
+flexibility, you should add Processors to the Logger that can add extra
+information (tags, user ip, ..) to the records before they are handled.
+
+## Log Levels
+
+Monolog supports the logging levels described by [RFC 5424](http://tools.ietf.org/html/rfc5424).
+
+- **DEBUG** (100): Detailed debug information.
+
+- **INFO** (200): Interesting events. Examples: User logs in, SQL logs.
+
+- **NOTICE** (250): Normal but significant events.
+
+- **WARNING** (300): Exceptional occurrences that are not errors. Examples:
+ Use of deprecated APIs, poor use of an API, undesirable things that are not
+ necessarily wrong.
+
+- **ERROR** (400): Runtime errors that do not require immediate action but
+ should typically be logged and monitored.
+
+- **CRITICAL** (500): Critical conditions. Example: Application component
+ unavailable, unexpected exception.
+
+- **ALERT** (550): Action must be taken immediately. Example: Entire website
+ down, database unavailable, etc. This should trigger the SMS alerts and wake
+ you up.
+
+- **EMERGENCY** (600): Emergency: system is unusable.
+
+## Configuring a logger
+
+Here is a basic setup to log to a file and to firephp on the DEBUG level:
+
+```php
+pushHandler(new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG));
+$logger->pushHandler(new FirePHPHandler());
+
+// You can now use your logger
+$logger->addInfo('My logger is now ready');
+```
+
+Let's explain it. The first step is to create the logger instance which will
+be used in your code. The argument is a channel name, which is useful when
+you use several loggers (see below for more details about it).
+
+The logger itself does not know how to handle a record. It delegates it to
+some handlers. The code above registers two handlers in the stack to allow
+handling records in two different ways.
+
+Note that the FirePHPHandler is called first as it is added on top of the
+stack. This allows you to temporarily add a logger with bubbling disabled if
+you want to override other configured loggers.
+
+> If you use Monolog standalone and are looking for an easy way to
+> configure many handlers, the [theorchard/monolog-cascade](https://github.com/theorchard/monolog-cascade)
+> can help you build complex logging configs via PHP arrays, yaml or json configs.
+
+## Adding extra data in the records
+
+Monolog provides two different ways to add extra informations along the simple
+textual message.
+
+### Using the logging context
+
+The first way is the context, allowing to pass an array of data along the
+record:
+
+```php
+addInfo('Adding a new user', array('username' => 'Seldaek'));
+```
+
+Simple handlers (like the StreamHandler for instance) will simply format
+the array to a string but richer handlers can take advantage of the context
+(FirePHP is able to display arrays in pretty way for instance).
+
+### Using processors
+
+The second way is to add extra data for all records by using a processor.
+Processors can be any callable. They will get the record as parameter and
+must return it after having eventually changed the `extra` part of it. Let's
+write a processor adding some dummy data in the record:
+
+```php
+pushProcessor(function ($record) {
+ $record['extra']['dummy'] = 'Hello world!';
+
+ return $record;
+});
+```
+
+Monolog provides some built-in processors that can be used in your project.
+Look at the [dedicated chapter](https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md#processors) for the list.
+
+> Tip: processors can also be registered on a specific handler instead of
+ the logger to apply only for this handler.
+
+## Leveraging channels
+
+Channels are a great way to identify to which part of the application a record
+is related. This is useful in big applications (and is leveraged by
+MonologBundle in Symfony2).
+
+Picture two loggers sharing a handler that writes to a single log file.
+Channels would allow you to identify the logger that issued every record.
+You can easily grep through the log files filtering this or that channel.
+
+```php
+pushHandler($stream);
+$logger->pushHandler($firephp);
+
+// Create a logger for the security-related stuff with a different channel
+$securityLogger = new Logger('security');
+$securityLogger->pushHandler($stream);
+$securityLogger->pushHandler($firephp);
+
+// Or clone the first one to only change the channel
+$securityLogger = $logger->withName('security');
+```
+
+## Customizing the log format
+
+In Monolog it's easy to customize the format of the logs written into files,
+sockets, mails, databases and other handlers. Most of the handlers use the
+
+```php
+$record['formatted']
+```
+
+value to be automatically put into the log device. This value depends on the
+formatter settings. You can choose between predefined formatter classes or
+write your own (e.g. a multiline text file for human-readable output).
+
+To configure a predefined formatter class, just set it as the handler's field:
+
+```php
+// the default date format is "Y-m-d H:i:s"
+$dateFormat = "Y n j, g:i a";
+// the default output format is "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"
+$output = "%datetime% > %level_name% > %message% %context% %extra%\n";
+// finally, create a formatter
+$formatter = new LineFormatter($output, $dateFormat);
+
+// Create a handler
+$stream = new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG);
+$stream->setFormatter($formatter);
+// bind it to a logger object
+$securityLogger = new Logger('security');
+$securityLogger->pushHandler($stream);
+```
+
+You may also reuse the same formatter between multiple handlers and share those
+handlers between multiple loggers.
+
+[Handlers, Formatters and Processors](02-handlers-formatters-processors.md) →
diff --git a/vendor/monolog/monolog/doc/02-handlers-formatters-processors.md b/vendor/monolog/monolog/doc/02-handlers-formatters-processors.md
new file mode 100644
index 00000000..bea968ac
--- /dev/null
+++ b/vendor/monolog/monolog/doc/02-handlers-formatters-processors.md
@@ -0,0 +1,157 @@
+# Handlers, Formatters and Processors
+
+- [Handlers](#handlers)
+ - [Log to files and syslog](#log-to-files-and-syslog)
+ - [Send alerts and emails](#send-alerts-and-emails)
+ - [Log specific servers and networked logging](#log-specific-servers-and-networked-logging)
+ - [Logging in development](#logging-in-development)
+ - [Log to databases](#log-to-databases)
+ - [Wrappers / Special Handlers](#wrappers--special-handlers)
+- [Formatters](#formatters)
+- [Processors](#processors)
+- [Third Party Packages](#third-party-packages)
+
+## Handlers
+
+### Log to files and syslog
+
+- _StreamHandler_: Logs records into any PHP stream, use this for log files.
+- _RotatingFileHandler_: Logs records to a file and creates one logfile per day.
+ It will also delete files older than `$maxFiles`. You should use
+ [logrotate](http://linuxcommand.org/man_pages/logrotate8.html) for high profile
+ setups though, this is just meant as a quick and dirty solution.
+- _SyslogHandler_: Logs records to the syslog.
+- _ErrorLogHandler_: Logs records to PHP's
+ [`error_log()`](http://docs.php.net/manual/en/function.error-log.php) function.
+
+### Send alerts and emails
+
+- _NativeMailerHandler_: Sends emails using PHP's
+ [`mail()`](http://php.net/manual/en/function.mail.php) function.
+- _SwiftMailerHandler_: Sends emails using a [`Swift_Mailer`](http://swiftmailer.org/) instance.
+- _PushoverHandler_: Sends mobile notifications via the [Pushover](https://www.pushover.net/) API.
+- _HipChatHandler_: Logs records to a [HipChat](http://hipchat.com) chat room using its API.
+- _FlowdockHandler_: Logs records to a [Flowdock](https://www.flowdock.com/) account.
+- _SlackHandler_: Logs records to a [Slack](https://www.slack.com/) account using the Slack API.
+- _SlackbotHandler_: Logs records to a [Slack](https://www.slack.com/) account using the Slackbot incoming hook.
+- _SlackWebhookHandler_: Logs records to a [Slack](https://www.slack.com/) account using Slack Webhooks.
+- _MandrillHandler_: Sends emails via the Mandrill API using a [`Swift_Message`](http://swiftmailer.org/) instance.
+- _FleepHookHandler_: Logs records to a [Fleep](https://fleep.io/) conversation using Webhooks.
+- _IFTTTHandler_: Notifies an [IFTTT](https://ifttt.com/maker) trigger with the log channel, level name and message.
+
+### Log specific servers and networked logging
+
+- _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this
+ for UNIX and TCP sockets. See an [example](sockets.md).
+- _AmqpHandler_: Logs records to an [amqp](http://www.amqp.org/) compatible
+ server. Requires the [php-amqp](http://pecl.php.net/package/amqp) extension (1.0+).
+- _GelfHandler_: Logs records to a [Graylog2](http://www.graylog2.org) server.
+- _CubeHandler_: Logs records to a [Cube](http://square.github.com/cube/) server.
+- _RavenHandler_: Logs records to a [Sentry](http://getsentry.com/) server using
+ [raven](https://packagist.org/packages/raven/raven).
+- _ZendMonitorHandler_: Logs records to the Zend Monitor present in Zend Server.
+- _NewRelicHandler_: Logs records to a [NewRelic](http://newrelic.com/) application.
+- _LogglyHandler_: Logs records to a [Loggly](http://www.loggly.com/) account.
+- _RollbarHandler_: Logs records to a [Rollbar](https://rollbar.com/) account.
+- _SyslogUdpHandler_: Logs records to a remote [Syslogd](http://www.rsyslog.com/) server.
+- _LogEntriesHandler_: Logs records to a [LogEntries](http://logentries.com/) account.
+
+### Logging in development
+
+- _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing
+ inline `console` messages within [FireBug](http://getfirebug.com/).
+- _ChromePHPHandler_: Handler for [ChromePHP](http://www.chromephp.com/), providing
+ inline `console` messages within Chrome.
+- _BrowserConsoleHandler_: Handler to send logs to browser's Javascript `console` with
+ no browser extension required. Most browsers supporting `console` API are supported.
+- _PHPConsoleHandler_: Handler for [PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef), providing
+ inline `console` and notification popup messages within Chrome.
+
+### Log to databases
+
+- _RedisHandler_: Logs records to a [redis](http://redis.io) server.
+- _MongoDBHandler_: Handler to write records in MongoDB via a
+ [Mongo](http://pecl.php.net/package/mongo) extension connection.
+- _CouchDBHandler_: Logs records to a CouchDB server.
+- _DoctrineCouchDBHandler_: Logs records to a CouchDB server via the Doctrine CouchDB ODM.
+- _ElasticSearchHandler_: Logs records to an Elastic Search server.
+- _DynamoDbHandler_: Logs records to a DynamoDB table with the [AWS SDK](https://github.com/aws/aws-sdk-php).
+
+### Wrappers / Special Handlers
+
+- _FingersCrossedHandler_: A very interesting wrapper. It takes a logger as
+ parameter and will accumulate log records of all levels until a record
+ exceeds the defined severity level. At which point it delivers all records,
+ including those of lower severity, to the handler it wraps. This means that
+ until an error actually happens you will not see anything in your logs, but
+ when it happens you will have the full information, including debug and info
+ records. This provides you with all the information you need, but only when
+ you need it.
+- _DeduplicationHandler_: Useful if you are sending notifications or emails
+ when critical errors occur. It takes a logger as parameter and will
+ accumulate log records of all levels until the end of the request (or
+ `flush()` is called). At that point it delivers all records to the handler
+ it wraps, but only if the records are unique over a given time period
+ (60seconds by default). If the records are duplicates they are simply
+ discarded. The main use of this is in case of critical failure like if your
+ database is unreachable for example all your requests will fail and that
+ can result in a lot of notifications being sent. Adding this handler reduces
+ the amount of notifications to a manageable level.
+- _WhatFailureGroupHandler_: This handler extends the _GroupHandler_ ignoring
+ exceptions raised by each child handler. This allows you to ignore issues
+ where a remote tcp connection may have died but you do not want your entire
+ application to crash and may wish to continue to log to other handlers.
+- _BufferHandler_: This handler will buffer all the log records it receives
+ until `close()` is called at which point it will call `handleBatch()` on the
+ handler it wraps with all the log messages at once. This is very useful to
+ send an email with all records at once for example instead of having one mail
+ for every log record.
+- _GroupHandler_: This handler groups other handlers. Every record received is
+ sent to all the handlers it is configured with.
+- _FilterHandler_: This handler only lets records of the given levels through
+ to the wrapped handler.
+- _SamplingHandler_: Wraps around another handler and lets you sample records
+ if you only want to store some of them.
+- _NullHandler_: Any record it can handle will be thrown away. This can be used
+ to put on top of an existing handler stack to disable it temporarily.
+- _PsrHandler_: Can be used to forward log records to an existing PSR-3 logger
+- _TestHandler_: Used for testing, it records everything that is sent to it and
+ has accessors to read out the information.
+- _HandlerWrapper_: A simple handler wrapper you can inherit from to create
+ your own wrappers easily.
+
+## Formatters
+
+- _LineFormatter_: Formats a log record into a one-line string.
+- _HtmlFormatter_: Used to format log records into a human readable html table, mainly suitable for emails.
+- _NormalizerFormatter_: Normalizes objects/resources down to strings so a record can easily be serialized/encoded.
+- _ScalarFormatter_: Used to format log records into an associative array of scalar values.
+- _JsonFormatter_: Encodes a log record into json.
+- _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler.
+- _ChromePHPFormatter_: Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler.
+- _GelfMessageFormatter_: Used to format log records into Gelf message instances, only useful for the GelfHandler.
+- _LogstashFormatter_: Used to format log records into [logstash](http://logstash.net/) event json, useful for any handler listed under inputs [here](http://logstash.net/docs/latest).
+- _ElasticaFormatter_: Used to format log records into an Elastica\Document object, only useful for the ElasticSearchHandler.
+- _LogglyFormatter_: Used to format log records into Loggly messages, only useful for the LogglyHandler.
+- _FlowdockFormatter_: Used to format log records into Flowdock messages, only useful for the FlowdockHandler.
+- _MongoDBFormatter_: Converts \DateTime instances to \MongoDate and objects recursively to arrays, only useful with the MongoDBHandler.
+
+## Processors
+
+- _PsrLogMessageProcessor_: Processes a log record's message according to PSR-3 rules, replacing `{foo}` with the value from `$context['foo']`.
+- _IntrospectionProcessor_: Adds the line/file/class/method from which the log call originated.
+- _WebProcessor_: Adds the current request URI, request method and client IP to a log record.
+- _MemoryUsageProcessor_: Adds the current memory usage to a log record.
+- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record.
+- _ProcessIdProcessor_: Adds the process id to a log record.
+- _UidProcessor_: Adds a unique identifier to a log record.
+- _GitProcessor_: Adds the current git branch and commit to a log record.
+- _TagProcessor_: Adds an array of predefined tags to a log record.
+
+## Third Party Packages
+
+Third party handlers, formatters and processors are
+[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
+can also add your own there if you publish one.
+
+← [Usage](01-usage.md) | [Utility classes](03-utilities.md) →
diff --git a/vendor/monolog/monolog/doc/03-utilities.md b/vendor/monolog/monolog/doc/03-utilities.md
new file mode 100644
index 00000000..c62aa416
--- /dev/null
+++ b/vendor/monolog/monolog/doc/03-utilities.md
@@ -0,0 +1,13 @@
+# Utilities
+
+- _Registry_: The `Monolog\Registry` class lets you configure global loggers that you
+ can then statically access from anywhere. It is not really a best practice but can
+ help in some older codebases or for ease of use.
+- _ErrorHandler_: The `Monolog\ErrorHandler` class allows you to easily register
+ a Logger instance as an exception handler, error handler or fatal error handler.
+- _ErrorLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain log
+ level is reached.
+- _ChannelLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain
+ log level is reached, depending on which channel received the log record.
+
+← [Handlers, Formatters and Processors](02-handlers-formatters-processors.md) | [Extending Monolog](04-extending.md) →
diff --git a/vendor/monolog/monolog/doc/04-extending.md b/vendor/monolog/monolog/doc/04-extending.md
new file mode 100644
index 00000000..ebd9104d
--- /dev/null
+++ b/vendor/monolog/monolog/doc/04-extending.md
@@ -0,0 +1,76 @@
+# Extending Monolog
+
+Monolog is fully extensible, allowing you to adapt your logger to your needs.
+
+## Writing your own handler
+
+Monolog provides many built-in handlers. But if the one you need does not
+exist, you can write it and use it in your logger. The only requirement is
+to implement `Monolog\Handler\HandlerInterface`.
+
+Let's write a PDOHandler to log records to a database. We will extend the
+abstract class provided by Monolog to keep things DRY.
+
+```php
+pdo = $pdo;
+ parent::__construct($level, $bubble);
+ }
+
+ protected function write(array $record)
+ {
+ if (!$this->initialized) {
+ $this->initialize();
+ }
+
+ $this->statement->execute(array(
+ 'channel' => $record['channel'],
+ 'level' => $record['level'],
+ 'message' => $record['formatted'],
+ 'time' => $record['datetime']->format('U'),
+ ));
+ }
+
+ private function initialize()
+ {
+ $this->pdo->exec(
+ 'CREATE TABLE IF NOT EXISTS monolog '
+ .'(channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED)'
+ );
+ $this->statement = $this->pdo->prepare(
+ 'INSERT INTO monolog (channel, level, message, time) VALUES (:channel, :level, :message, :time)'
+ );
+
+ $this->initialized = true;
+ }
+}
+```
+
+You can now use this handler in your logger:
+
+```php
+pushHandler(new PDOHandler(new PDO('sqlite:logs.sqlite')));
+
+// You can now use your logger
+$logger->addInfo('My logger is now ready');
+```
+
+The `Monolog\Handler\AbstractProcessingHandler` class provides most of the
+logic needed for the handler, including the use of processors and the formatting
+of the record (which is why we use ``$record['formatted']`` instead of ``$record['message']``).
+
+← [Utility classes](03-utilities.md)
diff --git a/vendor/monolog/monolog/doc/sockets.md b/vendor/monolog/monolog/doc/sockets.md
new file mode 100644
index 00000000..ea9cf0ea
--- /dev/null
+++ b/vendor/monolog/monolog/doc/sockets.md
@@ -0,0 +1,39 @@
+Sockets Handler
+===============
+
+This handler allows you to write your logs to sockets using [fsockopen](http://php.net/fsockopen)
+or [pfsockopen](http://php.net/pfsockopen).
+
+Persistent sockets are mainly useful in web environments where you gain some performance not closing/opening
+the connections between requests.
+
+You can use a `unix://` prefix to access unix sockets and `udp://` to open UDP sockets instead of the default TCP.
+
+Basic Example
+-------------
+
+```php
+setPersistent(true);
+
+// Now add the handler
+$logger->pushHandler($handler, Logger::DEBUG);
+
+// You can now use your logger
+$logger->addInfo('My logger is now ready');
+
+```
+
+In this example, using syslog-ng, you should see the log on the log server:
+
+ cweb1 [2012-02-26 00:12:03] my_logger.INFO: My logger is now ready [] []
+
diff --git a/vendor/monolog/monolog/phpunit.xml.dist b/vendor/monolog/monolog/phpunit.xml.dist
new file mode 100644
index 00000000..20d82b63
--- /dev/null
+++ b/vendor/monolog/monolog/phpunit.xml.dist
@@ -0,0 +1,19 @@
+
+
+
+
+
+ tests/Monolog/
+
+
+
+
+
+ src/Monolog/
+
+
+
+
+
+
+
diff --git a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php
new file mode 100644
index 00000000..0152298d
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php
@@ -0,0 +1,227 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog;
+
+use Psr\Log\LoggerInterface;
+use Psr\Log\LogLevel;
+use Monolog\Handler\AbstractHandler;
+
+/**
+ * Monolog error handler
+ *
+ * A facility to enable logging of runtime errors, exceptions and fatal errors.
+ *
+ * Quick setup: ErrorHandler::register($logger);
+ *
+ * @author Jordi Boggiano
+ */
+class ErrorHandler
+{
+ private $logger;
+
+ private $previousExceptionHandler;
+ private $uncaughtExceptionLevel;
+
+ private $previousErrorHandler;
+ private $errorLevelMap;
+ private $handleOnlyReportedErrors;
+
+ private $hasFatalErrorHandler;
+ private $fatalLevel;
+ private $reservedMemory;
+ private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR);
+
+ public function __construct(LoggerInterface $logger)
+ {
+ $this->logger = $logger;
+ }
+
+ /**
+ * Registers a new ErrorHandler for a given Logger
+ *
+ * By default it will handle errors, exceptions and fatal errors
+ *
+ * @param LoggerInterface $logger
+ * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling
+ * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling
+ * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling
+ * @return ErrorHandler
+ */
+ public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null)
+ {
+ $handler = new static($logger);
+ if ($errorLevelMap !== false) {
+ $handler->registerErrorHandler($errorLevelMap);
+ }
+ if ($exceptionLevel !== false) {
+ $handler->registerExceptionHandler($exceptionLevel);
+ }
+ if ($fatalLevel !== false) {
+ $handler->registerFatalHandler($fatalLevel);
+ }
+
+ return $handler;
+ }
+
+ public function registerExceptionHandler($level = null, $callPrevious = true)
+ {
+ $prev = set_exception_handler(array($this, 'handleException'));
+ $this->uncaughtExceptionLevel = $level;
+ if ($callPrevious && $prev) {
+ $this->previousExceptionHandler = $prev;
+ }
+ }
+
+ public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1, $handleOnlyReportedErrors = true)
+ {
+ $prev = set_error_handler(array($this, 'handleError'), $errorTypes);
+ $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap);
+ if ($callPrevious) {
+ $this->previousErrorHandler = $prev ?: true;
+ }
+
+ $this->handleOnlyReportedErrors = $handleOnlyReportedErrors;
+ }
+
+ public function registerFatalHandler($level = null, $reservedMemorySize = 20)
+ {
+ register_shutdown_function(array($this, 'handleFatalError'));
+
+ $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
+ $this->fatalLevel = $level;
+ $this->hasFatalErrorHandler = true;
+ }
+
+ protected function defaultErrorLevelMap()
+ {
+ return array(
+ E_ERROR => LogLevel::CRITICAL,
+ E_WARNING => LogLevel::WARNING,
+ E_PARSE => LogLevel::ALERT,
+ E_NOTICE => LogLevel::NOTICE,
+ E_CORE_ERROR => LogLevel::CRITICAL,
+ E_CORE_WARNING => LogLevel::WARNING,
+ E_COMPILE_ERROR => LogLevel::ALERT,
+ E_COMPILE_WARNING => LogLevel::WARNING,
+ E_USER_ERROR => LogLevel::ERROR,
+ E_USER_WARNING => LogLevel::WARNING,
+ E_USER_NOTICE => LogLevel::NOTICE,
+ E_STRICT => LogLevel::NOTICE,
+ E_RECOVERABLE_ERROR => LogLevel::ERROR,
+ E_DEPRECATED => LogLevel::NOTICE,
+ E_USER_DEPRECATED => LogLevel::NOTICE,
+ );
+ }
+
+ /**
+ * @private
+ */
+ public function handleException($e)
+ {
+ $this->logger->log(
+ $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel,
+ sprintf('Uncaught Exception %s: "%s" at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()),
+ array('exception' => $e)
+ );
+
+ if ($this->previousExceptionHandler) {
+ call_user_func($this->previousExceptionHandler, $e);
+ }
+
+ exit(255);
+ }
+
+ /**
+ * @private
+ */
+ public function handleError($code, $message, $file = '', $line = 0, $context = array())
+ {
+ if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) {
+ return;
+ }
+
+ // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries
+ if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) {
+ $level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL;
+ $this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line));
+ }
+
+ if ($this->previousErrorHandler === true) {
+ return false;
+ } elseif ($this->previousErrorHandler) {
+ return call_user_func($this->previousErrorHandler, $code, $message, $file, $line, $context);
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function handleFatalError()
+ {
+ $this->reservedMemory = null;
+
+ $lastError = error_get_last();
+ if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) {
+ $this->logger->log(
+ $this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel,
+ 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
+ array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'])
+ );
+
+ if ($this->logger instanceof Logger) {
+ foreach ($this->logger->getHandlers() as $handler) {
+ if ($handler instanceof AbstractHandler) {
+ $handler->close();
+ }
+ }
+ }
+ }
+ }
+
+ private static function codeToString($code)
+ {
+ switch ($code) {
+ case E_ERROR:
+ return 'E_ERROR';
+ case E_WARNING:
+ return 'E_WARNING';
+ case E_PARSE:
+ return 'E_PARSE';
+ case E_NOTICE:
+ return 'E_NOTICE';
+ case E_CORE_ERROR:
+ return 'E_CORE_ERROR';
+ case E_CORE_WARNING:
+ return 'E_CORE_WARNING';
+ case E_COMPILE_ERROR:
+ return 'E_COMPILE_ERROR';
+ case E_COMPILE_WARNING:
+ return 'E_COMPILE_WARNING';
+ case E_USER_ERROR:
+ return 'E_USER_ERROR';
+ case E_USER_WARNING:
+ return 'E_USER_WARNING';
+ case E_USER_NOTICE:
+ return 'E_USER_NOTICE';
+ case E_STRICT:
+ return 'E_STRICT';
+ case E_RECOVERABLE_ERROR:
+ return 'E_RECOVERABLE_ERROR';
+ case E_DEPRECATED:
+ return 'E_DEPRECATED';
+ case E_USER_DEPRECATED:
+ return 'E_USER_DEPRECATED';
+ }
+
+ return 'Unknown PHP error';
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php
new file mode 100644
index 00000000..9beda1e7
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php
@@ -0,0 +1,78 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+use Monolog\Logger;
+
+/**
+ * Formats a log message according to the ChromePHP array format
+ *
+ * @author Christophe Coevoet
+ */
+class ChromePHPFormatter implements FormatterInterface
+{
+ /**
+ * Translates Monolog log levels to Wildfire levels.
+ */
+ private $logLevels = array(
+ Logger::DEBUG => 'log',
+ Logger::INFO => 'info',
+ Logger::NOTICE => 'info',
+ Logger::WARNING => 'warn',
+ Logger::ERROR => 'error',
+ Logger::CRITICAL => 'error',
+ Logger::ALERT => 'error',
+ Logger::EMERGENCY => 'error',
+ );
+
+ /**
+ * {@inheritdoc}
+ */
+ public function format(array $record)
+ {
+ // Retrieve the line and file if set and remove them from the formatted extra
+ $backtrace = 'unknown';
+ if (isset($record['extra']['file'], $record['extra']['line'])) {
+ $backtrace = $record['extra']['file'].' : '.$record['extra']['line'];
+ unset($record['extra']['file'], $record['extra']['line']);
+ }
+
+ $message = array('message' => $record['message']);
+ if ($record['context']) {
+ $message['context'] = $record['context'];
+ }
+ if ($record['extra']) {
+ $message['extra'] = $record['extra'];
+ }
+ if (count($message) === 1) {
+ $message = reset($message);
+ }
+
+ return array(
+ $record['channel'],
+ $message,
+ $backtrace,
+ $this->logLevels[$record['level']],
+ );
+ }
+
+ public function formatBatch(array $records)
+ {
+ $formatted = array();
+
+ foreach ($records as $record) {
+ $formatted[] = $this->format($record);
+ }
+
+ return $formatted;
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php
new file mode 100644
index 00000000..4c556cf1
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php
@@ -0,0 +1,89 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+use Elastica\Document;
+
+/**
+ * Format a log message into an Elastica Document
+ *
+ * @author Jelle Vink
+ */
+class ElasticaFormatter extends NormalizerFormatter
+{
+ /**
+ * @var string Elastic search index name
+ */
+ protected $index;
+
+ /**
+ * @var string Elastic search document type
+ */
+ protected $type;
+
+ /**
+ * @param string $index Elastic Search index name
+ * @param string $type Elastic Search document type
+ */
+ public function __construct($index, $type)
+ {
+ // elasticsearch requires a ISO 8601 format date with optional millisecond precision.
+ parent::__construct('Y-m-d\TH:i:s.uP');
+
+ $this->index = $index;
+ $this->type = $type;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function format(array $record)
+ {
+ $record = parent::format($record);
+
+ return $this->getDocument($record);
+ }
+
+ /**
+ * Getter index
+ * @return string
+ */
+ public function getIndex()
+ {
+ return $this->index;
+ }
+
+ /**
+ * Getter type
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * Convert a log message into an Elastica Document
+ *
+ * @param array $record Log message
+ * @return Document
+ */
+ protected function getDocument($record)
+ {
+ $document = new Document();
+ $document->setData($record);
+ $document->setType($this->type);
+ $document->setIndex($this->index);
+
+ return $document;
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php
new file mode 100644
index 00000000..5094af3c
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php
@@ -0,0 +1,116 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+/**
+ * formats the record to be used in the FlowdockHandler
+ *
+ * @author Dominik Liebler
+ */
+class FlowdockFormatter implements FormatterInterface
+{
+ /**
+ * @var string
+ */
+ private $source;
+
+ /**
+ * @var string
+ */
+ private $sourceEmail;
+
+ /**
+ * @param string $source
+ * @param string $sourceEmail
+ */
+ public function __construct($source, $sourceEmail)
+ {
+ $this->source = $source;
+ $this->sourceEmail = $sourceEmail;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function format(array $record)
+ {
+ $tags = array(
+ '#logs',
+ '#' . strtolower($record['level_name']),
+ '#' . $record['channel'],
+ );
+
+ foreach ($record['extra'] as $value) {
+ $tags[] = '#' . $value;
+ }
+
+ $subject = sprintf(
+ 'in %s: %s - %s',
+ $this->source,
+ $record['level_name'],
+ $this->getShortMessage($record['message'])
+ );
+
+ $record['flowdock'] = array(
+ 'source' => $this->source,
+ 'from_address' => $this->sourceEmail,
+ 'subject' => $subject,
+ 'content' => $record['message'],
+ 'tags' => $tags,
+ 'project' => $this->source,
+ );
+
+ return $record;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function formatBatch(array $records)
+ {
+ $formatted = array();
+
+ foreach ($records as $record) {
+ $formatted[] = $this->format($record);
+ }
+
+ return $formatted;
+ }
+
+ /**
+ * @param string $message
+ *
+ * @return string
+ */
+ public function getShortMessage($message)
+ {
+ static $hasMbString;
+
+ if (null === $hasMbString) {
+ $hasMbString = function_exists('mb_strlen');
+ }
+
+ $maxLength = 45;
+
+ if ($hasMbString) {
+ if (mb_strlen($message, 'UTF-8') > $maxLength) {
+ $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...';
+ }
+ } else {
+ if (strlen($message) > $maxLength) {
+ $message = substr($message, 0, $maxLength - 4) . ' ...';
+ }
+ }
+
+ return $message;
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php
new file mode 100644
index 00000000..02632bb5
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php
@@ -0,0 +1,85 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+/**
+ * Class FluentdFormatter
+ *
+ * Serializes a log message to Fluentd unix socket protocol
+ *
+ * Fluentd config:
+ *
+ *
+ * type unix
+ * path /var/run/td-agent/td-agent.sock
+ *
+ *
+ * Monolog setup:
+ *
+ * $logger = new Monolog\Logger('fluent.tag');
+ * $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock');
+ * $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter());
+ * $logger->pushHandler($fluentHandler);
+ *
+ * @author Andrius Putna
+ */
+class FluentdFormatter implements FormatterInterface
+{
+ /**
+ * @var bool $levelTag should message level be a part of the fluentd tag
+ */
+ protected $levelTag = false;
+
+ public function __construct($levelTag = false)
+ {
+ if (!function_exists('json_encode')) {
+ throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter');
+ }
+
+ $this->levelTag = (bool) $levelTag;
+ }
+
+ public function isUsingLevelsInTag()
+ {
+ return $this->levelTag;
+ }
+
+ public function format(array $record)
+ {
+ $tag = $record['channel'];
+ if ($this->levelTag) {
+ $tag .= '.' . strtolower($record['level_name']);
+ }
+
+ $message = array(
+ 'message' => $record['message'],
+ 'extra' => $record['extra'],
+ );
+
+ if (!$this->levelTag) {
+ $message['level'] = $record['level'];
+ $message['level_name'] = $record['level_name'];
+ }
+
+ return json_encode(array($tag, $record['datetime']->getTimestamp(), $message));
+ }
+
+ public function formatBatch(array $records)
+ {
+ $message = '';
+ foreach ($records as $record) {
+ $message .= $this->format($record);
+ }
+
+ return $message;
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php b/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php
new file mode 100644
index 00000000..b5de7511
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php
@@ -0,0 +1,36 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+/**
+ * Interface for formatters
+ *
+ * @author Jordi Boggiano
+ */
+interface FormatterInterface
+{
+ /**
+ * Formats a log record.
+ *
+ * @param array $record A record to format
+ * @return mixed The formatted record
+ */
+ public function format(array $record);
+
+ /**
+ * Formats a set of log records.
+ *
+ * @param array $records A set of records to format
+ * @return mixed The formatted set of records
+ */
+ public function formatBatch(array $records);
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php
new file mode 100644
index 00000000..64e76652
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php
@@ -0,0 +1,137 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+use Monolog\Logger;
+use Gelf\Message;
+
+/**
+ * Serializes a log message to GELF
+ * @see http://www.graylog2.org/about/gelf
+ *
+ * @author Matt Lehner
+ */
+class GelfMessageFormatter extends NormalizerFormatter
+{
+ const MAX_LENGTH = 32766;
+
+ /**
+ * @var string the name of the system for the Gelf log message
+ */
+ protected $systemName;
+
+ /**
+ * @var string a prefix for 'extra' fields from the Monolog record (optional)
+ */
+ protected $extraPrefix;
+
+ /**
+ * @var string a prefix for 'context' fields from the Monolog record (optional)
+ */
+ protected $contextPrefix;
+
+ /**
+ * Translates Monolog log levels to Graylog2 log priorities.
+ */
+ private $logLevels = array(
+ Logger::DEBUG => 7,
+ Logger::INFO => 6,
+ Logger::NOTICE => 5,
+ Logger::WARNING => 4,
+ Logger::ERROR => 3,
+ Logger::CRITICAL => 2,
+ Logger::ALERT => 1,
+ Logger::EMERGENCY => 0,
+ );
+
+ public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_')
+ {
+ parent::__construct('U.u');
+
+ $this->systemName = $systemName ?: gethostname();
+
+ $this->extraPrefix = $extraPrefix;
+ $this->contextPrefix = $contextPrefix;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function format(array $record)
+ {
+ $record = parent::format($record);
+
+ if (!isset($record['datetime'], $record['message'], $record['level'])) {
+ throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given');
+ }
+
+ $message = new Message();
+ $message
+ ->setTimestamp($record['datetime'])
+ ->setShortMessage((string) $record['message'])
+ ->setHost($this->systemName)
+ ->setLevel($this->logLevels[$record['level']]);
+
+ // start count with message length + system name length + 200 for padding / metadata
+ $len = 200 + strlen((string) $record['message']) + strlen($this->systemName);
+
+ if ($len > self::MAX_LENGTH) {
+ $message->setShortMessage(substr($record['message'], 0, self::MAX_LENGTH - 200));
+
+ return $message;
+ }
+
+ if (isset($record['channel'])) {
+ $message->setFacility($record['channel']);
+ $len += strlen($record['channel']);
+ }
+ if (isset($record['extra']['line'])) {
+ $message->setLine($record['extra']['line']);
+ $len += 10;
+ unset($record['extra']['line']);
+ }
+ if (isset($record['extra']['file'])) {
+ $message->setFile($record['extra']['file']);
+ $len += strlen($record['extra']['file']);
+ unset($record['extra']['file']);
+ }
+
+ foreach ($record['extra'] as $key => $val) {
+ $val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
+ $len += strlen($this->extraPrefix . $key . $val);
+ if ($len > self::MAX_LENGTH) {
+ $message->setAdditional($this->extraPrefix . $key, substr($val, 0, self::MAX_LENGTH - $len));
+ break;
+ }
+ $message->setAdditional($this->extraPrefix . $key, $val);
+ }
+
+ foreach ($record['context'] as $key => $val) {
+ $val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
+ $len += strlen($this->contextPrefix . $key . $val);
+ if ($len > self::MAX_LENGTH) {
+ $message->setAdditional($this->contextPrefix . $key, substr($val, 0, self::MAX_LENGTH - $len));
+ break;
+ }
+ $message->setAdditional($this->contextPrefix . $key, $val);
+ }
+
+ if (null === $message->getFile() && isset($record['context']['exception']['file'])) {
+ if (preg_match("/^(.+):([0-9]+)$/", $record['context']['exception']['file'], $matches)) {
+ $message->setFile($matches[1]);
+ $message->setLine($matches[2]);
+ }
+ }
+
+ return $message;
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php
new file mode 100644
index 00000000..3eec95f6
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php
@@ -0,0 +1,141 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Formatter;
+
+use Monolog\Logger;
+
+/**
+ * Formats incoming records into an HTML table
+ *
+ * This is especially useful for html email logging
+ *
+ * @author Tiago Brito
+ */
+class HtmlFormatter extends NormalizerFormatter
+{
+ /**
+ * Translates Monolog log levels to html color priorities.
+ */
+ protected $logLevels = array(
+ Logger::DEBUG => '#cccccc',
+ Logger::INFO => '#468847',
+ Logger::NOTICE => '#3a87ad',
+ Logger::WARNING => '#c09853',
+ Logger::ERROR => '#f0ad4e',
+ Logger::CRITICAL => '#FF7708',
+ Logger::ALERT => '#C12A19',
+ Logger::EMERGENCY => '#000000',
+ );
+
+ /**
+ * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
+ */
+ public function __construct($dateFormat = null)
+ {
+ parent::__construct($dateFormat);
+ }
+
+ /**
+ * Creates an HTML table row
+ *
+ * @param string $th Row header content
+ * @param string $td Row standard cell content
+ * @param bool $escapeTd false if td content must not be html escaped
+ * @return string
+ */
+ protected function addRow($th, $td = ' ', $escapeTd = true)
+ {
+ $th = htmlspecialchars($th, ENT_NOQUOTES, 'UTF-8');
+ if ($escapeTd) {
+ $td = '
'.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'
';
+ }
+
+ return "
\n
$th:
\n
".$td."
\n
";
+ }
+
+ /**
+ * Create a HTML h1 tag
+ *
+ * @param string $title Text to be in the h1
+ * @param int $level Error level
+ * @return string
+ */
+ protected function addTitle($title, $level)
+ {
+ $title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8');
+
+ return '
'.$title.'
';
+ }
+
+ /**
+ * Formats a log record.
+ *
+ * @param array $record A record to format
+ * @return mixed The formatted record
+ */
+ public function format(array $record)
+ {
+ $output = $this->addTitle($record['level_name'], $record['level']);
+ $output .= '