+
+
+
+ @yield('code')
+
-
- @yield('message')
+
+ @yield('message')
+
+
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Exceptions/MaintenanceModeException.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Exceptions/MaintenanceModeException.php
index 9fe9ffd6..5553fde6 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Exceptions/MaintenanceModeException.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Exceptions/MaintenanceModeException.php
@@ -7,6 +7,9 @@ use Illuminate\Support\Facades\Date;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
use Throwable;
+/**
+ * @deprecated Will be removed in a future Laravel version.
+ */
class MaintenanceModeException extends ServiceUnavailableHttpException
{
/**
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php
index 96169f3c..a20dffe2 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php
@@ -3,6 +3,7 @@
namespace Illuminate\Foundation\Http;
use Illuminate\Auth\Access\AuthorizationException;
+use Illuminate\Auth\Access\Response;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Validation\Factory as ValidationFactory;
use Illuminate\Contracts\Validation\ValidatesWhenResolved;
@@ -58,6 +59,13 @@ class FormRequest extends Request implements ValidatesWhenResolved
*/
protected $errorBag = 'default';
+ /**
+ * Indicates whether validation should stop after the first rule failure.
+ *
+ * @var bool
+ */
+ protected $stopOnFirstFailure = false;
+
/**
* The validator instance.
*
@@ -104,7 +112,7 @@ class FormRequest extends Request implements ValidatesWhenResolved
return $factory->make(
$this->validationData(), $this->container->call([$this, 'rules']),
$this->messages(), $this->attributes()
- );
+ )->stopOnFirstFailure($this->stopOnFirstFailure);
}
/**
@@ -156,11 +164,15 @@ class FormRequest extends Request implements ValidatesWhenResolved
* Determine if the request passes the authorization check.
*
* @return bool
+ *
+ * @throws \Illuminate\Auth\Access\AuthorizationException
*/
protected function passesAuthorization()
{
if (method_exists($this, 'authorize')) {
- return $this->container->call([$this, 'authorize']);
+ $result = $this->container->call([$this, 'authorize']);
+
+ return $result instanceof Response ? $result->authorize() : $result;
}
return true;
@@ -178,6 +190,19 @@ class FormRequest extends Request implements ValidatesWhenResolved
throw new AuthorizationException;
}
+ /**
+ * Get a validated input container for the validated input.
+ *
+ * @param array|null $keys
+ * @return \Illuminate\Support\ValidatedInput|array
+ */
+ public function safe(array $keys = null)
+ {
+ return is_array($keys)
+ ? $this->validator->safe()->only($keys)
+ : $this->validator->safe();
+ }
+
/**
* Get the validated data from the request.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php
index 38f2fd6c..fa8d9aad 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php
@@ -31,7 +31,7 @@ class Kernel implements KernelContract
/**
* The bootstrap classes for the application.
*
- * @var array
+ * @var string[]
*/
protected $bootstrappers = [
\Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class,
@@ -68,13 +68,15 @@ class Kernel implements KernelContract
*
* Forces non-global middleware to always be in the given order.
*
- * @var array
+ * @var string[]
*/
protected $middlewarePriority = [
+ \Illuminate\Cookie\Middleware\EncryptCookies::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\Illuminate\Contracts\Auth\Middleware\AuthenticatesRequests::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class,
+ \Illuminate\Routing\Middleware\ThrottleRequestsWithRedis::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
@@ -253,7 +255,7 @@ class Kernel implements KernelContract
}
/**
- * Add a new middleware to beginning of the stack if it does not already exist.
+ * Add a new middleware to the beginning of the stack if it does not already exist.
*
* @param string $middleware
* @return $this
@@ -382,6 +384,16 @@ class Kernel implements KernelContract
}
}
+ /**
+ * Get the priority-sorted list of middleware.
+ *
+ * @return array
+ */
+ public function getMiddlewarePriority()
+ {
+ return $this->middlewarePriority;
+ }
+
/**
* Get the bootstrap classes for the application.
*
@@ -444,4 +456,17 @@ class Kernel implements KernelContract
{
return $this->app;
}
+
+ /**
+ * Set the Laravel application instance.
+ *
+ * @param \Illuminate\Contracts\Foundation\Application $app
+ * @return $this
+ */
+ public function setApplication(Application $app)
+ {
+ $this->app = $app;
+
+ return $this;
+ }
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php
index 5a34d186..01a14b44 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php
@@ -2,85 +2,7 @@
namespace Illuminate\Foundation\Http\Middleware;
-use Closure;
-use Illuminate\Contracts\Foundation\Application;
-use Illuminate\Foundation\Http\Exceptions\MaintenanceModeException;
-use Symfony\Component\HttpFoundation\IpUtils;
-
-class CheckForMaintenanceMode
+class CheckForMaintenanceMode extends PreventRequestsDuringMaintenance
{
- /**
- * The application implementation.
- *
- * @var \Illuminate\Contracts\Foundation\Application
- */
- protected $app;
-
- /**
- * The URIs that should be accessible while maintenance mode is enabled.
- *
- * @var array
- */
- protected $except = [];
-
- /**
- * Create a new middleware instance.
- *
- * @param \Illuminate\Contracts\Foundation\Application $app
- * @return void
- */
- public function __construct(Application $app)
- {
- $this->app = $app;
- }
-
- /**
- * Handle an incoming request.
- *
- * @param \Illuminate\Http\Request $request
- * @param \Closure $next
- * @return mixed
- *
- * @throws \Symfony\Component\HttpKernel\Exception\HttpException
- * @throws \Illuminate\Foundation\Http\Exceptions\MaintenanceModeException
- */
- public function handle($request, Closure $next)
- {
- if ($this->app->isDownForMaintenance()) {
- $data = json_decode(file_get_contents($this->app->storagePath().'/framework/down'), true);
-
- if (isset($data['allowed']) && IpUtils::checkIp($request->ip(), (array) $data['allowed'])) {
- return $next($request);
- }
-
- if ($this->inExceptArray($request)) {
- return $next($request);
- }
-
- throw new MaintenanceModeException($data['time'], $data['retry'], $data['message']);
- }
-
- return $next($request);
- }
-
- /**
- * Determine if the request has a URI that should be accessible in maintenance mode.
- *
- * @param \Illuminate\Http\Request $request
- * @return bool
- */
- protected function inExceptArray($request)
- {
- foreach ($this->except as $except) {
- if ($except !== '/') {
- $except = trim($except, '/');
- }
-
- if ($request->fullUrlIs($except) || $request->is($except)) {
- return true;
- }
- }
-
- return false;
- }
+ //
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php
index 813c9cf1..d19a07fa 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php
@@ -2,8 +2,35 @@
namespace Illuminate\Foundation\Http\Middleware;
+use Closure;
+
class ConvertEmptyStringsToNull extends TransformsRequest
{
+ /**
+ * All of the registered skip callbacks.
+ *
+ * @var array
+ */
+ protected static $skipCallbacks = [];
+
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ * @return mixed
+ */
+ public function handle($request, Closure $next)
+ {
+ foreach (static::$skipCallbacks as $callback) {
+ if ($callback($request)) {
+ return $next($request);
+ }
+ }
+
+ return parent::handle($request, $next);
+ }
+
/**
* Transform the given value.
*
@@ -15,4 +42,15 @@ class ConvertEmptyStringsToNull extends TransformsRequest
{
return is_string($value) && $value === '' ? null : $value;
}
+
+ /**
+ * Register a callback that instructs the middleware to be skipped.
+ *
+ * @param \Closure $callback
+ * @return void
+ */
+ public static function skipWhen(Closure $callback)
+ {
+ static::$skipCallbacks[] = $callback;
+ }
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php
index a61a1bd7..fca34f83 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php
@@ -58,9 +58,11 @@ class TransformsRequest
*/
protected function cleanArray(array $data, $keyPrefix = '')
{
- return collect($data)->map(function ($value, $key) use ($keyPrefix) {
- return $this->cleanValue($keyPrefix.$key, $value);
- })->all();
+ foreach ($data as $key => $value) {
+ $data[$key] = $this->cleanValue($keyPrefix.$key, $value);
+ }
+
+ return collect($data)->all();
}
/**
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php
index 4c8d1ddb..fe8f8f87 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php
@@ -2,8 +2,17 @@
namespace Illuminate\Foundation\Http\Middleware;
+use Closure;
+
class TrimStrings extends TransformsRequest
{
+ /**
+ * All of the registered skip callbacks.
+ *
+ * @var array
+ */
+ protected static $skipCallbacks = [];
+
/**
* The attributes that should not be trimmed.
*
@@ -13,6 +22,24 @@ class TrimStrings extends TransformsRequest
//
];
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ * @return mixed
+ */
+ public function handle($request, Closure $next)
+ {
+ foreach (static::$skipCallbacks as $callback) {
+ if ($callback($request)) {
+ return $next($request);
+ }
+ }
+
+ return parent::handle($request, $next);
+ }
+
/**
* Transform the given value.
*
@@ -28,4 +55,15 @@ class TrimStrings extends TransformsRequest
return is_string($value) ? trim($value) : $value;
}
+
+ /**
+ * Register a callback that instructs the middleware to be skipped.
+ *
+ * @param \Closure $callback
+ * @return void
+ */
+ public static function skipWhen(Closure $callback)
+ {
+ static::$skipCallbacks[] = $callback;
+ }
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Inspiring.php b/vendor/laravel/framework/src/Illuminate/Foundation/Inspiring.php
index 6023f563..0ca44fd6 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Inspiring.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Inspiring.php
@@ -23,15 +23,20 @@ class Inspiring
'Act only according to that maxim whereby you can, at the same time, will that it should become a universal law. - Immanuel Kant',
'An unexamined life is not worth living. - Socrates',
'Be present above all else. - Naval Ravikant',
+ 'Do what you can, with what you have, where you are. - Theodore Roosevelt',
'Happiness is not something readymade. It comes from your own actions. - Dalai Lama',
'He who is contented is rich. - Laozi',
- 'I begin to speak only when I am certain what I will say is not better left unsaid - Cato the Younger',
+ 'I begin to speak only when I am certain what I will say is not better left unsaid. - Cato the Younger',
+ 'I have not failed. I\'ve just found 10,000 ways that won\'t work. - Thomas Edison',
'If you do not have a consistent goal in life, you can not live it in a consistent way. - Marcus Aurelius',
+ 'It is never too late to be what you might have been. - George Eliot',
'It is not the man who has too little, but the man who craves more, that is poor. - Seneca',
'It is quality rather than quantity that matters. - Lucius Annaeus Seneca',
'Knowing is not enough; we must apply. Being willing is not enough; we must do. - Leonardo da Vinci',
'Let all your things have their places; let each part of your business have its time. - Benjamin Franklin',
+ 'Live as if you were to die tomorrow. Learn as if you were to live forever. - Mahatma Gandhi',
'No surplus words or unnecessary actions. - Marcus Aurelius',
+ 'Nothing worth having comes easy. - Theodore Roosevelt',
'Order your soul. Reduce your wants. - Augustine',
'People find pleasure in different ways. I find it in keeping my mind clear. - Marcus Aurelius',
'Simplicity is an acquired taste. - Katharine Gerould',
@@ -41,10 +46,16 @@ class Inspiring
'Smile, breathe, and go slowly. - Thich Nhat Hanh',
'The only way to do great work is to love what you do. - Steve Jobs',
'The whole future lies in uncertainty: live immediately. - Seneca',
- 'Very little is needed to make a happy life. - Marcus Antoninus',
+ 'Very little is needed to make a happy life. - Marcus Aurelius',
'Waste no more time arguing what a good man should be, be one. - Marcus Aurelius',
'Well begun is half done. - Aristotle',
'When there is no desire, all things are at peace. - Laozi',
+ 'Walk as if you are kissing the Earth with your feet. - Thich Nhat Hanh',
+ 'Because you are alive, everything is possible. - Thich Nhat Hanh',
+ 'Breathing in, I calm body and mind. Breathing out, I smile. - Thich Nhat Hanh',
+ 'Life is available only in the present moment. - Thich Nhat Hanh',
+ 'The best way to take care of the future is to take care of the present moment. - Thich Nhat Hanh',
+ 'Nothing in life is to be feared, it is only to be understood. Now is the time to understand more, so that we may fear less. - Marie Curie',
])->random();
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Mix.php b/vendor/laravel/framework/src/Illuminate/Foundation/Mix.php
index 271d7dbd..edd48178 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Mix.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Mix.php
@@ -29,9 +29,15 @@ class Mix
$manifestDirectory = "/{$manifestDirectory}";
}
- if (file_exists(public_path($manifestDirectory.'/hot'))) {
+ if (is_file(public_path($manifestDirectory.'/hot'))) {
$url = rtrim(file_get_contents(public_path($manifestDirectory.'/hot')));
+ $customUrl = app('config')->get('app.mix_hot_proxy_url');
+
+ if (! empty($customUrl)) {
+ return new HtmlString("{$customUrl}{$path}");
+ }
+
if (Str::startsWith($url, ['http://', 'https://'])) {
return new HtmlString(Str::after($url, ':').$path);
}
@@ -42,7 +48,7 @@ class Mix
$manifestPath = public_path($manifestDirectory.'/mix-manifest.json');
if (! isset($manifests[$manifestPath])) {
- if (! file_exists($manifestPath)) {
+ if (! is_file($manifestPath)) {
throw new Exception('The Mix manifest does not exist.');
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php b/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php
index 9356cef0..202a8beb 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php
@@ -102,11 +102,11 @@ class PackageManifest
return $this->manifest;
}
- if (! file_exists($this->manifestPath)) {
+ if (! is_file($this->manifestPath)) {
$this->build();
}
- return $this->manifest = file_exists($this->manifestPath) ?
+ return $this->manifest = is_file($this->manifestPath) ?
$this->files->getRequire($this->manifestPath) : [];
}
@@ -154,7 +154,7 @@ class PackageManifest
*/
protected function packagesToIgnore()
{
- if (! file_exists($this->basePath.'/composer.json')) {
+ if (! is_file($this->basePath.'/composer.json')) {
return [];
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php b/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php
old mode 100644
new mode 100755
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
old mode 100644
new mode 100755
index c7625173..e003ab12
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
@@ -6,10 +6,17 @@ use Illuminate\Auth\Console\ClearResetsCommand;
use Illuminate\Cache\Console\CacheTableCommand;
use Illuminate\Cache\Console\ClearCommand as CacheClearCommand;
use Illuminate\Cache\Console\ForgetCommand as CacheForgetCommand;
+use Illuminate\Console\Scheduling\ScheduleClearCacheCommand;
use Illuminate\Console\Scheduling\ScheduleFinishCommand;
+use Illuminate\Console\Scheduling\ScheduleListCommand;
use Illuminate\Console\Scheduling\ScheduleRunCommand;
+use Illuminate\Console\Scheduling\ScheduleTestCommand;
+use Illuminate\Console\Scheduling\ScheduleWorkCommand;
use Illuminate\Contracts\Support\DeferrableProvider;
+use Illuminate\Database\Console\DbCommand;
+use Illuminate\Database\Console\DumpCommand;
use Illuminate\Database\Console\Factories\FactoryMakeCommand;
+use Illuminate\Database\Console\PruneCommand;
use Illuminate\Database\Console\Seeds\SeedCommand;
use Illuminate\Database\Console\Seeds\SeederMakeCommand;
use Illuminate\Database\Console\WipeCommand;
@@ -55,12 +62,18 @@ use Illuminate\Foundation\Console\VendorPublishCommand;
use Illuminate\Foundation\Console\ViewCacheCommand;
use Illuminate\Foundation\Console\ViewClearCommand;
use Illuminate\Notifications\Console\NotificationTableCommand;
+use Illuminate\Queue\Console\BatchesTableCommand;
+use Illuminate\Queue\Console\ClearCommand as QueueClearCommand;
use Illuminate\Queue\Console\FailedTableCommand;
use Illuminate\Queue\Console\FlushFailedCommand as FlushFailedQueueCommand;
use Illuminate\Queue\Console\ForgetFailedCommand as ForgetFailedQueueCommand;
use Illuminate\Queue\Console\ListenCommand as QueueListenCommand;
use Illuminate\Queue\Console\ListFailedCommand as ListFailedQueueCommand;
+use Illuminate\Queue\Console\MonitorCommand as QueueMonitorCommand;
+use Illuminate\Queue\Console\PruneBatchesCommand as PruneBatchesQueueCommand;
+use Illuminate\Queue\Console\PruneFailedJobsCommand;
use Illuminate\Queue\Console\RestartCommand as QueueRestartCommand;
+use Illuminate\Queue\Console\RetryBatchCommand as QueueRetryBatchCommand;
use Illuminate\Queue\Console\RetryCommand as QueueRetryCommand;
use Illuminate\Queue\Console\TableCommand;
use Illuminate\Queue\Console\WorkCommand as QueueWorkCommand;
@@ -83,6 +96,8 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
'ClearResets' => 'command.auth.resets.clear',
'ConfigCache' => 'command.config.cache',
'ConfigClear' => 'command.config.clear',
+ 'Db' => DbCommand::class,
+ 'DbPrune' => 'command.db.prune',
'DbWipe' => 'command.db.wipe',
'Down' => 'command.down',
'Environment' => 'command.environment',
@@ -93,19 +108,29 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
'Optimize' => 'command.optimize',
'OptimizeClear' => 'command.optimize.clear',
'PackageDiscover' => 'command.package.discover',
+ 'QueueClear' => 'command.queue.clear',
'QueueFailed' => 'command.queue.failed',
'QueueFlush' => 'command.queue.flush',
'QueueForget' => 'command.queue.forget',
'QueueListen' => 'command.queue.listen',
+ 'QueueMonitor' => 'command.queue.monitor',
+ 'QueuePruneBatches' => 'command.queue.prune-batches',
+ 'QueuePruneFailedJobs' => 'command.queue.prune-failed-jobs',
'QueueRestart' => 'command.queue.restart',
'QueueRetry' => 'command.queue.retry',
+ 'QueueRetryBatch' => 'command.queue.retry-batch',
'QueueWork' => 'command.queue.work',
'RouteCache' => 'command.route.cache',
'RouteClear' => 'command.route.clear',
'RouteList' => 'command.route.list',
+ 'SchemaDump' => 'command.schema.dump',
'Seed' => 'command.seed',
'ScheduleFinish' => ScheduleFinishCommand::class,
+ 'ScheduleList' => ScheduleListCommand::class,
'ScheduleRun' => ScheduleRunCommand::class,
+ 'ScheduleClearCache' => ScheduleClearCacheCommand::class,
+ 'ScheduleTest' => ScheduleTestCommand::class,
+ 'ScheduleWork' => ScheduleWorkCommand::class,
'StorageLink' => 'command.storage.link',
'Up' => 'command.up',
'ViewCache' => 'command.view.cache',
@@ -140,6 +165,7 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
'ProviderMake' => 'command.provider.make',
'QueueFailedTable' => 'command.queue.failed-table',
'QueueTable' => 'command.queue.table',
+ 'QueueBatchesTable' => 'command.queue.batches-table',
'RequestMake' => 'command.request.make',
'ResourceMake' => 'command.resource.make',
'RuleMake' => 'command.rule.make',
@@ -322,6 +348,28 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
});
}
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerDbCommand()
+ {
+ $this->app->singleton(DbCommand::class);
+ }
+
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerDbPruneCommand()
+ {
+ $this->app->singleton('command.db.prune', function ($app) {
+ return new PruneCommand($app['events']);
+ });
+ }
+
/**
* Register the command.
*
@@ -438,7 +486,7 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
protected function registerEventListCommand()
{
$this->app->singleton('command.event.list', function () {
- return new EventListCommand();
+ return new EventListCommand;
});
}
@@ -658,6 +706,42 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
});
}
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerQueueMonitorCommand()
+ {
+ $this->app->singleton('command.queue.monitor', function ($app) {
+ return new QueueMonitorCommand($app['queue'], $app['events']);
+ });
+ }
+
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerQueuePruneBatchesCommand()
+ {
+ $this->app->singleton('command.queue.prune-batches', function () {
+ return new PruneBatchesQueueCommand;
+ });
+ }
+
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerQueuePruneFailedJobsCommand()
+ {
+ $this->app->singleton('command.queue.prune-failed-jobs', function () {
+ return new PruneFailedJobsCommand;
+ });
+ }
+
/**
* Register the command.
*
@@ -682,6 +766,18 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
});
}
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerQueueRetryBatchCommand()
+ {
+ $this->app->singleton('command.queue.retry-batch', function () {
+ return new QueueRetryBatchCommand;
+ });
+ }
+
/**
* Register the command.
*
@@ -694,6 +790,18 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
});
}
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerQueueClearCommand()
+ {
+ $this->app->singleton('command.queue.clear', function () {
+ return new QueueClearCommand;
+ });
+ }
+
/**
* Register the command.
*
@@ -718,6 +826,18 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
});
}
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerQueueBatchesTableCommand()
+ {
+ $this->app->singleton('command.queue.batches-table', function ($app) {
+ return new BatchesTableCommand($app['files'], $app['composer']);
+ });
+ }
+
/**
* Register the command.
*
@@ -826,6 +946,18 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
});
}
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerSchemaDumpCommand()
+ {
+ $this->app->singleton('command.schema.dump', function () {
+ return new DumpCommand;
+ });
+ }
+
/**
* Register the command.
*
@@ -838,6 +970,16 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
});
}
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerScheduleClearCacheCommand()
+ {
+ $this->app->singleton(ScheduleClearCacheCommand::class);
+ }
+
/**
* Register the command.
*
@@ -848,6 +990,16 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
$this->app->singleton(ScheduleFinishCommand::class);
}
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerScheduleListCommand()
+ {
+ $this->app->singleton(ScheduleListCommand::class);
+ }
+
/**
* Register the command.
*
@@ -858,6 +1010,26 @@ class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvid
$this->app->singleton(ScheduleRunCommand::class);
}
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerScheduleTestCommand()
+ {
+ $this->app->singleton(ScheduleTestCommand::class);
+ }
+
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerScheduleWorkCommand()
+ {
+ $this->app->singleton(ScheduleWorkCommand::class);
+ }
+
/**
* Register the command.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php
old mode 100644
new mode 100755
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php
index b23f1873..f6131ca5 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php
@@ -11,7 +11,7 @@ class ConsoleSupportServiceProvider extends AggregateServiceProvider implements
/**
* The provider class names.
*
- * @var array
+ * @var string[]
*/
protected $providers = [
ArtisanServiceProvider::class,
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php
index b9d84496..bb69c885 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php
@@ -3,8 +3,11 @@
namespace Illuminate\Foundation\Providers;
use Illuminate\Http\Request;
+use Illuminate\Log\Events\MessageLogged;
use Illuminate\Support\AggregateServiceProvider;
use Illuminate\Support\Facades\URL;
+use Illuminate\Testing\LoggedExceptionCollection;
+use Illuminate\Testing\ParallelTestingServiceProvider;
use Illuminate\Validation\ValidationException;
class FoundationServiceProvider extends AggregateServiceProvider
@@ -12,10 +15,11 @@ class FoundationServiceProvider extends AggregateServiceProvider
/**
* The provider class names.
*
- * @var array
+ * @var string[]
*/
protected $providers = [
FormRequestServiceProvider::class,
+ ParallelTestingServiceProvider::class,
];
/**
@@ -43,6 +47,7 @@ class FoundationServiceProvider extends AggregateServiceProvider
$this->registerRequestValidation();
$this->registerRequestSignatureValidation();
+ $this->registerExceptionTracking();
}
/**
@@ -79,5 +84,33 @@ class FoundationServiceProvider extends AggregateServiceProvider
Request::macro('hasValidSignature', function ($absolute = true) {
return URL::hasValidSignature($this, $absolute);
});
+
+ Request::macro('hasValidRelativeSignature', function () {
+ return URL::hasValidSignature($this, $absolute = false);
+ });
+ }
+
+ /**
+ * Register an event listener to track logged exceptions.
+ *
+ * @return void
+ */
+ protected function registerExceptionTracking()
+ {
+ if (! $this->app->runningUnitTests()) {
+ return;
+ }
+
+ $this->app->instance(
+ LoggedExceptionCollection::class,
+ new LoggedExceptionCollection
+ );
+
+ $this->app->make('events')->listen(MessageLogged::class, function ($event) {
+ if (isset($event->context['exception'])) {
+ $this->app->make(LoggedExceptionCollection::class)
+ ->push($event->context['exception']);
+ }
+ });
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php
index 11e63a8d..70ea3086 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php
@@ -27,19 +27,31 @@ class EventServiceProvider extends ServiceProvider
*
* @return void
*/
+ public function register()
+ {
+ $this->booting(function () {
+ $events = $this->getEvents();
+
+ foreach ($events as $event => $listeners) {
+ foreach (array_unique($listeners) as $listener) {
+ Event::listen($event, $listener);
+ }
+ }
+
+ foreach ($this->subscribe as $subscriber) {
+ Event::subscribe($subscriber);
+ }
+ });
+ }
+
+ /**
+ * Boot any application services.
+ *
+ * @return void
+ */
public function boot()
{
- $events = $this->getEvents();
-
- foreach ($events as $event => $listeners) {
- foreach (array_unique($listeners) as $listener) {
- Event::listen($event, $listener);
- }
- }
-
- foreach ($this->subscribe as $subscriber) {
- Event::subscribe($subscriber);
- }
+ //
}
/**
@@ -107,7 +119,7 @@ class EventServiceProvider extends ServiceProvider
->reduce(function ($discovered, $directory) {
return array_merge_recursive(
$discovered,
- DiscoverEvents::within($directory, base_path())
+ DiscoverEvents::within($directory, $this->eventDiscoveryBasePath())
);
}, []);
}
@@ -123,4 +135,14 @@ class EventServiceProvider extends ServiceProvider
$this->app->path('Listeners'),
];
}
+
+ /**
+ * Get the base path to be used during event discovery.
+ *
+ * @return string
+ */
+ protected function eventDiscoveryBasePath()
+ {
+ return base_path();
+ }
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php
index b281da1a..c8679e51 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php
@@ -2,6 +2,7 @@
namespace Illuminate\Foundation\Support\Providers;
+use Closure;
use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
@@ -21,6 +22,36 @@ class RouteServiceProvider extends ServiceProvider
*/
protected $namespace;
+ /**
+ * The callback that should be used to load the application's routes.
+ *
+ * @var \Closure|null
+ */
+ protected $loadRoutesUsing;
+
+ /**
+ * Register any application services.
+ *
+ * @return void
+ */
+ public function register()
+ {
+ $this->booted(function () {
+ $this->setRootControllerNamespace();
+
+ if ($this->routesAreCached()) {
+ $this->loadCachedRoutes();
+ } else {
+ $this->loadRoutes();
+
+ $this->app->booted(function () {
+ $this->app['router']->getRoutes()->refreshNameLookups();
+ $this->app['router']->getRoutes()->refreshActionLookups();
+ });
+ }
+ });
+ }
+
/**
* Bootstrap any application services.
*
@@ -28,18 +59,20 @@ class RouteServiceProvider extends ServiceProvider
*/
public function boot()
{
- $this->setRootControllerNamespace();
+ //
+ }
- if ($this->routesAreCached()) {
- $this->loadCachedRoutes();
- } else {
- $this->loadRoutes();
+ /**
+ * Register the callback that will be used to load the application's routes.
+ *
+ * @param \Closure $routesCallback
+ * @return $this
+ */
+ protected function routes(Closure $routesCallback)
+ {
+ $this->loadRoutesUsing = $routesCallback;
- $this->app->booted(function () {
- $this->app['router']->getRoutes()->refreshNameLookups();
- $this->app['router']->getRoutes()->refreshActionLookups();
- });
- }
+ return $this;
}
/**
@@ -83,7 +116,9 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function loadRoutes()
{
- if (method_exists($this, 'map')) {
+ if (! is_null($this->loadRoutesUsing)) {
+ $this->app->call($this->loadRoutesUsing);
+ } elseif (method_exists($this, 'map')) {
$this->app->call([$this, 'map']);
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php
index 404a8bfb..9e8c0f58 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php
@@ -10,30 +10,30 @@ trait InteractsWithAuthentication
* Set the currently logged in user for the application.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
- * @param string|null $driver
+ * @param string|null $guard
* @return $this
*/
- public function actingAs(UserContract $user, $driver = null)
+ public function actingAs(UserContract $user, $guard = null)
{
- return $this->be($user, $driver);
+ return $this->be($user, $guard);
}
/**
* Set the currently logged in user for the application.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
- * @param string|null $driver
+ * @param string|null $guard
* @return $this
*/
- public function be(UserContract $user, $driver = null)
+ public function be(UserContract $user, $guard = null)
{
if (isset($user->wasRecentlyCreated) && $user->wasRecentlyCreated) {
$user->wasRecentlyCreated = false;
}
- $this->app['auth']->guard($driver)->setUser($user);
+ $this->app['auth']->guard($guard)->setUser($user);
- $this->app['auth']->shouldUse($driver);
+ $this->app['auth']->shouldUse($guard);
return $this;
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php
index b3477791..38409d3d 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php
@@ -23,7 +23,14 @@ trait InteractsWithConsole
public $expectedOutput = [];
/**
- * All of the expected ouput tables.
+ * All of the output lines that aren't expected to be displayed.
+ *
+ * @var array
+ */
+ public $unexpectedOutput = [];
+
+ /**
+ * All of the expected output tables.
*
* @var array
*/
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php
index c84852e0..6949f6f8 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php
@@ -77,6 +77,19 @@ trait InteractsWithContainer
return $this->instance($abstract, Mockery::spy(...array_filter(func_get_args())));
}
+ /**
+ * Instruct the container to forget a previously mocked / spied instance of an object.
+ *
+ * @param string $abstract
+ * @return $this
+ */
+ protected function forgetMock($abstract)
+ {
+ $this->app->forgetInstance($abstract);
+
+ return $this;
+ }
+
/**
* Register an empty handler for Laravel Mix in the container.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
index 10efb827..8ccd7e2f 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
@@ -2,11 +2,14 @@
namespace Illuminate\Foundation\Testing\Concerns;
+use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Arr;
+use Illuminate\Support\Facades\DB;
use Illuminate\Testing\Constraints\CountInDatabase;
use Illuminate\Testing\Constraints\HasInDatabase;
+use Illuminate\Testing\Constraints\NotSoftDeletedInDatabase;
use Illuminate\Testing\Constraints\SoftDeletedInDatabase;
use PHPUnit\Framework\Constraint\LogicalNot as ReverseConstraint;
@@ -15,7 +18,7 @@ trait InteractsWithDatabase
/**
* Assert that a given where condition exists in the database.
*
- * @param string $table
+ * @param \Illuminate\Database\Eloquent\Model|string $table
* @param array $data
* @param string|null $connection
* @return $this
@@ -23,7 +26,7 @@ trait InteractsWithDatabase
protected function assertDatabaseHas($table, array $data, $connection = null)
{
$this->assertThat(
- $table, new HasInDatabase($this->getConnection($connection), $data)
+ $this->getTable($table), new HasInDatabase($this->getConnection($connection), $data)
);
return $this;
@@ -32,7 +35,7 @@ trait InteractsWithDatabase
/**
* Assert that a given where condition does not exist in the database.
*
- * @param string $table
+ * @param \Illuminate\Database\Eloquent\Model|string $table
* @param array $data
* @param string|null $connection
* @return $this
@@ -43,7 +46,7 @@ trait InteractsWithDatabase
new HasInDatabase($this->getConnection($connection), $data)
);
- $this->assertThat($table, $constraint);
+ $this->assertThat($this->getTable($table), $constraint);
return $this;
}
@@ -51,7 +54,7 @@ trait InteractsWithDatabase
/**
* Assert the count of table entries.
*
- * @param string $table
+ * @param \Illuminate\Database\Eloquent\Model|string $table
* @param int $count
* @param string|null $connection
* @return $this
@@ -59,7 +62,7 @@ trait InteractsWithDatabase
protected function assertDatabaseCount($table, int $count, $connection = null)
{
$this->assertThat(
- $table, new CountInDatabase($this->getConnection($connection), $count)
+ $this->getTable($table), new CountInDatabase($this->getConnection($connection), $count)
);
return $this;
@@ -79,7 +82,7 @@ trait InteractsWithDatabase
return $this->assertDatabaseMissing($table->getTable(), [$table->getKeyName() => $table->getKey()], $table->getConnectionName());
}
- $this->assertDatabaseMissing($table, $data, $connection);
+ $this->assertDatabaseMissing($this->getTable($table), $data, $connection);
return $this;
}
@@ -96,16 +99,78 @@ trait InteractsWithDatabase
protected function assertSoftDeleted($table, array $data = [], $connection = null, $deletedAtColumn = 'deleted_at')
{
if ($this->isSoftDeletableModel($table)) {
- return $this->assertSoftDeleted($table->getTable(), [$table->getKeyName() => $table->getKey()], $table->getConnectionName(), $table->getDeletedAtColumn());
+ return $this->assertSoftDeleted(
+ $table->getTable(),
+ array_merge($data, [$table->getKeyName() => $table->getKey()]),
+ $table->getConnectionName(),
+ $table->getDeletedAtColumn()
+ );
}
$this->assertThat(
- $table, new SoftDeletedInDatabase($this->getConnection($connection), $data, $deletedAtColumn)
+ $this->getTable($table), new SoftDeletedInDatabase($this->getConnection($connection), $data, $deletedAtColumn)
);
return $this;
}
+ /**
+ * Assert the given record has not been "soft deleted".
+ *
+ * @param \Illuminate\Database\Eloquent\Model|string $table
+ * @param array $data
+ * @param string|null $connection
+ * @param string|null $deletedAtColumn
+ * @return $this
+ */
+ protected function assertNotSoftDeleted($table, array $data = [], $connection = null, $deletedAtColumn = 'deleted_at')
+ {
+ if ($this->isSoftDeletableModel($table)) {
+ return $this->assertNotSoftDeleted(
+ $table->getTable(),
+ array_merge($data, [$table->getKeyName() => $table->getKey()]),
+ $table->getConnectionName(),
+ $table->getDeletedAtColumn()
+ );
+ }
+
+ $this->assertThat(
+ $this->getTable($table), new NotSoftDeletedInDatabase($this->getConnection($connection), $data, $deletedAtColumn)
+ );
+
+ return $this;
+ }
+
+ /**
+ * Assert the given model exists in the database.
+ *
+ * @param \Illuminate\Database\Eloquent\Model $model
+ * @return $this
+ */
+ protected function assertModelExists($model)
+ {
+ return $this->assertDatabaseHas(
+ $model->getTable(),
+ [$model->getKeyName() => $model->getKey()],
+ $model->getConnectionName()
+ );
+ }
+
+ /**
+ * Assert the given model does not exist in the database.
+ *
+ * @param \Illuminate\Database\Eloquent\Model $model
+ * @return $this
+ */
+ protected function assertModelMissing($model)
+ {
+ return $this->assertDatabaseMissing(
+ $model->getTable(),
+ [$model->getKeyName() => $model->getKey()],
+ $model->getConnectionName()
+ );
+ }
+
/**
* Determine if the argument is a soft deletable model.
*
@@ -118,6 +183,25 @@ trait InteractsWithDatabase
&& in_array(SoftDeletes::class, class_uses_recursive($model));
}
+ /**
+ * Cast a JSON string to a database compatible type.
+ *
+ * @param array|string $value
+ * @return \Illuminate\Database\Query\Expression
+ */
+ public function castAsJson($value)
+ {
+ if ($value instanceof Jsonable) {
+ $value = $value->toJson();
+ } elseif (is_array($value) || is_object($value)) {
+ $value = json_encode($value);
+ }
+
+ $value = DB::connection()->getPdo()->quote($value);
+
+ return DB::raw("CAST($value AS JSON)");
+ }
+
/**
* Get the database connection.
*
@@ -133,13 +217,24 @@ trait InteractsWithDatabase
return $database->connection($connection);
}
+ /**
+ * Get the table name from the given model or string.
+ *
+ * @param \Illuminate\Database\Eloquent\Model|string $table
+ * @return string
+ */
+ protected function getTable($table)
+ {
+ return is_subclass_of($table, Model::class) ? (new $table)->getTable() : $table;
+ }
+
/**
* Seed a given database connection.
*
* @param array|string $class
* @return $this
*/
- public function seed($class = 'DatabaseSeeder')
+ public function seed($class = 'Database\\Seeders\\DatabaseSeeder')
{
foreach (Arr::wrap($class) as $class) {
$this->artisan('db:seed', ['--class' => $class, '--no-interaction' => true]);
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php
index 36253f62..5ce5686d 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php
@@ -125,7 +125,7 @@ trait InteractsWithExceptionHandling
if ($e instanceof NotFoundHttpException) {
throw new NotFoundHttpException(
- "{$request->method()} {$request->url()}", null, $e->getCode()
+ "{$request->method()} {$request->url()}", $e, $e->getCode()
);
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithRedis.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithRedis.php
index a68995b0..5c8d9040 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithRedis.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithRedis.php
@@ -30,22 +30,18 @@ trait InteractsWithRedis
*/
public function setUpRedis()
{
- $app = $this->app ?? new Application;
- $host = Env::get('REDIS_HOST', '127.0.0.1');
- $port = Env::get('REDIS_PORT', 6379);
-
if (! extension_loaded('redis')) {
$this->markTestSkipped('The redis extension is not installed. Please install the extension to enable '.__CLASS__);
-
- return;
}
if (static::$connectionFailedOnceWithDefaultsSkip) {
$this->markTestSkipped('Trying default host/port failed, please set environment variable REDIS_HOST & REDIS_PORT to enable '.__CLASS__);
-
- return;
}
+ $app = $this->app ?? new Application;
+ $host = Env::get('REDIS_HOST', '127.0.0.1');
+ $port = Env::get('REDIS_PORT', 6379);
+
foreach ($this->redisDriverProvider() as $driver) {
$this->redis[$driver[0]] = new RedisManager($app, $driver[0], [
'cluster' => false,
@@ -57,6 +53,7 @@ trait InteractsWithRedis
'port' => $port,
'database' => 5,
'timeout' => 0.5,
+ 'name' => 'default',
],
]);
}
@@ -66,6 +63,7 @@ trait InteractsWithRedis
} catch (Exception $e) {
if ($host === '127.0.0.1' && $port === 6379 && Env::get('REDIS_HOST') === null) {
static::$connectionFailedOnceWithDefaultsSkip = true;
+
$this->markTestSkipped('Trying default host/port failed, please set environment variable REDIS_HOST & REDIS_PORT to enable '.__CLASS__);
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php
index 01f84328..36e6734d 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php
@@ -6,6 +6,7 @@ use Illuminate\Contracts\Http\Kernel as HttpKernel;
use Illuminate\Cookie\CookieValuePrefix;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
+use Illuminate\Testing\LoggedExceptionCollection;
use Illuminate\Testing\TestResponse;
use Symfony\Component\HttpFoundation\File\UploadedFile as SymfonyUploadedFile;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
@@ -509,12 +510,12 @@ trait MakesHttpRequests
$request = Request::createFromBase($symfonyRequest)
);
+ $kernel->terminate($request, $response);
+
if ($this->followRedirects) {
$response = $this->followRedirects($response);
}
- $kernel->terminate($request, $response);
-
return $this->createTestResponse($response);
}
@@ -624,12 +625,12 @@ trait MakesHttpRequests
*/
protected function followRedirects($response)
{
+ $this->followRedirects = false;
+
while ($response->isRedirect()) {
$response = $this->get($response->headers->get('Location'));
}
- $this->followRedirects = false;
-
return $response;
}
@@ -641,6 +642,12 @@ trait MakesHttpRequests
*/
protected function createTestResponse($response)
{
- return TestResponse::fromBaseResponse($response);
+ return tap(TestResponse::fromBaseResponse($response), function ($response) {
+ $response->withExceptions(
+ $this->app->bound(LoggedExceptionCollection::class)
+ ? $this->app->make(LoggedExceptionCollection::class)
+ : new LoggedExceptionCollection
+ );
+ });
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php
index 7fc360e7..66622950 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php
@@ -8,6 +8,9 @@ use Illuminate\Contracts\Notifications\Dispatcher as NotificationDispatcher;
use Illuminate\Support\Facades\Event;
use Mockery;
+/**
+ * @deprecated Will be removed in a future Laravel version.
+ */
trait MocksApplicationServices
{
/**
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php
index 889a4532..10a3a730 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php
@@ -3,9 +3,12 @@
namespace Illuminate\Foundation\Testing;
use Illuminate\Contracts\Console\Kernel;
+use Illuminate\Foundation\Testing\Traits\CanConfigureMigrationCommands;
trait DatabaseMigrations
{
+ use CanConfigureMigrationCommands;
+
/**
* Define hooks to migrate the database before and after each test.
*
@@ -13,7 +16,7 @@ trait DatabaseMigrations
*/
public function runDatabaseMigrations()
{
- $this->artisan('migrate:fresh');
+ $this->artisan('migrate:fresh', $this->migrateFreshUsing());
$this->app[Kernel::class]->setArtisan(null);
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php
index 9870153b..e162e188 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php
@@ -14,14 +14,22 @@ trait DatabaseTransactions
$database = $this->app->make('db');
foreach ($this->connectionsToTransact() as $name) {
- $database->connection($name)->beginTransaction();
+ $connection = $database->connection($name);
+ $dispatcher = $connection->getEventDispatcher();
+
+ $connection->unsetEventDispatcher();
+ $connection->beginTransaction();
+ $connection->setEventDispatcher($dispatcher);
}
$this->beforeApplicationDestroyed(function () use ($database) {
foreach ($this->connectionsToTransact() as $name) {
$connection = $database->connection($name);
+ $dispatcher = $connection->getEventDispatcher();
+ $connection->unsetEventDispatcher();
$connection->rollBack();
+ $connection->setEventDispatcher($dispatcher);
$connection->disconnect();
}
});
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabase.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabase.php
index 0cbeea12..48390039 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabase.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabase.php
@@ -3,9 +3,12 @@
namespace Illuminate\Foundation\Testing;
use Illuminate\Contracts\Console\Kernel;
+use Illuminate\Foundation\Testing\Traits\CanConfigureMigrationCommands;
trait RefreshDatabase
{
+ use CanConfigureMigrationCommands;
+
/**
* Define hooks to migrate the database before and after each test.
*
@@ -16,6 +19,8 @@ trait RefreshDatabase
$this->usingInMemoryDatabase()
? $this->refreshInMemoryDatabase()
: $this->refreshTestDatabase();
+
+ $this->afterRefreshingDatabase();
}
/**
@@ -49,7 +54,10 @@ trait RefreshDatabase
*/
protected function migrateUsing()
{
- return [];
+ return [
+ '--seed' => $this->shouldSeed(),
+ '--seeder' => $this->seeder(),
+ ];
}
/**
@@ -70,19 +78,6 @@ trait RefreshDatabase
$this->beginDatabaseTransaction();
}
- /**
- * The parameters that should be used when running "migrate:fresh".
- *
- * @return array
- */
- protected function migrateFreshUsing()
- {
- return [
- '--drop-views' => $this->shouldDropViews(),
- '--drop-types' => $this->shouldDropTypes(),
- ];
- }
-
/**
* Begin a database transaction on the testing database.
*
@@ -107,7 +102,7 @@ trait RefreshDatabase
$dispatcher = $connection->getEventDispatcher();
$connection->unsetEventDispatcher();
- $connection->rollback();
+ $connection->rollBack();
$connection->setEventDispatcher($dispatcher);
$connection->disconnect();
}
@@ -126,24 +121,12 @@ trait RefreshDatabase
}
/**
- * Determine if views should be dropped when refreshing the database.
+ * Perform any work that should take place once the database has finished refreshing.
*
- * @return bool
+ * @return void
*/
- protected function shouldDropViews()
+ protected function afterRefreshingDatabase()
{
- return property_exists($this, 'dropViews')
- ? $this->dropViews : false;
- }
-
- /**
- * Determine if types should be dropped when refreshing the database.
- *
- * @return bool
- */
- protected function shouldDropTypes()
- {
- return property_exists($this, 'dropTypes')
- ? $this->dropTypes : false;
+ // ...
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabaseState.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabaseState.php
index 1f330873..a42d3d08 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabaseState.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/RefreshDatabaseState.php
@@ -10,4 +10,11 @@ class RefreshDatabaseState
* @var bool
*/
public static $migrated = false;
+
+ /**
+ * Indicates if a lazy refresh hook has been invoked.
+ *
+ * @var bool
+ */
+ public static $lazilyRefreshed = false;
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php
index 3bcd3f02..b18d0adb 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php
@@ -6,7 +6,9 @@ use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Illuminate\Console\Application as Artisan;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Queue\Queue;
use Illuminate\Support\Facades\Facade;
+use Illuminate\Support\Facades\ParallelTesting;
use Illuminate\Support\Str;
use Mockery;
use Mockery\Exception\InvalidCountException;
@@ -20,14 +22,17 @@ abstract class TestCase extends BaseTestCase
Concerns\InteractsWithAuthentication,
Concerns\InteractsWithConsole,
Concerns\InteractsWithDatabase,
+ Concerns\InteractsWithDeprecationHandling,
Concerns\InteractsWithExceptionHandling,
Concerns\InteractsWithSession,
+ Concerns\InteractsWithTime,
+ Concerns\InteractsWithViews,
Concerns\MocksApplicationServices;
/**
* The Illuminate application instance.
*
- * @var \Illuminate\Contracts\Foundation\Application
+ * @var \Illuminate\Foundation\Application
*/
protected $app;
@@ -79,6 +84,8 @@ abstract class TestCase extends BaseTestCase
if (! $this->app) {
$this->refreshApplication();
+
+ ParallelTesting::callSetUpTestCaseCallbacks($this);
}
$this->setUpTraits();
@@ -150,6 +157,8 @@ abstract class TestCase extends BaseTestCase
if ($this->app) {
$this->callBeforeApplicationDestroyedCallbacks();
+ ParallelTesting::callTearDownTestCaseCallbacks($this);
+
$this->app->flush();
$this->app = null;
@@ -192,6 +201,8 @@ abstract class TestCase extends BaseTestCase
Artisan::forgetBootstrappers();
+ Queue::createPayloadUsing(null);
+
if ($this->callbackException) {
throw $this->callbackException;
}
diff --git a/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php b/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
index 5fbc613a..bd879a8f 100644
--- a/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
+++ b/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
@@ -12,7 +12,7 @@ use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Contracts\Support\Responsable;
use Illuminate\Contracts\Validation\Factory as ValidationFactory;
use Illuminate\Contracts\View\Factory as ViewFactory;
-use Illuminate\Database\Eloquent\Factory as EloquentFactory;
+use Illuminate\Foundation\Bus\PendingClosureDispatch;
use Illuminate\Foundation\Bus\PendingDispatch;
use Illuminate\Foundation\Mix;
use Illuminate\Http\Exceptions\HttpResponseException;
@@ -28,7 +28,7 @@ if (! function_exists('abort')) {
* @param \Symfony\Component\HttpFoundation\Response|\Illuminate\Contracts\Support\Responsable|int $code
* @param string $message
* @param array $headers
- * @return void
+ * @return never
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
@@ -384,11 +384,25 @@ if (! function_exists('dispatch')) {
*/
function dispatch($job)
{
- if ($job instanceof Closure) {
- $job = CallQueuedClosure::create($job);
- }
+ return $job instanceof Closure
+ ? new PendingClosureDispatch(CallQueuedClosure::create($job))
+ : new PendingDispatch($job);
+ }
+}
- return new PendingDispatch($job);
+if (! function_exists('dispatch_sync')) {
+ /**
+ * Dispatch a command to its appropriate handler in the current process.
+ *
+ * Queueable jobs will be dispatched to the "sync" queue.
+ *
+ * @param mixed $job
+ * @param mixed $handler
+ * @return mixed
+ */
+ function dispatch_sync($job, $handler = null)
+ {
+ return app(Dispatcher::class)->dispatchSync($job, $handler);
}
}
@@ -399,6 +413,8 @@ if (! function_exists('dispatch_now')) {
* @param mixed $job
* @param mixed $handler
* @return mixed
+ *
+ * @deprecated Will be removed in a future Laravel version.
*/
function dispatch_now($job, $handler = null)
{
@@ -406,48 +422,6 @@ if (! function_exists('dispatch_now')) {
}
}
-if (! function_exists('elixir')) {
- /**
- * Get the path to a versioned Elixir file.
- *
- * @param string $file
- * @param string $buildDirectory
- * @return string
- *
- * @throws \InvalidArgumentException
- *
- * @deprecated Use Laravel Mix instead.
- */
- function elixir($file, $buildDirectory = 'build')
- {
- static $manifest = [];
- static $manifestPath;
-
- if (empty($manifest) || $manifestPath !== $buildDirectory) {
- $path = public_path($buildDirectory.'/rev-manifest.json');
-
- if (file_exists($path)) {
- $manifest = json_decode(file_get_contents($path), true);
- $manifestPath = $buildDirectory;
- }
- }
-
- $file = ltrim($file, '/');
-
- if (isset($manifest[$file])) {
- return '/'.trim($buildDirectory.'/'.$manifest[$file], '/');
- }
-
- $unversioned = public_path($file);
-
- if (file_exists($unversioned)) {
- return '/'.trim($file, '/');
- }
-
- throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
- }
-}
-
if (! function_exists('encrypt')) {
/**
* Encrypt the given value.
@@ -477,26 +451,6 @@ if (! function_exists('event')) {
}
}
-if (! function_exists('factory')) {
- /**
- * Create a model factory builder for a given class and amount.
- *
- * @param string $class
- * @param int $amount
- * @return \Illuminate\Database\Eloquent\FactoryBuilder
- */
- function factory($class, $amount = null)
- {
- $factory = app(EloquentFactory::class);
-
- if (isset($amount) && is_int($amount)) {
- return $factory->of($class)->times($amount);
- }
-
- return $factory->of($class);
- }
-}
-
if (! function_exists('info')) {
/**
* Write some information to the log.
@@ -529,6 +483,19 @@ if (! function_exists('logger')) {
}
}
+if (! function_exists('lang_path')) {
+ /**
+ * Get the path to the language folder.
+ *
+ * @param string $path
+ * @return string
+ */
+ function lang_path($path = '')
+ {
+ return app('path.lang').($path ? DIRECTORY_SEPARATOR.$path : $path);
+ }
+}
+
if (! function_exists('logs')) {
/**
* Get a log driver instance.
@@ -650,11 +617,15 @@ if (! function_exists('report')) {
/**
* Report an exception.
*
- * @param \Throwable $exception
+ * @param \Throwable|string $exception
* @return void
*/
- function report(Throwable $exception)
+ function report($exception)
{
+ if (is_string($exception)) {
+ $exception = new Exception($exception);
+ }
+
app(ExceptionHandler::class)->report($exception);
}
}
@@ -665,7 +636,7 @@ if (! function_exists('request')) {
*
* @param array|string|null $key
* @param mixed $default
- * @return \Illuminate\Http\Request|string|array
+ * @return \Illuminate\Http\Request|string|array|null
*/
function request($key = null, $default = null)
{
@@ -701,7 +672,7 @@ if (! function_exists('rescue')) {
report($e);
}
- return $rescue instanceof Closure ? $rescue($e) : $rescue;
+ return value($rescue, $e);
}
}
}
@@ -737,7 +708,7 @@ if (! function_exists('response')) {
/**
* Return a new response from the application.
*
- * @param \Illuminate\View\View|string|array|null $content
+ * @param \Illuminate\Contracts\View\View|string|array|null $content
* @param int $status
* @param array $headers
* @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory
@@ -948,7 +919,7 @@ if (! function_exists('view')) {
* @param string|null $view
* @param \Illuminate\Contracts\Support\Arrayable|array $data
* @param array $mergeData
- * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
+ * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
*/
function view($view = null, $data = [], $mergeData = [])
{
diff --git a/vendor/laravel/framework/src/Illuminate/Hashing/ArgonHasher.php b/vendor/laravel/framework/src/Illuminate/Hashing/ArgonHasher.php
index 41109c9b..b999257f 100644
--- a/vendor/laravel/framework/src/Illuminate/Hashing/ArgonHasher.php
+++ b/vendor/laravel/framework/src/Illuminate/Hashing/ArgonHasher.php
@@ -45,7 +45,7 @@ class ArgonHasher extends AbstractHasher implements HasherContract
{
$this->time = $options['time'] ?? $this->time;
$this->memory = $options['memory'] ?? $this->memory;
- $this->threads = $options['threads'] ?? $this->threads;
+ $this->threads = $this->threads($options);
$this->verifyAlgorithm = $options['verify'] ?? $this->verifyAlgorithm;
}
@@ -180,13 +180,17 @@ class ArgonHasher extends AbstractHasher implements HasherContract
}
/**
- * Extract the threads value from the options array.
+ * Extract the thread's value from the options array.
*
* @param array $options
* @return int
*/
protected function threads(array $options)
{
+ if (defined('PASSWORD_ARGON2_PROVIDER') && PASSWORD_ARGON2_PROVIDER === 'sodium') {
+ return 1;
+ }
+
return $options['threads'] ?? $this->threads;
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php b/vendor/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php
old mode 100644
new mode 100755
diff --git a/vendor/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php
old mode 100644
new mode 100755
diff --git a/vendor/laravel/framework/src/Illuminate/Hashing/composer.json b/vendor/laravel/framework/src/Illuminate/Hashing/composer.json
old mode 100644
new mode 100755
index c264eb49..6ad3411c
--- a/vendor/laravel/framework/src/Illuminate/Hashing/composer.json
+++ b/vendor/laravel/framework/src/Illuminate/Hashing/composer.json
@@ -14,9 +14,9 @@
}
],
"require": {
- "php": "^7.2.5|^8.0",
- "illuminate/contracts": "^7.0",
- "illuminate/support": "^7.0"
+ "php": "^7.3|^8.0",
+ "illuminate/contracts": "^8.0",
+ "illuminate/support": "^8.0"
},
"autoload": {
"psr-4": {
@@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "7.x-dev"
+ "dev-master": "8.x-dev"
}
},
"config": {
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php b/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php
index 1749de8a..131e669a 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php
@@ -3,18 +3,67 @@
namespace Illuminate\Http\Client;
use Closure;
-use function GuzzleHttp\Promise\promise_for;
+use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Psr7\Response as Psr7Response;
+use GuzzleHttp\TransferStats;
+use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use PHPUnit\Framework\Assert as PHPUnit;
+/**
+ * @method \Illuminate\Http\Client\PendingRequest accept(string $contentType)
+ * @method \Illuminate\Http\Client\PendingRequest acceptJson()
+ * @method \Illuminate\Http\Client\PendingRequest asForm()
+ * @method \Illuminate\Http\Client\PendingRequest asJson()
+ * @method \Illuminate\Http\Client\PendingRequest asMultipart()
+ * @method \Illuminate\Http\Client\PendingRequest async()
+ * @method \Illuminate\Http\Client\PendingRequest attach(string|array $name, string|resource $contents = '', string|null $filename = null, array $headers = [])
+ * @method \Illuminate\Http\Client\PendingRequest baseUrl(string $url)
+ * @method \Illuminate\Http\Client\PendingRequest beforeSending(callable $callback)
+ * @method \Illuminate\Http\Client\PendingRequest bodyFormat(string $format)
+ * @method \Illuminate\Http\Client\PendingRequest contentType(string $contentType)
+ * @method \Illuminate\Http\Client\PendingRequest dd()
+ * @method \Illuminate\Http\Client\PendingRequest dump()
+ * @method \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0, ?callable $when = null)
+ * @method \Illuminate\Http\Client\PendingRequest sink(string|resource $to)
+ * @method \Illuminate\Http\Client\PendingRequest stub(callable $callback)
+ * @method \Illuminate\Http\Client\PendingRequest timeout(int $seconds)
+ * @method \Illuminate\Http\Client\PendingRequest withBasicAuth(string $username, string $password)
+ * @method \Illuminate\Http\Client\PendingRequest withBody(resource|string $content, string $contentType)
+ * @method \Illuminate\Http\Client\PendingRequest withCookies(array $cookies, string $domain)
+ * @method \Illuminate\Http\Client\PendingRequest withDigestAuth(string $username, string $password)
+ * @method \Illuminate\Http\Client\PendingRequest withHeaders(array $headers)
+ * @method \Illuminate\Http\Client\PendingRequest withMiddleware(callable $middleware)
+ * @method \Illuminate\Http\Client\PendingRequest withOptions(array $options)
+ * @method \Illuminate\Http\Client\PendingRequest withToken(string $token, string $type = 'Bearer')
+ * @method \Illuminate\Http\Client\PendingRequest withUserAgent(string $userAgent)
+ * @method \Illuminate\Http\Client\PendingRequest withoutRedirecting()
+ * @method \Illuminate\Http\Client\PendingRequest withoutVerifying()
+ * @method array pool(callable $callback)
+ * @method \Illuminate\Http\Client\Response delete(string $url, array $data = [])
+ * @method \Illuminate\Http\Client\Response get(string $url, array|string|null $query = null)
+ * @method \Illuminate\Http\Client\Response head(string $url, array|string|null $query = null)
+ * @method \Illuminate\Http\Client\Response patch(string $url, array $data = [])
+ * @method \Illuminate\Http\Client\Response post(string $url, array $data = [])
+ * @method \Illuminate\Http\Client\Response put(string $url, array $data = [])
+ * @method \Illuminate\Http\Client\Response send(string $method, string $url, array $options = [])
+ *
+ * @see \Illuminate\Http\Client\PendingRequest
+ */
class Factory
{
use Macroable {
__call as macroCall;
}
+ /**
+ * The event dispatcher implementation.
+ *
+ * @var \Illuminate\Contracts\Events\Dispatcher|null
+ */
+ protected $dispatcher;
+
/**
* The stub callables that will handle requests.
*
@@ -46,10 +95,13 @@ class Factory
/**
* Create a new factory instance.
*
+ * @param \Illuminate\Contracts\Events\Dispatcher|null $dispatcher
* @return void
*/
- public function __construct()
+ public function __construct(Dispatcher $dispatcher = null)
{
+ $this->dispatcher = $dispatcher;
+
$this->stubCallbacks = collect();
}
@@ -69,7 +121,11 @@ class Factory
$headers['Content-Type'] = 'application/json';
}
- return promise_for(new Psr7Response($status, $headers, $body));
+ $response = new Psr7Response($status, $headers, $body);
+
+ return class_exists(\GuzzleHttp\Promise\Create::class)
+ ? \GuzzleHttp\Promise\Create::promiseFor($response)
+ : \GuzzleHttp\Promise\promise_for($response);
}
/**
@@ -93,6 +149,8 @@ class Factory
{
$this->record();
+ $this->recorded = [];
+
if (is_null($callback)) {
$callback = function () {
return static::response();
@@ -108,11 +166,20 @@ class Factory
}
$this->stubCallbacks = $this->stubCallbacks->merge(collect([
- $callback instanceof Closure
- ? $callback
- : function () use ($callback) {
- return $callback;
- },
+ function ($request, $options) use ($callback) {
+ $response = $callback instanceof Closure
+ ? $callback($request, $options)
+ : $callback;
+
+ if ($response instanceof PromiseInterface) {
+ $options['on_stats'](new TransferStats(
+ $request->toPsrRequest(),
+ $response->wait(),
+ ));
+ }
+
+ return $response;
+ },
]));
return $this;
@@ -191,6 +258,28 @@ class Factory
);
}
+ /**
+ * Assert that the given request was sent in the given order.
+ *
+ * @param array $callbacks
+ * @return void
+ */
+ public function assertSentInOrder($callbacks)
+ {
+ $this->assertSentCount(count($callbacks));
+
+ foreach ($callbacks as $index => $url) {
+ $callback = is_callable($url) ? $url : function ($request) use ($url) {
+ return $request->url() == $url;
+ };
+
+ PHPUnit::assertTrue($callback(
+ $this->recorded[$index][0],
+ $this->recorded[$index][1]
+ ), 'An expected request (#'.($index + 1).') was not recorded.');
+ }
+ }
+
/**
* Assert that a request / response pair was not recorded matching a given truth test.
*
@@ -250,7 +339,7 @@ class Factory
* @param callable $callback
* @return \Illuminate\Support\Collection
*/
- public function recorded($callback)
+ public function recorded($callback = null)
{
if (empty($this->recorded)) {
return collect();
@@ -265,6 +354,26 @@ class Factory
});
}
+ /**
+ * Create a new pending request instance for this factory.
+ *
+ * @return \Illuminate\Http\Client\PendingRequest
+ */
+ protected function newPendingRequest()
+ {
+ return new PendingRequest($this);
+ }
+
+ /**
+ * Get the current event dispatcher implementation.
+ *
+ * @return \Illuminate\Contracts\Events\Dispatcher|null
+ */
+ public function getDispatcher()
+ {
+ return $this->dispatcher;
+ }
+
/**
* Execute a method against a new pending request instance.
*
@@ -278,7 +387,7 @@ class Factory
return $this->macroCall($method, $parameters);
}
- return tap(new PendingRequest($this), function ($request) {
+ return tap($this->newPendingRequest(), function ($request) {
$request->stub($this->stubCallbacks);
})->{$method}(...$parameters);
}
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php b/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php
index 304151ca..fdf5f06d 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php
@@ -5,14 +5,24 @@ namespace Illuminate\Http\Client;
use GuzzleHttp\Client;
use GuzzleHttp\Cookie\CookieJar;
use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Exception\TransferException;
use GuzzleHttp\HandlerStack;
+use Illuminate\Http\Client\Events\ConnectionFailed;
+use Illuminate\Http\Client\Events\RequestSending;
+use Illuminate\Http\Client\Events\ResponseReceived;
+use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
+use Illuminate\Support\Traits\Conditionable;
use Illuminate\Support\Traits\Macroable;
+use Psr\Http\Message\MessageInterface;
+use Psr\Http\Message\RequestInterface;
+use Symfony\Component\VarDumper\VarDumper;
class PendingRequest
{
- use Macroable;
+ use Conditionable, Macroable;
/**
* The factory instance.
@@ -21,6 +31,13 @@ class PendingRequest
*/
protected $factory;
+ /**
+ * The Guzzle client instance.
+ *
+ * @var \GuzzleHttp\Client
+ */
+ protected $client;
+
/**
* The base URL for the request.
*
@@ -84,6 +101,13 @@ class PendingRequest
*/
protected $retryDelay = 100;
+ /**
+ * The callback that will determine if the request should be retried.
+ *
+ * @var callable|null
+ */
+ protected $retryWhenCallback = null;
+
/**
* The callbacks that should execute before the request is sent.
*
@@ -105,6 +129,41 @@ class PendingRequest
*/
protected $middleware;
+ /**
+ * Whether the requests should be asynchronous.
+ *
+ * @var bool
+ */
+ protected $async = false;
+
+ /**
+ * The pending request promise.
+ *
+ * @var \GuzzleHttp\Promise\PromiseInterface
+ */
+ protected $promise;
+
+ /**
+ * The sent request object, if a request has been made.
+ *
+ * @var \Illuminate\Http\Client\Request|null
+ */
+ protected $request;
+
+ /**
+ * The Guzzle request options that are mergable via array_merge_recursive.
+ *
+ * @var array
+ */
+ protected $mergableOptions = [
+ 'cookies',
+ 'form_params',
+ 'headers',
+ 'json',
+ 'multipart',
+ 'query',
+ ];
+
/**
* Create a new HTTP Client instance.
*
@@ -122,8 +181,11 @@ class PendingRequest
'http_errors' => false,
];
- $this->beforeSendingCallbacks = collect([function (Request $request, array $options) {
- $this->cookies = $options['cookies'];
+ $this->beforeSendingCallbacks = collect([function (Request $request, array $options, PendingRequest $pendingRequest) {
+ $pendingRequest->request = $request;
+ $pendingRequest->cookies = $options['cookies'];
+
+ $pendingRequest->dispatchRequestSendingEvent();
}]);
}
@@ -143,7 +205,7 @@ class PendingRequest
/**
* Attach a raw body to the request.
*
- * @param resource|string $content
+ * @param string $content
* @param string $contentType
* @return $this
*/
@@ -181,14 +243,22 @@ class PendingRequest
/**
* Attach a file to the request.
*
- * @param string $name
- * @param string $contents
+ * @param string|array $name
+ * @param string|resource $contents
* @param string|null $filename
* @param array $headers
* @return $this
*/
- public function attach($name, $contents, $filename = null, array $headers = [])
+ public function attach($name, $contents = '', $filename = null, array $headers = [])
{
+ if (is_array($name)) {
+ foreach ($name as $file) {
+ $this->attach(...$file);
+ }
+
+ return $this;
+ }
+
$this->asMultipart();
$this->pendingFiles[] = array_filter([
@@ -313,6 +383,19 @@ class PendingRequest
});
}
+ /**
+ * Specify the user agent for the request.
+ *
+ * @param string $userAgent
+ * @return $this
+ */
+ public function withUserAgent($userAgent)
+ {
+ return tap($this, function ($request) use ($userAgent) {
+ return $this->options['headers']['User-Agent'] = trim($userAgent);
+ });
+ }
+
/**
* Specify the cookies that should be included with the request.
*
@@ -384,18 +467,20 @@ class PendingRequest
*
* @param int $times
* @param int $sleep
+ * @param callable|null $when
* @return $this
*/
- public function retry(int $times, int $sleep = 0)
+ public function retry(int $times, int $sleep = 0, ?callable $when = null)
{
$this->tries = $times;
$this->retryDelay = $sleep;
+ $this->retryWhenCallback = $when;
return $this;
}
/**
- * Merge new options into the client.
+ * Replace the specified options on the request.
*
* @param array $options
* @return $this
@@ -403,7 +488,10 @@ class PendingRequest
public function withOptions(array $options)
{
return tap($this, function ($request) use ($options) {
- return $this->options = array_merge_recursive($this->options, $options);
+ return $this->options = array_replace_recursive(
+ array_merge_recursive($this->options, Arr::only($options, $this->mergableOptions)),
+ $options
+ );
});
}
@@ -433,6 +521,40 @@ class PendingRequest
});
}
+ /**
+ * Dump the request before sending.
+ *
+ * @return $this
+ */
+ public function dump()
+ {
+ $values = func_get_args();
+
+ return $this->beforeSending(function (Request $request, array $options) use ($values) {
+ foreach (array_merge($values, [$request, $options]) as $value) {
+ VarDumper::dump($value);
+ }
+ });
+ }
+
+ /**
+ * Dump the request before sending and end the script.
+ *
+ * @return $this
+ */
+ public function dd()
+ {
+ $values = func_get_args();
+
+ return $this->beforeSending(function (Request $request, array $options) use ($values) {
+ foreach (array_merge($values, [$request, $options]) as $value) {
+ VarDumper::dump($value);
+ }
+
+ exit(1);
+ });
+ }
+
/**
* Issue a GET request to the given URL.
*
@@ -442,7 +564,7 @@ class PendingRequest
*/
public function get(string $url, $query = null)
{
- return $this->send('GET', $url, [
+ return $this->send('GET', $url, func_num_args() === 1 ? [] : [
'query' => $query,
]);
}
@@ -456,7 +578,7 @@ class PendingRequest
*/
public function head(string $url, $query = null)
{
- return $this->send('HEAD', $url, [
+ return $this->send('HEAD', $url, func_num_args() === 1 ? [] : [
'query' => $query,
]);
}
@@ -517,6 +639,25 @@ class PendingRequest
]);
}
+ /**
+ * Send a pool of asynchronous requests concurrently.
+ *
+ * @param callable $callback
+ * @return array
+ */
+ public function pool(callable $callback)
+ {
+ $results = [];
+
+ $requests = tap(new Pool($this->factory), $callback)->getRequests();
+
+ foreach ($requests as $key => $item) {
+ $results[$key] = $item instanceof static ? $item->getPromise()->wait() : $item->wait();
+ }
+
+ return $results;
+ }
+
/**
* Send the request to the given URL.
*
@@ -543,31 +684,33 @@ class PendingRequest
$options[$this->bodyFormat], $this->pendingFiles
);
}
+ } else {
+ $options[$this->bodyFormat] = $this->pendingBody;
}
[$this->pendingBody, $this->pendingFiles] = [null, []];
+ if ($this->async) {
+ return $this->makePromise($method, $url, $options);
+ }
+
return retry($this->tries ?? 1, function () use ($method, $url, $options) {
try {
- $laravelData = $this->parseRequestData($method, $url, $options);
-
- return tap(new Response($this->buildClient()->request($method, $url, $this->mergeOptions([
- 'laravel_data' => $laravelData,
- 'on_stats' => function ($transferStats) {
- $this->transferStats = $transferStats;
- },
- ], $options))), function ($response) {
- $response->cookies = $this->cookies;
- $response->transferStats = $this->transferStats;
+ return tap(new Response($this->sendRequest($method, $url, $options)), function ($response) {
+ $this->populateResponse($response);
if ($this->tries > 1 && ! $response->successful()) {
$response->throw();
}
+
+ $this->dispatchResponseReceivedEvent($response);
});
} catch (ConnectException $e) {
+ $this->dispatchConnectionFailedEvent();
+
throw new ConnectionException($e->getMessage(), 0, $e);
}
- }, $this->retryDelay ?? 100);
+ }, $this->retryDelay ?? 100, $this->retryWhenCallback);
}
/**
@@ -583,6 +726,52 @@ class PendingRequest
})->values()->all();
}
+ /**
+ * Send an asynchronous request to the given URL.
+ *
+ * @param string $method
+ * @param string $url
+ * @param array $options
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ protected function makePromise(string $method, string $url, array $options = [])
+ {
+ return $this->promise = $this->sendRequest($method, $url, $options)
+ ->then(function (MessageInterface $message) {
+ return tap(new Response($message), function ($response) {
+ $this->populateResponse($response);
+ $this->dispatchResponseReceivedEvent($response);
+ });
+ })
+ ->otherwise(function (TransferException $e) {
+ return $e instanceof RequestException ? $this->populateResponse(new Response($e->getResponse())) : $e;
+ });
+ }
+
+ /**
+ * Send a request either synchronously or asynchronously.
+ *
+ * @param string $method
+ * @param string $url
+ * @param array $options
+ * @return \Psr\Http\Message\MessageInterface|\GuzzleHttp\Promise\PromiseInterface
+ *
+ * @throws \Exception
+ */
+ protected function sendRequest(string $method, string $url, array $options = [])
+ {
+ $clientMethod = $this->async ? 'requestAsync' : 'request';
+
+ $laravelData = $this->parseRequestData($method, $url, $options);
+
+ return $this->buildClient()->$clientMethod($method, $url, $this->mergeOptions([
+ 'laravel_data' => $laravelData,
+ 'on_stats' => function ($transferStats) {
+ $this->transferStats = $transferStats;
+ },
+ ], $options));
+ }
+
/**
* Get the request data as an array so that we can attach it to the request for convenient assertions.
*
@@ -610,27 +799,86 @@ class PendingRequest
return $laravelData;
}
+ /**
+ * Populate the given response with additional data.
+ *
+ * @param \Illuminate\Http\Client\Response $response
+ * @return \Illuminate\Http\Client\Response
+ */
+ protected function populateResponse(Response $response)
+ {
+ $response->cookies = $this->cookies;
+
+ $response->transferStats = $this->transferStats;
+
+ return $response;
+ }
+
/**
* Build the Guzzle client.
*
* @return \GuzzleHttp\Client
*/
public function buildClient()
+ {
+ return $this->requestsReusableClient()
+ ? $this->getReusableClient()
+ : $this->createClient($this->buildHandlerStack());
+ }
+
+ /**
+ * Determine if a reusable client is required.
+ *
+ * @return bool
+ */
+ protected function requestsReusableClient()
+ {
+ return ! is_null($this->client) || $this->async;
+ }
+
+ /**
+ * Retrieve a reusable Guzzle client.
+ *
+ * @return \GuzzleHttp\Client
+ */
+ protected function getReusableClient()
+ {
+ return $this->client = $this->client ?: $this->createClient($this->buildHandlerStack());
+ }
+
+ /**
+ * Create new Guzzle client.
+ *
+ * @param \GuzzleHttp\HandlerStack $handlerStack
+ * @return \GuzzleHttp\Client
+ */
+ public function createClient($handlerStack)
{
return new Client([
- 'handler' => $this->buildHandlerStack(),
+ 'handler' => $handlerStack,
'cookies' => true,
]);
}
/**
- * Build the before sending handler stack.
+ * Build the Guzzle client handler stack.
*
* @return \GuzzleHttp\HandlerStack
*/
public function buildHandlerStack()
{
- return tap(HandlerStack::create(), function ($stack) {
+ return $this->pushHandlers(HandlerStack::create());
+ }
+
+ /**
+ * Add the necessary handlers to the given handler stack.
+ *
+ * @param \GuzzleHttp\HandlerStack $handlerStack
+ * @return \GuzzleHttp\HandlerStack
+ */
+ public function pushHandlers($handlerStack)
+ {
+ return tap($handlerStack, function ($stack) {
$stack->push($this->buildBeforeSendingHandler());
$stack->push($this->buildRecorderHandler());
$stack->push($this->buildStubHandler());
@@ -664,7 +912,7 @@ class PendingRequest
{
return function ($handler) {
return function ($request, $options) use ($handler) {
- $promise = $handler($this->runBeforeSendingCallbacks($request, $options), $options);
+ $promise = $handler($request, $options);
return $promise->then(function ($response) use ($request, $options) {
optional($this->factory)->recordRequestResponsePair(
@@ -737,27 +985,37 @@ class PendingRequest
*
* @param \GuzzleHttp\Psr7\RequestInterface $request
* @param array $options
- * @return \Closure
+ * @return \GuzzleHttp\Psr7\RequestInterface
*/
public function runBeforeSendingCallbacks($request, array $options)
{
- return tap($request, function ($request) use ($options) {
- $this->beforeSendingCallbacks->each->__invoke(
- (new Request($request))->withData($options['laravel_data']),
- $options
- );
+ return tap($request, function (&$request) use ($options) {
+ $this->beforeSendingCallbacks->each(function ($callback) use (&$request, $options) {
+ $callbackResult = call_user_func(
+ $callback, (new Request($request))->withData($options['laravel_data']), $options, $this
+ );
+
+ if ($callbackResult instanceof RequestInterface) {
+ $request = $callbackResult;
+ } elseif ($callbackResult instanceof Request) {
+ $request = $callbackResult->toPsrRequest();
+ }
+ });
});
}
/**
- * Merge the given options with the current request options.
+ * Replace the given options with the current request options.
*
* @param array $options
* @return array
*/
public function mergeOptions(...$options)
{
- return array_merge_recursive($this->options, ...$options);
+ return array_replace_recursive(
+ array_merge_recursive($this->options, Arr::only($options, $this->mergableOptions)),
+ ...$options
+ );
}
/**
@@ -772,4 +1030,105 @@ class PendingRequest
return $this;
}
+
+ /**
+ * Toggle asynchronicity in requests.
+ *
+ * @param bool $async
+ * @return $this
+ */
+ public function async(bool $async = true)
+ {
+ $this->async = $async;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve the pending request promise.
+ *
+ * @return \GuzzleHttp\Promise\PromiseInterface|null
+ */
+ public function getPromise()
+ {
+ return $this->promise;
+ }
+
+ /**
+ * Dispatch the RequestSending event if a dispatcher is available.
+ *
+ * @return void
+ */
+ protected function dispatchRequestSendingEvent()
+ {
+ if ($dispatcher = optional($this->factory)->getDispatcher()) {
+ $dispatcher->dispatch(new RequestSending($this->request));
+ }
+ }
+
+ /**
+ * Dispatch the ResponseReceived event if a dispatcher is available.
+ *
+ * @param \Illuminate\Http\Client\Response $response
+ * @return void
+ */
+ protected function dispatchResponseReceivedEvent(Response $response)
+ {
+ if (! ($dispatcher = optional($this->factory)->getDispatcher()) ||
+ ! $this->request) {
+ return;
+ }
+
+ $dispatcher->dispatch(new ResponseReceived($this->request, $response));
+ }
+
+ /**
+ * Dispatch the ConnectionFailed event if a dispatcher is available.
+ *
+ * @return void
+ */
+ protected function dispatchConnectionFailedEvent()
+ {
+ if ($dispatcher = optional($this->factory)->getDispatcher()) {
+ $dispatcher->dispatch(new ConnectionFailed($this->request));
+ }
+ }
+
+ /**
+ * Set the client instance.
+ *
+ * @param \GuzzleHttp\Client $client
+ * @return $this
+ */
+ public function setClient(Client $client)
+ {
+ $this->client = $client;
+
+ return $this;
+ }
+
+ /**
+ * Create a new client instance using the given handler.
+ *
+ * @param callable $handler
+ * @return $this
+ */
+ public function setHandler($handler)
+ {
+ $this->client = $this->createClient(
+ $this->pushHandlers(HandlerStack::create($handler))
+ );
+
+ return $this;
+ }
+
+ /**
+ * Get the pending request options.
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ return $this->options;
+ }
}
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/Request.php b/vendor/laravel/framework/src/Illuminate/Http/Client/Request.php
index 6cea5fb0..0e493f1f 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Client/Request.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Client/Request.php
@@ -5,10 +5,13 @@ namespace Illuminate\Http\Client;
use ArrayAccess;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
+use Illuminate\Support\Traits\Macroable;
use LogicException;
class Request implements ArrayAccess
{
+ use Macroable;
+
/**
* The underlying PSR request.
*
@@ -117,9 +120,7 @@ class Request implements ArrayAccess
*/
public function headers()
{
- return collect($this->request->getHeaders())->mapWithKeys(function ($values, $header) {
- return [$header => $values];
- })->all();
+ return $this->request->getHeaders();
}
/**
@@ -260,6 +261,7 @@ class Request implements ArrayAccess
* @param string $offset
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->data()[$offset]);
@@ -271,6 +273,7 @@ class Request implements ArrayAccess
* @param string $offset
* @return mixed
*/
+ #[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->data()[$offset];
@@ -285,6 +288,7 @@ class Request implements ArrayAccess
*
* @throws \LogicException
*/
+ #[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
throw new LogicException('Request data may not be mutated using array access.');
@@ -298,6 +302,7 @@ class Request implements ArrayAccess
*
* @throws \LogicException
*/
+ #[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
throw new LogicException('Request data may not be mutated using array access.');
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/RequestException.php b/vendor/laravel/framework/src/Illuminate/Http/Client/RequestException.php
index 09909db7..fa4f4183 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Client/RequestException.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Client/RequestException.php
@@ -19,8 +19,25 @@ class RequestException extends HttpClientException
*/
public function __construct(Response $response)
{
- parent::__construct("HTTP request returned status code {$response->status()}.", $response->status());
+ parent::__construct($this->prepareMessage($response), $response->status());
$this->response = $response;
}
+
+ /**
+ * Prepare the exception message.
+ *
+ * @param \Illuminate\Http\Client\Response $response
+ * @return string
+ */
+ protected function prepareMessage(Response $response)
+ {
+ $message = "HTTP request returned status code {$response->status()}";
+
+ $summary = class_exists(\GuzzleHttp\Psr7\Message::class)
+ ? \GuzzleHttp\Psr7\Message::bodySummary($response->toPsrResponse())
+ : \GuzzleHttp\Psr7\get_message_body_summary($response->toPsrResponse());
+
+ return is_null($summary) ? $message : $message .= ":\n{$summary}\n";
+ }
}
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/Response.php b/vendor/laravel/framework/src/Illuminate/Http/Client/Response.php
index 991705d9..703b3570 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Client/Response.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Client/Response.php
@@ -3,6 +3,7 @@
namespace Illuminate\Http\Client;
use ArrayAccess;
+use Illuminate\Support\Collection;
use Illuminate\Support\Traits\Macroable;
use LogicException;
@@ -50,15 +51,21 @@ class Response implements ArrayAccess
/**
* Get the JSON decoded body of the response as an array or scalar value.
*
+ * @param string|null $key
+ * @param mixed $default
* @return mixed
*/
- public function json()
+ public function json($key = null, $default = null)
{
if (! $this->decoded) {
$this->decoded = json_decode($this->body(), true);
}
- return $this->decoded;
+ if (is_null($key)) {
+ return $this->decoded;
+ }
+
+ return data_get($this->decoded, $key, $default);
}
/**
@@ -71,6 +78,17 @@ class Response implements ArrayAccess
return json_decode($this->body(), false);
}
+ /**
+ * Get the JSON decoded body of the response as a collection.
+ *
+ * @param string|null $key
+ * @return \Illuminate\Support\Collection
+ */
+ public function collect($key = null)
+ {
+ return Collection::make($this->json($key));
+ }
+
/**
* Get a header from the response.
*
@@ -89,9 +107,7 @@ class Response implements ArrayAccess
*/
public function headers()
{
- return collect($this->response->getHeaders())->mapWithKeys(function ($v, $k) {
- return [$k => $v];
- })->all();
+ return $this->response->getHeaders();
}
/**
@@ -104,14 +120,24 @@ class Response implements ArrayAccess
return (int) $this->response->getStatusCode();
}
+ /**
+ * Get the reason phrase of the response.
+ *
+ * @return string
+ */
+ public function reason()
+ {
+ return $this->response->getReasonPhrase();
+ }
+
/**
* Get the effective URI of the response.
*
- * @return \Psr\Http\Message\UriInterface
+ * @return \Psr\Http\Message\UriInterface|null
*/
public function effectiveUri()
{
- return $this->transferStats->getEffectiveUri();
+ return optional($this->transferStats)->getEffectiveUri();
}
/**
@@ -144,6 +170,26 @@ class Response implements ArrayAccess
return $this->status() >= 300 && $this->status() < 400;
}
+ /**
+ * Determine if the response was a 401 "Unauthorized" response.
+ *
+ * @return bool
+ */
+ public function unauthorized()
+ {
+ return $this->status() === 401;
+ }
+
+ /**
+ * Determine if the response was a 403 "Forbidden" response.
+ *
+ * @return bool
+ */
+ public function forbidden()
+ {
+ return $this->status() === 403;
+ }
+
/**
* Determine if the response indicates a client or server error occurred.
*
@@ -174,6 +220,21 @@ class Response implements ArrayAccess
return $this->status() >= 500;
}
+ /**
+ * Execute the given callback if there was a server or client error.
+ *
+ * @param callable $callback
+ * @return $this
+ */
+ public function onError(callable $callback)
+ {
+ if ($this->failed()) {
+ $callback($this);
+ }
+
+ return $this;
+ }
+
/**
* Get the response cookies.
*
@@ -184,6 +245,28 @@ class Response implements ArrayAccess
return $this->cookies;
}
+ /**
+ * Get the handler stats of the response.
+ *
+ * @return array
+ */
+ public function handlerStats()
+ {
+ return optional($this->transferStats)->getHandlerStats() ?? [];
+ }
+
+ /**
+ * Close the stream and any underlying resources.
+ *
+ * @return $this
+ */
+ public function close()
+ {
+ $this->response->getBody()->close();
+
+ return $this;
+ }
+
/**
* Get the underlying PSR response for the response.
*
@@ -194,28 +277,61 @@ class Response implements ArrayAccess
return $this->response;
}
+ /**
+ * Create an exception if a server or client error occurred.
+ *
+ * @return \Illuminate\Http\Client\RequestException|null
+ */
+ public function toException()
+ {
+ if ($this->failed()) {
+ return new RequestException($this);
+ }
+ }
+
/**
* Throw an exception if a server or client error occurred.
*
+ * @param \Closure|null $callback
* @return $this
*
* @throws \Illuminate\Http\Client\RequestException
*/
public function throw()
{
- if ($this->serverError() || $this->clientError()) {
- throw new RequestException($this);
+ $callback = func_get_args()[0] ?? null;
+
+ if ($this->failed()) {
+ throw tap($this->toException(), function ($exception) use ($callback) {
+ if ($callback && is_callable($callback)) {
+ $callback($this, $exception);
+ }
+ });
}
return $this;
}
+ /**
+ * Throw an exception if a server or client error occurred and the given condition evaluates to true.
+ *
+ * @param bool $condition
+ * @return $this
+ *
+ * @throws \Illuminate\Http\Client\RequestException
+ */
+ public function throwIf($condition)
+ {
+ return $condition ? $this->throw() : $this;
+ }
+
/**
* Determine if the given offset exists.
*
* @param string $offset
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->json()[$offset]);
@@ -227,6 +343,7 @@ class Response implements ArrayAccess
* @param string $offset
* @return mixed
*/
+ #[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->json()[$offset];
@@ -241,6 +358,7 @@ class Response implements ArrayAccess
*
* @throws \LogicException
*/
+ #[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
throw new LogicException('Response data may not be mutated using array access.');
@@ -254,6 +372,7 @@ class Response implements ArrayAccess
*
* @throws \LogicException
*/
+ #[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
throw new LogicException('Response data may not be mutated using array access.');
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Client/ResponseSequence.php b/vendor/laravel/framework/src/Illuminate/Http/Client/ResponseSequence.php
index 66d0ec6b..dcf8633a 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Client/ResponseSequence.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Client/ResponseSequence.php
@@ -2,10 +2,13 @@
namespace Illuminate\Http\Client;
+use Illuminate\Support\Traits\Macroable;
use OutOfBoundsException;
class ResponseSequence
{
+ use Macroable;
+
/**
* The responses in the sequence.
*
@@ -137,6 +140,8 @@ class ResponseSequence
* Get the next response in the sequence.
*
* @return mixed
+ *
+ * @throws \OutOfBoundsException
*/
public function __invoke()
{
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php b/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php
index 25d6ec1e..0d5f62fc 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php
@@ -6,24 +6,6 @@ use Illuminate\Support\Str;
trait InteractsWithContentTypes
{
- /**
- * Determine if the given content types match.
- *
- * @param string $actual
- * @param string $type
- * @return bool
- */
- public static function matchesType($actual, $type)
- {
- if ($actual === $type) {
- return true;
- }
-
- $split = explode('/', $actual);
-
- return isset($split[1]) && preg_match('#'.preg_quote($split[0], '#').'/.+\+'.preg_quote($split[1], '#').'#', $type);
- }
-
/**
* Determine if the request is sending JSON.
*
@@ -53,7 +35,7 @@ trait InteractsWithContentTypes
{
$acceptable = $this->getAcceptableContentTypes();
- return isset($acceptable[0]) && Str::contains($acceptable[0], ['/json', '+json']);
+ return isset($acceptable[0]) && Str::contains(strtolower($acceptable[0]), ['/json', '+json']);
}
/**
@@ -78,6 +60,10 @@ trait InteractsWithContentTypes
}
foreach ($types as $type) {
+ $accept = strtolower($accept);
+
+ $type = strtolower($type);
+
if ($this->matchesType($accept, $type) || $accept === strtok($type, '/').'/*') {
return true;
}
@@ -111,6 +97,10 @@ trait InteractsWithContentTypes
$type = $mimeType;
}
+ $accept = strtolower($accept);
+
+ $type = strtolower($type);
+
if ($this->matchesType($type, $accept) || $accept === strtok($type, '/').'/*') {
return $contentType;
}
@@ -152,6 +142,24 @@ trait InteractsWithContentTypes
return $this->accepts('text/html');
}
+ /**
+ * Determine if the given content types match.
+ *
+ * @param string $actual
+ * @param string $type
+ * @return bool
+ */
+ public static function matchesType($actual, $type)
+ {
+ if ($actual === $type) {
+ return true;
+ }
+
+ $split = explode('/', $actual);
+
+ return isset($split[1]) && preg_match('#'.preg_quote($split[0], '#').'/.+\+'.preg_quote($split[1], '#').'#', $type);
+ }
+
/**
* Get the data format expected in the response.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlashData.php b/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlashData.php
index 25e11a95..6682e542 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlashData.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlashData.php
@@ -9,7 +9,7 @@ trait InteractsWithFlashData
*
* @param string|null $key
* @param string|array|null $default
- * @return string|array
+ * @return string|array|null
*/
public function old($key = null, $default = null)
{
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php b/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php
index 4550271b..ae8b6fe7 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php
@@ -4,9 +4,10 @@ namespace Illuminate\Http\Concerns;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
+use Illuminate\Support\Facades\Date;
use SplFileInfo;
use stdClass;
+use Symfony\Component\VarDumper\VarDumper;
trait InteractsWithInput
{
@@ -54,8 +55,12 @@ trait InteractsWithInput
{
$header = $this->header('Authorization', '');
- if (Str::startsWith($header, 'Bearer ')) {
- return Str::substr($header, 7);
+ $position = strrpos($header, 'Bearer ');
+
+ if ($position !== false) {
+ $header = substr($header, $position + 7);
+
+ return strpos($header, ',') !== false ? strstr($header, ',', true) : $header;
}
}
@@ -111,14 +116,19 @@ trait InteractsWithInput
*
* @param string $key
* @param callable $callback
+ * @param callable|null $default
* @return $this|mixed
*/
- public function whenHas($key, callable $callback)
+ public function whenHas($key, callable $callback, callable $default = null)
{
if ($this->has($key)) {
return $callback(data_get($this->all(), $key)) ?: $this;
}
+ if ($default) {
+ return $default();
+ }
+
return $this;
}
@@ -184,14 +194,19 @@ trait InteractsWithInput
*
* @param string $key
* @param callable $callback
+ * @param callable|null $default
* @return $this|mixed
*/
- public function whenFilled($key, callable $callback)
+ public function whenFilled($key, callable $callback, callable $default = null)
{
if ($this->filled($key)) {
return $callback(data_get($this->all(), $key)) ?: $this;
}
+ if ($default) {
+ return $default();
+ }
+
return $this;
}
@@ -282,6 +297,38 @@ trait InteractsWithInput
return filter_var($this->input($key, $default), FILTER_VALIDATE_BOOLEAN);
}
+ /**
+ * Retrieve input from the request as a Carbon instance.
+ *
+ * @param string $key
+ * @param string|null $format
+ * @param string|null $tz
+ * @return \Illuminate\Support\Carbon|null
+ */
+ public function date($key, $format = null, $tz = null)
+ {
+ if ($this->isNotFilled($key)) {
+ return null;
+ }
+
+ if (is_null($format)) {
+ return Date::parse($this->input($key), $tz);
+ }
+
+ return Date::createFromFormat($format, $this->input($key), $tz);
+ }
+
+ /**
+ * Retrieve input from the request as a collection.
+ *
+ * @param array|string|null $key
+ * @return \Illuminate\Support\Collection
+ */
+ public function collect($key = null)
+ {
+ return collect(is_array($key) ? $this->only($key) : $this->input($key));
+ }
+
/**
* Get a subset containing the provided keys with values from the input data.
*
@@ -462,4 +509,32 @@ trait InteractsWithInput
return $this->$source->get($key, $default);
}
+
+ /**
+ * Dump the request items and end the script.
+ *
+ * @param mixed $keys
+ * @return void
+ */
+ public function dd(...$keys)
+ {
+ $this->dump(...$keys);
+
+ exit(1);
+ }
+
+ /**
+ * Dump the items.
+ *
+ * @param mixed $keys
+ * @return $this
+ */
+ public function dump($keys = [])
+ {
+ $keys = is_array($keys) ? $keys : func_get_args();
+
+ VarDumper::dump(count($keys) > 0 ? $this->only($keys) : $this->all());
+
+ return $this;
+ }
}
diff --git a/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php b/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php
old mode 100644
new mode 100755
index 9f87e6c3..84a68f97
--- a/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php
@@ -22,13 +22,24 @@ class JsonResponse extends BaseJsonResponse
* @param int $status
* @param array $headers
* @param int $options
+ * @param bool $json
* @return void
*/
- public function __construct($data = null, $status = 200, $headers = [], $options = 0)
+ public function __construct($data = null, $status = 200, $headers = [], $options = 0, $json = false)
{
$this->encodingOptions = $options;
- parent::__construct($data, $status, $headers);
+ parent::__construct($data, $status, $headers, $json);
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @return static
+ */
+ public static function fromJsonString(?string $data = null, int $status = 200, array $headers = [])
+ {
+ return new static($data, $status, $headers, 0, true);
}
/**
@@ -56,11 +67,16 @@ class JsonResponse extends BaseJsonResponse
/**
* {@inheritdoc}
+ *
+ * @return static
*/
public function setData($data = [])
{
$this->original = $data;
+ // Ensure json_last_error() is cleared...
+ json_decode('[]');
+
if ($data instanceof Jsonable) {
$this->data = $data->toJson($this->encodingOptions);
} elseif ($data instanceof JsonSerializable) {
@@ -100,6 +116,8 @@ class JsonResponse extends BaseJsonResponse
/**
* {@inheritdoc}
+ *
+ * @return static
*/
public function setEncodingOptions($options)
{
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Middleware/SetCacheHeaders.php b/vendor/laravel/framework/src/Illuminate/Http/Middleware/SetCacheHeaders.php
index b6d964bc..b42dc2f2 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Middleware/SetCacheHeaders.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Middleware/SetCacheHeaders.php
@@ -55,7 +55,7 @@ class SetCacheHeaders
*/
protected function parseOptions($options)
{
- return collect(explode(';', $options))->mapWithKeys(function ($option) {
+ return collect(explode(';', rtrim($options, ';')))->mapWithKeys(function ($option) {
$data = explode('=', $option, 2);
return [$data[0] => $data[1] ?? true];
diff --git a/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php b/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php
old mode 100644
new mode 100755
index 7f256a39..32bb5fcf
--- a/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php
@@ -145,6 +145,21 @@ class RedirectResponse extends BaseRedirectResponse
return $this;
}
+ /**
+ * Parse the given errors into an appropriate value.
+ *
+ * @param \Illuminate\Contracts\Support\MessageProvider|array|string $provider
+ * @return \Illuminate\Support\MessageBag
+ */
+ protected function parseErrors($provider)
+ {
+ if ($provider instanceof MessageProvider) {
+ return $provider->getMessageBag();
+ }
+
+ return new MessageBag((array) $provider);
+ }
+
/**
* Add a fragment identifier to the URL.
*
@@ -167,21 +182,6 @@ class RedirectResponse extends BaseRedirectResponse
return $this->setTargetUrl(Str::before($this->getTargetUrl(), '#'));
}
- /**
- * Parse the given errors into an appropriate value.
- *
- * @param \Illuminate\Contracts\Support\MessageProvider|array|string $provider
- * @return \Illuminate\Support\MessageBag
- */
- protected function parseErrors($provider)
- {
- if ($provider instanceof MessageProvider) {
- return $provider->getMessageBag();
- }
-
- return new MessageBag((array) $provider);
- }
-
/**
* Get the original response content.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Request.php b/vendor/laravel/framework/src/Illuminate/Http/Request.php
index cf6b90cb..79175ac4 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Request.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Request.php
@@ -133,6 +133,23 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
: $this->fullUrl().$question.Arr::query($query);
}
+ /**
+ * Get the full URL for the request without the given query string parameters.
+ *
+ * @param array|string $query
+ * @return string
+ */
+ public function fullUrlWithoutQuery($keys)
+ {
+ $query = Arr::except($this->query(), $keys);
+
+ $question = $this->getBaseUrl().$this->getPathInfo() === '/' ? '/?' : '?';
+
+ return count($query) > 0
+ ? $this->url().$question.Arr::query($query)
+ : $this->url();
+ }
+
/**
* Get the current path info for the request.
*
@@ -142,7 +159,7 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
{
$pattern = trim($this->getPathInfo(), '/');
- return $pattern == '' ? '/' : $pattern;
+ return $pattern === '' ? '/' : $pattern;
}
/**
@@ -212,7 +229,7 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
}
/**
- * Determine if the current request URL and query string matches a pattern.
+ * Determine if the current request URL and query string match a pattern.
*
* @param mixed ...$patterns
* @return bool
@@ -241,7 +258,7 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
}
/**
- * Determine if the request is the result of an PJAX call.
+ * Determine if the request is the result of a PJAX call.
*
* @return bool
*/
@@ -251,14 +268,14 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
}
/**
- * Determine if the request is the result of an prefetch call.
+ * Determine if the request is the result of a prefetch call.
*
* @return bool
*/
public function prefetch()
{
- return strcasecmp($this->server->get('HTTP_X_MOZ'), 'prefetch') === 0 ||
- strcasecmp($this->headers->get('Purpose'), 'prefetch') === 0;
+ return strcasecmp($this->server->get('HTTP_X_MOZ') ?? '', 'prefetch') === 0 ||
+ strcasecmp($this->headers->get('Purpose') ?? '', 'prefetch') === 0;
}
/**
@@ -314,6 +331,19 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
return $this;
}
+ /**
+ * Merge new input into the request's input, but only when that key is missing from the request.
+ *
+ * @param array $input
+ * @return $this
+ */
+ public function mergeIfMissing(array $input)
+ {
+ return $this->merge(collect($input)->filter(function ($value, $key) {
+ return $this->missing($key);
+ })->toArray());
+ }
+
/**
* Replace the input for the current request.
*
@@ -439,6 +469,8 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
/**
* {@inheritdoc}
+ *
+ * @return static
*/
public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null)
{
@@ -634,10 +666,13 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
* @param string $offset
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function offsetExists($offset)
{
+ $route = $this->route();
+
return Arr::has(
- $this->all() + $this->route()->parameters(),
+ $this->all() + ($route ? $route->parameters() : []),
$offset
);
}
@@ -648,6 +683,7 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
* @param string $offset
* @return mixed
*/
+ #[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->__get($offset);
@@ -660,6 +696,7 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
* @param mixed $value
* @return void
*/
+ #[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->getInputSource()->set($offset, $value);
@@ -671,6 +708,7 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
* @param string $offset
* @return void
*/
+ #[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
$this->getInputSource()->remove($offset);
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/CollectsResources.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/CollectsResources.php
index a5531f7a..a4d4faba 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Resources/CollectsResources.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Resources/CollectsResources.php
@@ -2,9 +2,11 @@
namespace Illuminate\Http\Resources;
+use Illuminate\Pagination\AbstractCursorPaginator;
use Illuminate\Pagination\AbstractPaginator;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
+use ReflectionClass;
trait CollectsResources
{
@@ -30,7 +32,7 @@ trait CollectsResources
? $resource->mapInto($collects)
: $resource->toBase();
- return $resource instanceof AbstractPaginator
+ return ($resource instanceof AbstractPaginator || $resource instanceof AbstractCursorPaginator)
? $resource->setCollection($this->collection)
: $this->collection;
}
@@ -47,16 +49,36 @@ trait CollectsResources
}
if (Str::endsWith(class_basename($this), 'Collection') &&
- class_exists($class = Str::replaceLast('Collection', '', get_class($this)))) {
+ (class_exists($class = Str::replaceLast('Collection', '', get_class($this))) ||
+ class_exists($class = Str::replaceLast('Collection', 'Resource', get_class($this))))) {
return $class;
}
}
+ /**
+ * Get the JSON serialization options that should be applied to the resource response.
+ *
+ * @return int
+ */
+ public function jsonOptions()
+ {
+ $collects = $this->collects();
+
+ if (! $collects) {
+ return 0;
+ }
+
+ return (new ReflectionClass($collects))
+ ->newInstanceWithoutConstructor()
+ ->jsonOptions();
+ }
+
/**
* Get an iterator for the resource collection.
*
* @return \ArrayIterator
*/
+ #[\ReturnTypeWillChange]
public function getIterator()
{
return $this->collection->getIterator();
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php
index 495b7e3b..48f455f9 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php
@@ -64,6 +64,7 @@ trait DelegatesToResource
* @param mixed $offset
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->resource[$offset]);
@@ -75,6 +76,7 @@ trait DelegatesToResource
* @param mixed $offset
* @return mixed
*/
+ #[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->resource[$offset];
@@ -87,6 +89,7 @@ trait DelegatesToResource
* @param mixed $value
* @return void
*/
+ #[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->resource[$offset] = $value;
@@ -98,6 +101,7 @@ trait DelegatesToResource
* @param mixed $offset
* @return void
*/
+ #[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->resource[$offset]);
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php
index 808aa234..8c8bf000 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php
@@ -42,7 +42,7 @@ class JsonResource implements ArrayAccess, JsonSerializable, Responsable, UrlRou
/**
* The "data" wrapper that should be applied.
*
- * @var string
+ * @var string|null
*/
public static $wrap = 'data';
@@ -69,7 +69,7 @@ class JsonResource implements ArrayAccess, JsonSerializable, Responsable, UrlRou
}
/**
- * Create new anonymous resource collection.
+ * Create a new anonymous resource collection.
*
* @param mixed $resource
* @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
@@ -108,7 +108,7 @@ class JsonResource implements ArrayAccess, JsonSerializable, Responsable, UrlRou
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
- * @return array
+ * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
@@ -164,6 +164,16 @@ class JsonResource implements ArrayAccess, JsonSerializable, Responsable, UrlRou
return $this;
}
+ /**
+ * Get the JSON serialization options that should be applied to the resource response.
+ *
+ * @return int
+ */
+ public function jsonOptions()
+ {
+ return 0;
+ }
+
/**
* Customize the response for a request.
*
@@ -226,6 +236,7 @@ class JsonResource implements ArrayAccess, JsonSerializable, Responsable, UrlRou
*
* @return array
*/
+ #[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->resolve(Container::getInstance()->make('request'));
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php
index 5fb35ea0..bd3e8f9a 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php
@@ -23,7 +23,9 @@ class PaginatedResourceResponse extends ResourceResponse
$this->resource->additional
)
),
- $this->calculateStatus()
+ $this->calculateStatus(),
+ [],
+ $this->resource->jsonOptions()
), function ($response) use ($request) {
$response->original = $this->resource->resource->map(function ($item) {
return is_array($item) ? Arr::get($item, 'resource') : $item->resource;
@@ -43,10 +45,16 @@ class PaginatedResourceResponse extends ResourceResponse
{
$paginated = $this->resource->resource->toArray();
- return [
+ $default = [
'links' => $this->paginationLinks($paginated),
'meta' => $this->meta($paginated),
];
+
+ if (method_exists($this->resource, 'paginationInformation')) {
+ return $this->resource->paginationInformation($request, $paginated, $default);
+ }
+
+ return $default;
}
/**
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceCollection.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceCollection.php
index 2931fd64..65710aa3 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceCollection.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceCollection.php
@@ -4,6 +4,7 @@ namespace Illuminate\Http\Resources\Json;
use Countable;
use Illuminate\Http\Resources\CollectsResources;
+use Illuminate\Pagination\AbstractCursorPaginator;
use Illuminate\Pagination\AbstractPaginator;
use IteratorAggregate;
@@ -84,6 +85,7 @@ class ResourceCollection extends JsonResource implements Countable, IteratorAggr
*
* @return int
*/
+ #[\ReturnTypeWillChange]
public function count()
{
return $this->collection->count();
@@ -93,7 +95,7 @@ class ResourceCollection extends JsonResource implements Countable, IteratorAggr
* Transform the resource into a JSON array.
*
* @param \Illuminate\Http\Request $request
- * @return array
+ * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
@@ -108,7 +110,7 @@ class ResourceCollection extends JsonResource implements Countable, IteratorAggr
*/
public function toResponse($request)
{
- if ($this->resource instanceof AbstractPaginator) {
+ if ($this->resource instanceof AbstractPaginator || $this->resource instanceof AbstractCursorPaginator) {
return $this->preparePaginatedResponse($request);
}
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceResponse.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceResponse.php
index 2e9d326d..51f36576 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceResponse.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceResponse.php
@@ -40,7 +40,9 @@ class ResourceResponse implements Responsable
$this->resource->with($request),
$this->resource->additional
),
- $this->calculateStatus()
+ $this->calculateStatus(),
+ [],
+ $this->resource->jsonOptions()
), function ($response) use ($request) {
$response->original = $this->resource->resource;
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Resources/MergeValue.php b/vendor/laravel/framework/src/Illuminate/Http/Resources/MergeValue.php
index ee557e8f..fb6880fb 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Resources/MergeValue.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Resources/MergeValue.php
@@ -15,7 +15,7 @@ class MergeValue
public $data;
/**
- * Create new merge value instance.
+ * Create a new merge value instance.
*
* @param \Illuminate\Support\Collection|\JsonSerializable|array $data
* @return void
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Response.php b/vendor/laravel/framework/src/Illuminate/Http/Response.php
old mode 100644
new mode 100755
index f8bc3789..8599a8e5
--- a/vendor/laravel/framework/src/Illuminate/Http/Response.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Response.php
@@ -7,6 +7,7 @@ use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Support\Traits\Macroable;
+use InvalidArgumentException;
use JsonSerializable;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
@@ -41,6 +42,8 @@ class Response extends SymfonyResponse
*
* @param mixed $content
* @return $this
+ *
+ * @throws \InvalidArgumentException
*/
public function setContent($content)
{
@@ -53,6 +56,10 @@ class Response extends SymfonyResponse
$this->header('Content-Type', 'application/json');
$content = $this->morphToJson($content);
+
+ if ($content === false) {
+ throw new InvalidArgumentException(json_last_error_msg());
+ }
}
// If this content implements the "Renderable" interface then we will call the
diff --git a/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php b/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php
index 46936fb6..cbe29dcc 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php
@@ -32,6 +32,16 @@ trait ResponseTrait
return $this->getStatusCode();
}
+ /**
+ * Get the status text for the response.
+ *
+ * @return string
+ */
+ public function statusText()
+ {
+ return $this->statusText;
+ }
+
/**
* Get the content of the response.
*
@@ -116,6 +126,25 @@ trait ResponseTrait
return $this;
}
+ /**
+ * Expire a cookie when sending the response.
+ *
+ * @param \Symfony\Component\HttpFoundation\Cookie|mixed $cookie
+ * @param string|null $path
+ * @param string|null $domain
+ * @return $this
+ */
+ public function withoutCookie($cookie, $path = null, $domain = null)
+ {
+ if (is_string($cookie) && function_exists('cookie')) {
+ $cookie = cookie($cookie, null, -2628000, $path, $domain);
+ }
+
+ $this->headers->setCookie($cookie);
+
+ return $this;
+ }
+
/**
* Get the callback of the response.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Testing/File.php b/vendor/laravel/framework/src/Illuminate/Http/Testing/File.php
index c1528268..c714529f 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Testing/File.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Testing/File.php
@@ -107,6 +107,7 @@ class File extends UploadedFile
*
* @return int
*/
+ #[\ReturnTypeWillChange]
public function getSize()
{
return $this->sizeToReport ?: parent::getSize();
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Testing/FileFactory.php b/vendor/laravel/framework/src/Illuminate/Http/Testing/FileFactory.php
index 5b729ee1..9e25d72d 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Testing/FileFactory.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Testing/FileFactory.php
@@ -2,8 +2,6 @@
namespace Illuminate\Http\Testing;
-use Illuminate\Support\Str;
-
class FileFactory
{
/**
@@ -55,7 +53,7 @@ class FileFactory
public function image($name, $width = 10, $height = 10)
{
return new File($name, $this->generateImage(
- $width, $height, Str::endsWith(Str::lower($name), ['.jpg', '.jpeg']) ? 'jpeg' : 'png'
+ $width, $height, pathinfo($name, PATHINFO_EXTENSION)
));
}
@@ -64,24 +62,21 @@ class FileFactory
*
* @param int $width
* @param int $height
- * @param string $type
+ * @param string $extension
* @return resource
*/
- protected function generateImage($width, $height, $type)
+ protected function generateImage($width, $height, $extension)
{
- return tap(tmpfile(), function ($temp) use ($width, $height, $type) {
+ return tap(tmpfile(), function ($temp) use ($width, $height, $extension) {
ob_start();
+ $extension = in_array($extension, ['jpeg', 'png', 'gif', 'webp', 'wbmp', 'bmp'])
+ ? strtolower($extension)
+ : 'jpeg';
+
$image = imagecreatetruecolor($width, $height);
- switch ($type) {
- case 'jpeg':
- imagejpeg($image);
- break;
- case 'png':
- imagepng($image);
- break;
- }
+ call_user_func("image{$extension}", $image);
fwrite($temp, ob_get_clean());
});
diff --git a/vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php b/vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php
index aff03d4b..d188a4be 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php
@@ -22,7 +22,7 @@ class MimeType
public static function getMimeTypes()
{
if (self::$mime === null) {
- self::$mime = new MimeTypes();
+ self::$mime = new MimeTypes;
}
return self::$mime;
diff --git a/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php b/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php
index 4e9f6f65..7779683e 100644
--- a/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php
+++ b/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php
@@ -91,7 +91,7 @@ class UploadedFile extends SymfonyUploadedFile
/**
* Get the contents of the uploaded file.
*
- * @return bool|string
+ * @return false|string
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
diff --git a/vendor/laravel/framework/src/Illuminate/Http/composer.json b/vendor/laravel/framework/src/Illuminate/Http/composer.json
old mode 100644
new mode 100755
index c85bcc73..564c398d
--- a/vendor/laravel/framework/src/Illuminate/Http/composer.json
+++ b/vendor/laravel/framework/src/Illuminate/Http/composer.json
@@ -14,13 +14,15 @@
}
],
"require": {
- "php": "^7.2.5|^8.0",
+ "php": "^7.3|^8.0",
"ext-json": "*",
- "illuminate/session": "^7.0",
- "illuminate/support": "^7.0",
- "symfony/http-foundation": "^5.0",
- "symfony/http-kernel": "^5.0",
- "symfony/mime": "^5.0"
+ "illuminate/collections": "^8.0",
+ "illuminate/macroable": "^8.0",
+ "illuminate/session": "^8.0",
+ "illuminate/support": "^8.0",
+ "symfony/http-foundation": "^5.4",
+ "symfony/http-kernel": "^5.4",
+ "symfony/mime": "^5.4"
},
"autoload": {
"psr-4": {
@@ -29,11 +31,11 @@
},
"suggest": {
"ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().",
- "guzzlehttp/guzzle": "Required to use the HTTP Client (^6.3.1|^7.0.1)."
+ "guzzlehttp/guzzle": "Required to use the HTTP Client (^6.5.5|^7.0.1)."
},
"extra": {
"branch-alias": {
- "dev-master": "7.x-dev"
+ "dev-master": "8.x-dev"
}
},
"config": {
diff --git a/vendor/laravel/framework/src/Illuminate/Log/LogManager.php b/vendor/laravel/framework/src/Illuminate/Log/LogManager.php
index 53bc54ee..44601a7e 100644
--- a/vendor/laravel/framework/src/Illuminate/Log/LogManager.php
+++ b/vendor/laravel/framework/src/Illuminate/Log/LogManager.php
@@ -7,6 +7,7 @@ use Illuminate\Support\Str;
use InvalidArgumentException;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\ErrorLogHandler;
+use Monolog\Handler\FingersCrossedHandler;
use Monolog\Handler\FormattableHandlerInterface;
use Monolog\Handler\HandlerInterface;
use Monolog\Handler\RotatingFileHandler;
@@ -61,6 +62,19 @@ class LogManager implements LoggerInterface
$this->app = $app;
}
+ /**
+ * Build an on-demand log channel.
+ *
+ * @param array $config
+ * @return \Psr\Log\LoggerInterface
+ */
+ public function build(array $config)
+ {
+ unset($this->channels['ondemand']);
+
+ return $this->get('ondemand', $config);
+ }
+
/**
* Create a new, on-demand aggregate logger instance.
*
@@ -95,27 +109,20 @@ class LogManager implements LoggerInterface
*/
public function driver($driver = null)
{
- return $this->get($driver ?? $this->getDefaultDriver());
- }
-
- /**
- * @return array
- */
- public function getChannels()
- {
- return $this->channels;
+ return $this->get($this->parseDriver($driver));
}
/**
* Attempt to get the log from the local cache.
*
* @param string $name
+ * @param array|null $config
* @return \Psr\Log\LoggerInterface
*/
- protected function get($name)
+ protected function get($name, ?array $config = null)
{
try {
- return $this->channels[$name] ?? with($this->resolve($name), function ($logger) use ($name) {
+ return $this->channels[$name] ?? with($this->resolve($name, $config), function ($logger) use ($name) {
return $this->channels[$name] = $this->tap($name, new Logger($logger, $this->app['events']));
});
} catch (Throwable $e) {
@@ -180,13 +187,14 @@ class LogManager implements LoggerInterface
* Resolve the given log instance by name.
*
* @param string $name
+ * @param array|null $config
* @return \Psr\Log\LoggerInterface
*
* @throws \InvalidArgumentException
*/
- protected function resolve($name)
+ protected function resolve($name, ?array $config = null)
{
- $config = $this->configurationFor($name);
+ $config = $config ?? $this->configurationFor($name);
if (is_null($config)) {
throw new InvalidArgumentException("Log [{$name}] is not defined.");
@@ -237,15 +245,27 @@ class LogManager implements LoggerInterface
*/
protected function createStackDriver(array $config)
{
+ if (is_string($config['channels'])) {
+ $config['channels'] = explode(',', $config['channels']);
+ }
+
$handlers = collect($config['channels'])->flatMap(function ($channel) {
- return $this->channel($channel)->getHandlers();
+ return $channel instanceof LoggerInterface
+ ? $channel->getHandlers()
+ : $this->channel($channel)->getHandlers();
+ })->all();
+
+ $processors = collect($config['channels'])->flatMap(function ($channel) {
+ return $channel instanceof LoggerInterface
+ ? $channel->getProcessors()
+ : $this->channel($channel)->getProcessors();
})->all();
if ($config['ignore_exceptions'] ?? false) {
$handlers = [new WhatFailureGroupHandler($handlers)];
}
- return new Monolog($this->parseChannel($config), $handlers);
+ return new Monolog($this->parseChannel($config), $handlers, $processors);
}
/**
@@ -389,17 +409,17 @@ class LogManager implements LoggerInterface
*/
protected function prepareHandler(HandlerInterface $handler, array $config = [])
{
- $isHandlerFormattable = false;
-
- if (Monolog::API === 1) {
- $isHandlerFormattable = true;
- } elseif (Monolog::API === 2 && $handler instanceof FormattableHandlerInterface) {
- $isHandlerFormattable = true;
+ if (isset($config['action_level'])) {
+ $handler = new FingersCrossedHandler($handler, $this->actionLevel($config));
}
- if ($isHandlerFormattable && ! isset($config['formatter'])) {
+ if (Monolog::API !== 1 && (Monolog::API !== 2 || ! $handler instanceof FormattableHandlerInterface)) {
+ return $handler;
+ }
+
+ if (! isset($config['formatter'])) {
$handler->setFormatter($this->formatter());
- } elseif ($isHandlerFormattable && $config['formatter'] !== 'default') {
+ } elseif ($config['formatter'] !== 'default') {
$handler->setFormatter($this->app->make($config['formatter'], $config['formatter_with'] ?? []));
}
@@ -442,7 +462,7 @@ class LogManager implements LoggerInterface
/**
* Get the default log driver name.
*
- * @return string
+ * @return string|null
*/
public function getDefaultDriver()
{
@@ -482,13 +502,40 @@ class LogManager implements LoggerInterface
*/
public function forgetChannel($driver = null)
{
- $driver = $driver ?? $this->getDefaultDriver();
+ $driver = $this->parseDriver($driver);
if (isset($this->channels[$driver])) {
unset($this->channels[$driver]);
}
}
+ /**
+ * Parse the driver name.
+ *
+ * @param string|null $driver
+ * @return string|null
+ */
+ protected function parseDriver($driver)
+ {
+ $driver = $driver ?? $this->getDefaultDriver();
+
+ if ($this->app->runningUnitTests()) {
+ $driver = $driver ?? 'null';
+ }
+
+ return $driver;
+ }
+
+ /**
+ * Get all of the resolved log channels.
+ *
+ * @return array
+ */
+ public function getChannels()
+ {
+ return $this->channels;
+ }
+
/**
* System is unusable.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Log/Logger.php b/vendor/laravel/framework/src/Illuminate/Log/Logger.php
old mode 100644
new mode 100755
index e5a8de62..382b77c6
--- a/vendor/laravel/framework/src/Illuminate/Log/Logger.php
+++ b/vendor/laravel/framework/src/Illuminate/Log/Logger.php
@@ -26,6 +26,13 @@ class Logger implements LoggerInterface
*/
protected $dispatcher;
+ /**
+ * Any context to be added to logs.
+ *
+ * @var array
+ */
+ protected $context = [];
+
/**
* Create a new log writer instance.
*
@@ -171,11 +178,39 @@ class Logger implements LoggerInterface
*/
protected function writeLog($level, $message, $context)
{
- $this->logger->{$level}($message = $this->formatMessage($message), $context);
+ $this->logger->{$level}(
+ $message = $this->formatMessage($message),
+ $context = array_merge($this->context, $context)
+ );
$this->fireLogEvent($level, $message, $context);
}
+ /**
+ * Add context to all future logs.
+ *
+ * @param array $context
+ * @return $this
+ */
+ public function withContext(array $context = [])
+ {
+ $this->context = array_merge($this->context, $context);
+
+ return $this;
+ }
+
+ /**
+ * Flush the existing context array.
+ *
+ * @return $this
+ */
+ public function withoutContext()
+ {
+ $this->context = [];
+
+ return $this;
+ }
+
/**
* Register a new callback handler for when a log event is triggered.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Log/ParsesLogConfiguration.php b/vendor/laravel/framework/src/Illuminate/Log/ParsesLogConfiguration.php
index f40cf6b5..fd0d5ed5 100644
--- a/vendor/laravel/framework/src/Illuminate/Log/ParsesLogConfiguration.php
+++ b/vendor/laravel/framework/src/Illuminate/Log/ParsesLogConfiguration.php
@@ -49,6 +49,23 @@ trait ParsesLogConfiguration
throw new InvalidArgumentException('Invalid log level.');
}
+ /**
+ * Parse the action level from the given configuration.
+ *
+ * @param array $config
+ * @return int
+ */
+ protected function actionLevel(array $config)
+ {
+ $level = $config['action_level'] ?? 'debug';
+
+ if (isset($this->levels[$level])) {
+ return $this->levels[$level];
+ }
+
+ throw new InvalidArgumentException('Invalid log action level.');
+ }
+
/**
* Extract the log channel from the given configuration.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Log/composer.json b/vendor/laravel/framework/src/Illuminate/Log/composer.json
old mode 100644
new mode 100755
index 53ebba89..1fd148d9
--- a/vendor/laravel/framework/src/Illuminate/Log/composer.json
+++ b/vendor/laravel/framework/src/Illuminate/Log/composer.json
@@ -14,9 +14,9 @@
}
],
"require": {
- "php": "^7.2.5|^8.0",
- "illuminate/contracts": "^7.0",
- "illuminate/support": "^7.0",
+ "php": "^7.3|^8.0",
+ "illuminate/contracts": "^8.0",
+ "illuminate/support": "^8.0",
"monolog/monolog": "^2.0"
},
"autoload": {
@@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "7.x-dev"
+ "dev-master": "8.x-dev"
}
},
"config": {
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php b/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php
index 4c70e9a1..05d6d8e3 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php
@@ -18,6 +18,7 @@ use Postmark\ThrowExceptionOnFailurePlugin;
use Postmark\Transport as PostmarkTransport;
use Psr\Log\LoggerInterface;
use Swift_DependencyContainer;
+use Swift_FailoverTransport as FailoverTransport;
use Swift_Mailer;
use Swift_SendmailTransport as SendmailTransport;
use Swift_SmtpTransport as SmtpTransport;
@@ -63,7 +64,7 @@ class MailManager implements FactoryContract
* Get a mailer instance by name.
*
* @param string|null $name
- * @return \Illuminate\Mail\Mailer
+ * @return \Illuminate\Contracts\Mail\Mailer
*/
public function mailer($name = null)
{
@@ -156,6 +157,8 @@ class MailManager implements FactoryContract
*
* @param array $config
* @return \Swift_Transport
+ *
+ * @throws \InvalidArgumentException
*/
public function createTransport(array $config)
{
@@ -168,7 +171,7 @@ class MailManager implements FactoryContract
return call_user_func($this->customCreators[$transport], $config);
}
- if (trim($transport) === '' || ! method_exists($this, $method = 'create'.ucfirst($transport).'Transport')) {
+ if (trim($transport ?? '') === '' || ! method_exists($this, $method = 'create'.ucfirst($transport).'Transport')) {
throw new InvalidArgumentException("Unsupported mail transport [{$transport}].");
}
@@ -260,11 +263,11 @@ class MailManager implements FactoryContract
*/
protected function createSesTransport(array $config)
{
- if (! isset($config['secret'])) {
- $config = array_merge($this->app['config']->get('services.ses', []), [
- 'version' => 'latest', 'service' => 'email',
- ]);
- }
+ $config = array_merge(
+ $this->app['config']->get('services.ses', []),
+ ['version' => 'latest', 'service' => 'email'],
+ $config
+ );
$config = Arr::except($config, ['transport']);
@@ -327,13 +330,46 @@ class MailManager implements FactoryContract
*/
protected function createPostmarkTransport(array $config)
{
+ $headers = isset($config['message_stream_id']) ? [
+ 'X-PM-Message-Stream' => $config['message_stream_id'],
+ ] : [];
+
return tap(new PostmarkTransport(
- $config['token'] ?? $this->app['config']->get('services.postmark.token')
+ $config['token'] ?? $this->app['config']->get('services.postmark.token'),
+ $headers
), function ($transport) {
- $transport->registerPlugin(new ThrowExceptionOnFailurePlugin());
+ $transport->registerPlugin(new ThrowExceptionOnFailurePlugin);
});
}
+ /**
+ * Create an instance of the Failover Swift Transport driver.
+ *
+ * @param array $config
+ * @return \Swift_FailoverTransport
+ */
+ protected function createFailoverTransport(array $config)
+ {
+ $transports = [];
+
+ foreach ($config['mailers'] as $name) {
+ $config = $this->getConfig($name);
+
+ if (is_null($config)) {
+ throw new InvalidArgumentException("Mailer [{$name}] is not defined.");
+ }
+
+ // Now, we will check if the "driver" key exists and if it does we will set
+ // the transport configuration parameter in order to offer compatibility
+ // with any Laravel <= 6.x application style mail configuration files.
+ $transports[] = $this->app['config']['mail.driver']
+ ? $this->createTransport(array_merge($config, ['transport' => $name]))
+ : $this->createTransport($config);
+ }
+
+ return new FailoverTransport($transports);
+ }
+
/**
* Create an instance of the Log Swift Transport driver.
*
@@ -440,6 +476,19 @@ class MailManager implements FactoryContract
$this->app['config']['mail.default'] = $name;
}
+ /**
+ * Disconnect the given mailer and remove from local cache.
+ *
+ * @param string|null $name
+ * @return void
+ */
+ public function purge($name = null)
+ {
+ $name = $name ?: $this->getDefaultDriver();
+
+ unset($this->mailers[$name]);
+ }
+
/**
* Register a custom transport creator Closure.
*
@@ -454,6 +503,41 @@ class MailManager implements FactoryContract
return $this;
}
+ /**
+ * Get the application instance used by the manager.
+ *
+ * @return \Illuminate\Contracts\Foundation\Application
+ */
+ public function getApplication()
+ {
+ return $this->app;
+ }
+
+ /**
+ * Set the application instance used by the manager.
+ *
+ * @param \Illuminate\Contracts\Foundation\Application $app
+ * @return $this
+ */
+ public function setApplication($app)
+ {
+ $this->app = $app;
+
+ return $this;
+ }
+
+ /**
+ * Forget all of the resolved mailer instances.
+ *
+ * @return $this
+ */
+ public function forgetMailers()
+ {
+ $this->mailers = [];
+
+ return $this;
+ }
+
/**
* Dynamically call the default driver instance.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php
old mode 100644
new mode 100755
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php b/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php
index 6876ba48..3df0074b 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php
@@ -7,18 +7,21 @@ use Illuminate\Contracts\Filesystem\Factory as FilesystemFactory;
use Illuminate\Contracts\Mail\Factory as MailFactory;
use Illuminate\Contracts\Mail\Mailable as MailableContract;
use Illuminate\Contracts\Queue\Factory as Queue;
+use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Support\Collection;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Str;
+use Illuminate\Support\Traits\Conditionable;
use Illuminate\Support\Traits\ForwardsCalls;
use Illuminate\Support\Traits\Localizable;
+use PHPUnit\Framework\Assert as PHPUnit;
use ReflectionClass;
use ReflectionProperty;
class Mailable implements MailableContract, Renderable
{
- use ForwardsCalls, Localizable;
+ use Conditionable, ForwardsCalls, Localizable;
/**
* The locale of the message.
@@ -74,7 +77,7 @@ class Mailable implements MailableContract, Renderable
*
* @var string
*/
- protected $markdown;
+ public $markdown;
/**
* The HTML to use for the message.
@@ -146,6 +149,13 @@ class Mailable implements MailableContract, Renderable
*/
public $mailer;
+ /**
+ * The rendered mailable views for testing / assertions.
+ *
+ * @var array
+ */
+ protected $assertionableRenderStrings;
+
/**
* The callback that should be invoked while building the view data.
*
@@ -161,7 +171,7 @@ class Mailable implements MailableContract, Renderable
*/
public function send($mailer)
{
- return $this->withLocale($this->locale, function () use ($mailer) {
+ $this->withLocale($this->locale, function () use ($mailer) {
Container::getInstance()->call([$this, 'build']);
$mailer = $mailer instanceof MailFactory
@@ -224,7 +234,11 @@ class Mailable implements MailableContract, Renderable
*/
protected function newQueuedJob()
{
- return new SendQueuedMailable($this);
+ return (new SendQueuedMailable($this))
+ ->through(array_merge(
+ method_exists($this, 'middleware') ? $this->middleware() : [],
+ $this->middleware ?? []
+ ));
}
/**
@@ -604,6 +618,10 @@ class Mailable implements MailableContract, Renderable
*/
protected function setAddress($address, $name = null, $property = 'to')
{
+ if (empty($address)) {
+ return $this;
+ }
+
foreach ($this->addressesToArray($address, $name) as $recipient) {
$recipient = $this->normalizeRecipient($recipient);
@@ -665,6 +683,10 @@ class Mailable implements MailableContract, Renderable
*/
protected function hasRecipient($address, $name = null, $property = 'to')
{
+ if (empty($address)) {
+ return false;
+ }
+
$expected = $this->normalizeRecipient(
$this->addressesToArray($address, $name)[0]
);
@@ -844,6 +866,114 @@ class Mailable implements MailableContract, Renderable
return $this;
}
+ /**
+ * Assert that the given text is present in the HTML email body.
+ *
+ * @param string $string
+ * @return $this
+ */
+ public function assertSeeInHtml($string)
+ {
+ [$html, $text] = $this->renderForAssertions();
+
+ PHPUnit::assertTrue(
+ Str::contains($html, $string),
+ "Did not see expected text [{$string}] within email body."
+ );
+
+ return $this;
+ }
+
+ /**
+ * Assert that the given text is not present in the HTML email body.
+ *
+ * @param string $string
+ * @return $this
+ */
+ public function assertDontSeeInHtml($string)
+ {
+ [$html, $text] = $this->renderForAssertions();
+
+ PHPUnit::assertFalse(
+ Str::contains($html, $string),
+ "Saw unexpected text [{$string}] within email body."
+ );
+
+ return $this;
+ }
+
+ /**
+ * Assert that the given text is present in the plain-text email body.
+ *
+ * @param string $string
+ * @return $this
+ */
+ public function assertSeeInText($string)
+ {
+ [$html, $text] = $this->renderForAssertions();
+
+ PHPUnit::assertTrue(
+ Str::contains($text, $string),
+ "Did not see expected text [{$string}] within text email body."
+ );
+
+ return $this;
+ }
+
+ /**
+ * Assert that the given text is not present in the plain-text email body.
+ *
+ * @param string $string
+ * @return $this
+ */
+ public function assertDontSeeInText($string)
+ {
+ [$html, $text] = $this->renderForAssertions();
+
+ PHPUnit::assertFalse(
+ Str::contains($text, $string),
+ "Saw unexpected text [{$string}] within text email body."
+ );
+
+ return $this;
+ }
+
+ /**
+ * Render the HTML and plain-text version of the mailable into views for assertions.
+ *
+ * @return array
+ *
+ * @throws \ReflectionException
+ */
+ protected function renderForAssertions()
+ {
+ if ($this->assertionableRenderStrings) {
+ return $this->assertionableRenderStrings;
+ }
+
+ return $this->assertionableRenderStrings = $this->withLocale($this->locale, function () {
+ Container::getInstance()->call([$this, 'build']);
+
+ $html = Container::getInstance()->make('mailer')->render(
+ $view = $this->buildView(), $this->buildViewData()
+ );
+
+ if (is_array($view) && isset($view[1])) {
+ $text = $view[1];
+ }
+
+ $text = $text ?? $view['text'] ?? '';
+
+ if (! empty($text) && ! $text instanceof Htmlable) {
+ $text = Container::getInstance()->make('mailer')->render(
+ $text, $this->buildViewData()
+ );
+ }
+
+ return [(string) $html, (string) $text];
+ });
+ }
+
/**
* Set the name of the mailer that should send the message.
*
@@ -881,25 +1011,6 @@ class Mailable implements MailableContract, Renderable
static::$viewDataCallback = $callback;
}
- /**
- * Apply the callback's message changes if the given "value" is true.
- *
- * @param mixed $value
- * @param callable $callback
- * @param mixed $default
- * @return mixed|$this
- */
- public function when($value, $callback, $default = null)
- {
- if ($value) {
- return $callback($this, $value) ?: $this;
- } elseif ($default) {
- return $default($this, $value) ?: $this;
- }
-
- return $this;
- }
-
/**
* Dynamically bind parameters to the message.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php b/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php
old mode 100644
new mode 100755
index 668d68ba..128f211f
--- a/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php
@@ -197,7 +197,7 @@ class Mailer implements MailerContract, MailQueueContract
*/
public function html($html, $callback)
{
- return $this->send(['html' => new HtmlString($html)], [], $callback);
+ $this->send(['html' => new HtmlString($html)], [], $callback);
}
/**
@@ -209,7 +209,7 @@ class Mailer implements MailerContract, MailQueueContract
*/
public function raw($text, $callback)
{
- return $this->send(['raw' => $text], [], $callback);
+ $this->send(['raw' => $text], [], $callback);
}
/**
@@ -222,7 +222,7 @@ class Mailer implements MailerContract, MailQueueContract
*/
public function plain($view, array $data, $callback)
{
- return $this->send(['text' => $view], $data, $callback);
+ $this->send(['text' => $view], $data, $callback);
}
/**
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php b/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php
index 65b6bdeb..9bd08360 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php
@@ -6,7 +6,6 @@ use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Str;
use League\CommonMark\CommonMarkConverter;
-use League\CommonMark\Environment;
use League\CommonMark\Extension\Table\TableExtension;
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;
@@ -63,9 +62,13 @@ class Markdown
'mail', $this->htmlComponentPaths()
)->make($view, $data)->render();
- $theme = Str::contains($this->theme, '::')
- ? $this->theme
- : 'mail::themes.'.$this->theme;
+ if ($this->view->exists($customTheme = Str::start($this->theme, 'mail.'))) {
+ $theme = $customTheme;
+ } else {
+ $theme = Str::contains($this->theme, '::')
+ ? $this->theme
+ : 'mail::themes.'.$this->theme;
+ }
return new HtmlString(($inliner ?: new CssToInlineStyles)->convert(
$contents, $this->view->make($theme, $data)->render()
@@ -100,15 +103,13 @@ class Markdown
*/
public static function parse($text)
{
- $environment = Environment::createCommonMarkEnvironment();
-
- $environment->addExtension(new TableExtension);
-
$converter = new CommonMarkConverter([
'allow_unsafe_links' => false,
- ], $environment);
+ ]);
- return new HtmlString($converter->convertToHtml($text));
+ $converter->getEnvironment()->addExtension(new TableExtension());
+
+ return new HtmlString((string) $converter->convertToHtml($text));
}
/**
@@ -170,4 +171,14 @@ class Markdown
return $this;
}
+
+ /**
+ * Get the theme currently being used by the renderer.
+ *
+ * @return string
+ */
+ public function getTheme()
+ {
+ return $this->theme;
+ }
}
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Message.php b/vendor/laravel/framework/src/Illuminate/Mail/Message.php
old mode 100644
new mode 100755
index d701fba9..cab6c026
--- a/vendor/laravel/framework/src/Illuminate/Mail/Message.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/Message.php
@@ -137,7 +137,7 @@ class Message
}
/**
- * Add a reply to address to the message.
+ * Add a "reply to" address to the message.
*
* @param string|array $address
* @param string|null $name
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php b/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php
index f59d3fc6..8fbabc4b 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php
@@ -5,9 +5,12 @@ namespace Illuminate\Mail;
use Illuminate\Contracts\Mail\Mailable as MailableContract;
use Illuminate\Contracts\Mail\Mailer as MailerContract;
use Illuminate\Contracts\Translation\HasLocalePreference;
+use Illuminate\Support\Traits\Conditionable;
class PendingMail
{
+ use Conditionable;
+
/**
* The mailer instance.
*
@@ -114,24 +117,11 @@ class PendingMail
* Send a new mailable message instance.
*
* @param \Illuminate\Contracts\Mail\Mailable $mailable
- * @return mixed
+ * @return void
*/
public function send(MailableContract $mailable)
{
- return $this->mailer->send($this->fill($mailable));
- }
-
- /**
- * Send a mailable message immediately.
- *
- * @param \Illuminate\Contracts\Mail\Mailable $mailable
- * @return mixed
- *
- * @deprecated Use send() instead.
- */
- public function sendNow(MailableContract $mailable)
- {
- return $this->mailer->send($this->fill($mailable));
+ $this->mailer->send($this->fill($mailable));
}
/**
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php b/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php
index 0747a884..1009789b 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php
@@ -2,11 +2,15 @@
namespace Illuminate\Mail;
+use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Mail\Factory as MailFactory;
use Illuminate\Contracts\Mail\Mailable as MailableContract;
+use Illuminate\Contracts\Queue\ShouldBeEncrypted;
class SendQueuedMailable
{
+ use Queueable;
+
/**
* The mailable message instance.
*
@@ -28,6 +32,13 @@ class SendQueuedMailable
*/
public $timeout;
+ /**
+ * Indicates if the job should be encrypted.
+ *
+ * @var bool
+ */
+ public $shouldBeEncrypted = false;
+
/**
* Create a new job instance.
*
@@ -39,6 +50,8 @@ class SendQueuedMailable
$this->mailable = $mailable;
$this->tries = property_exists($mailable, 'tries') ? $mailable->tries : null;
$this->timeout = property_exists($mailable, 'timeout') ? $mailable->timeout : null;
+ $this->afterCommit = property_exists($mailable, 'afterCommit') ? $mailable->afterCommit : null;
+ $this->shouldBeEncrypted = $mailable instanceof ShouldBeEncrypted;
}
/**
@@ -76,17 +89,17 @@ class SendQueuedMailable
}
/**
- * Get the retry delay for the mailable object.
+ * Get the number of seconds before a released mailable will be available.
*
* @return mixed
*/
- public function retryAfter()
+ public function backoff()
{
- if (! method_exists($this->mailable, 'retryAfter') && ! isset($this->mailable->retryAfter)) {
+ if (! method_exists($this->mailable, 'backoff') && ! isset($this->mailable->backoff)) {
return;
}
- return $this->mailable->retryAfter ?? $this->mailable->retryAfter();
+ return $this->mailable->backoff ?? $this->mailable->backoff();
}
/**
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Transport/ArrayTransport.php b/vendor/laravel/framework/src/Illuminate/Mail/Transport/ArrayTransport.php
index fbedec95..fe6fdf7d 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/Transport/ArrayTransport.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/Transport/ArrayTransport.php
@@ -26,6 +26,8 @@ class ArrayTransport extends Transport
/**
* {@inheritdoc}
+ *
+ * @return int
*/
public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
{
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Transport/LogTransport.php b/vendor/laravel/framework/src/Illuminate/Mail/Transport/LogTransport.php
index 43a2faa2..21f1aae9 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/Transport/LogTransport.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/Transport/LogTransport.php
@@ -28,6 +28,8 @@ class LogTransport extends Transport
/**
* {@inheritdoc}
+ *
+ * @return int
*/
public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
{
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Transport/MailgunTransport.php b/vendor/laravel/framework/src/Illuminate/Mail/Transport/MailgunTransport.php
index 195c0003..71ceccfa 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/Transport/MailgunTransport.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/Transport/MailgunTransport.php
@@ -3,7 +3,9 @@
namespace Illuminate\Mail\Transport;
use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\GuzzleException;
use Swift_Mime_SimpleMessage;
+use Swift_TransportException;
class MailgunTransport extends Transport
{
@@ -55,6 +57,8 @@ class MailgunTransport extends Transport
/**
* {@inheritdoc}
+ *
+ * @return int
*/
public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
{
@@ -66,15 +70,20 @@ class MailgunTransport extends Transport
$message->setBcc([]);
- $response = $this->client->request(
- 'POST',
- "https://{$this->endpoint}/v3/{$this->domain}/messages.mime",
- $this->payload($message, $to)
- );
+ try {
+ $response = $this->client->request(
+ 'POST',
+ "https://{$this->endpoint}/v3/{$this->domain}/messages.mime",
+ $this->payload($message, $to)
+ );
+ } catch (GuzzleException $e) {
+ throw new Swift_TransportException('Request to Mailgun API failed.', $e->getCode(), $e);
+ }
- $message->getHeaders()->addTextHeader(
- 'X-Mailgun-Message-ID', $this->getMessageId($response)
- );
+ $messageId = $this->getMessageId($response);
+
+ $message->getHeaders()->addTextHeader('X-Message-ID', $messageId);
+ $message->getHeaders()->addTextHeader('X-Mailgun-Message-ID', $messageId);
$message->setBcc($bcc);
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php b/vendor/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php
index 0dc8584a..7dd81a22 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php
@@ -2,8 +2,10 @@
namespace Illuminate\Mail\Transport;
+use Aws\Exception\AwsException;
use Aws\Ses\SesClient;
use Swift_Mime_SimpleMessage;
+use Swift_TransportException;
class SesTransport extends Transport
{
@@ -36,23 +38,32 @@ class SesTransport extends Transport
/**
* {@inheritdoc}
+ *
+ * @return int
*/
public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
{
$this->beforeSendPerformed($message);
- $result = $this->ses->sendRawEmail(
- array_merge(
- $this->options, [
- 'Source' => key($message->getSender() ?: $message->getFrom()),
- 'RawMessage' => [
- 'Data' => $message->toString(),
- ],
- ]
- )
- );
+ try {
+ $result = $this->ses->sendRawEmail(
+ array_merge(
+ $this->options, [
+ 'Source' => key($message->getSender() ?: $message->getFrom()),
+ 'RawMessage' => [
+ 'Data' => $message->toString(),
+ ],
+ ]
+ )
+ );
+ } catch (AwsException $e) {
+ throw new Swift_TransportException('Request to AWS SES API failed.', $e->getCode(), $e);
+ }
- $message->getHeaders()->addTextHeader('X-SES-Message-ID', $result->get('MessageId'));
+ $messageId = $result->get('MessageId');
+
+ $message->getHeaders()->addTextHeader('X-Message-ID', $messageId);
+ $message->getHeaders()->addTextHeader('X-SES-Message-ID', $messageId);
$this->sendPerformed($message);
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/Transport/Transport.php b/vendor/laravel/framework/src/Illuminate/Mail/Transport/Transport.php
index b26bff3f..62b44957 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/Transport/Transport.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/Transport/Transport.php
@@ -18,6 +18,8 @@ abstract class Transport implements Swift_Transport
/**
* {@inheritdoc}
+ *
+ * @return bool
*/
public function isStarted()
{
@@ -42,6 +44,8 @@ abstract class Transport implements Swift_Transport
/**
* {@inheritdoc}
+ *
+ * @return bool
*/
public function ping()
{
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/composer.json b/vendor/laravel/framework/src/Illuminate/Mail/composer.json
old mode 100644
new mode 100755
index 0eb541fa..cfddcb3a
--- a/vendor/laravel/framework/src/Illuminate/Mail/composer.json
+++ b/vendor/laravel/framework/src/Illuminate/Mail/composer.json
@@ -14,14 +14,16 @@
}
],
"require": {
- "php": "^7.2.5|^8.0",
+ "php": "^7.3|^8.0",
"ext-json": "*",
- "illuminate/container": "^7.0",
- "illuminate/contracts": "^7.0",
- "illuminate/support": "^7.0",
- "league/commonmark": "^1.3",
- "psr/log": "^1.0",
- "swiftmailer/swiftmailer": "^6.0",
+ "illuminate/collections": "^8.0",
+ "illuminate/container": "^8.0",
+ "illuminate/contracts": "^8.0",
+ "illuminate/macroable": "^8.0",
+ "illuminate/support": "^8.0",
+ "league/commonmark": "^1.3|^2.0.2",
+ "psr/log": "^1.0|^2.0",
+ "swiftmailer/swiftmailer": "^6.3",
"tijsverkoyen/css-to-inline-styles": "^2.2.2"
},
"autoload": {
@@ -31,12 +33,12 @@
},
"extra": {
"branch-alias": {
- "dev-master": "7.x-dev"
+ "dev-master": "8.x-dev"
}
},
"suggest": {
- "aws/aws-sdk-php": "Required to use the SES mail driver (^3.155).",
- "guzzlehttp/guzzle": "Required to use the Mailgun mail driver (^6.3.1|^7.0.1).",
+ "aws/aws-sdk-php": "Required to use the SES mail driver (^3.198.1).",
+ "guzzlehttp/guzzle": "Required to use the Mailgun mail driver (^6.5.5|^7.0.1).",
"wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)."
},
"config": {
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/layout.blade.php b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/layout.blade.php
index 02a54e2d..21d349b3 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/layout.blade.php
+++ b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/layout.blade.php
@@ -3,8 +3,8 @@
-
-
+
+
+
+
diff --git a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/themes/default.css b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/themes/default.css
index 350fb838..2483b116 100644
--- a/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/themes/default.css
+++ b/vendor/laravel/framework/src/Illuminate/Mail/resources/views/html/themes/default.css
@@ -113,6 +113,7 @@ img {
.logo {
height: 75px;
+ max-height: 75px;
width: 75px;
}
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/AnonymousNotifiable.php b/vendor/laravel/framework/src/Illuminate/Notifications/AnonymousNotifiable.php
index eab959b7..aa4d7bbc 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/AnonymousNotifiable.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/AnonymousNotifiable.php
@@ -20,6 +20,8 @@ class AnonymousNotifiable
* @param string $channel
* @param mixed $route
* @return $this
+ *
+ * @throws \InvalidArgumentException
*/
public function route($channel, $route)
{
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php b/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php
index d2344ab6..8eb9c251 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php
@@ -34,7 +34,7 @@ class ChannelManager extends Manager implements DispatcherContract, FactoryContr
*/
public function send($notifiables, $notification)
{
- return (new NotificationSender(
+ (new NotificationSender(
$this, $this->container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale)
)->send($notifiables, $notification);
}
@@ -49,7 +49,7 @@ class ChannelManager extends Manager implements DispatcherContract, FactoryContr
*/
public function sendNow($notifiables, $notification, array $channels = null)
{
- return (new NotificationSender(
+ (new NotificationSender(
$this, $this->container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale)
)->sendNow($notifiables, $notification, $channels);
}
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/BroadcastChannel.php b/vendor/laravel/framework/src/Illuminate/Notifications/Channels/BroadcastChannel.php
index d281b9b1..1389f49c 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/BroadcastChannel.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/Channels/BroadcastChannel.php
@@ -18,7 +18,7 @@ class BroadcastChannel
protected $events;
/**
- * Create a new database channel.
+ * Create a new broadcast channel.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/DatabaseChannel.php b/vendor/laravel/framework/src/Illuminate/Notifications/Channels/DatabaseChannel.php
index bd8af623..8b3167b0 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/Channels/DatabaseChannel.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/Channels/DatabaseChannel.php
@@ -21,6 +21,25 @@ class DatabaseChannel
);
}
+ /**
+ * Build an array payload for the DatabaseNotification Model.
+ *
+ * @param mixed $notifiable
+ * @param \Illuminate\Notifications\Notification $notification
+ * @return array
+ */
+ protected function buildPayload($notifiable, Notification $notification)
+ {
+ return [
+ 'id' => $notification->id,
+ 'type' => method_exists($notification, 'databaseType')
+ ? $notification->databaseType($notifiable)
+ : get_class($notification),
+ 'data' => $this->getData($notifiable, $notification),
+ 'read_at' => null,
+ ];
+ }
+
/**
* Get the data for the notification.
*
@@ -43,21 +62,4 @@ class DatabaseChannel
throw new RuntimeException('Notification is missing toDatabase / toArray method.');
}
-
- /**
- * Build an array payload for the DatabaseNotification Model.
- *
- * @param mixed $notifiable
- * @param \Illuminate\Notifications\Notification $notification
- * @return array
- */
- protected function buildPayload($notifiable, Notification $notification)
- {
- return [
- 'id' => $notification->id,
- 'type' => get_class($notification),
- 'data' => $this->getData($notifiable, $notification),
- 'read_at' => null,
- ];
- }
}
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotification.php b/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotification.php
index 0dfc7e53..14bc9d65 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotification.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/DatabaseNotification.php
@@ -2,6 +2,7 @@
namespace Illuminate\Notifications;
+use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
class DatabaseNotification extends Model
@@ -98,6 +99,28 @@ class DatabaseNotification extends Model
return $this->read_at === null;
}
+ /**
+ * Scope a query to only include read notifications.
+ *
+ * @param \Illuminate\Database\Eloquent\Builder $query
+ * @return \Illuminate\Database\Eloquent\Builder
+ */
+ public function scopeRead(Builder $query)
+ {
+ return $query->whereNotNull('read_at');
+ }
+
+ /**
+ * Scope a query to only include unread notifications.
+ *
+ * @param \Illuminate\Database\Eloquent\Builder $query
+ * @return \Illuminate\Database\Eloquent\Builder
+ */
+ public function scopeUnread(Builder $query)
+ {
+ return $query->whereNull('read_at');
+ }
+
/**
* Create a new database notification collection instance.
*
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php b/vendor/laravel/framework/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php
index 77498ea3..24958852 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php
@@ -92,6 +92,10 @@ class BroadcastNotificationCreated implements ShouldBroadcast
*/
public function broadcastWith()
{
+ if (method_exists($this->notification, 'broadcastWith')) {
+ return $this->notification->broadcastWith();
+ }
+
return array_merge($this->data, [
'id' => $this->notification->id,
'type' => $this->broadcastType(),
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/HasDatabaseNotifications.php b/vendor/laravel/framework/src/Illuminate/Notifications/HasDatabaseNotifications.php
index 981d8e55..5f999da9 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/HasDatabaseNotifications.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/HasDatabaseNotifications.php
@@ -21,7 +21,7 @@ trait HasDatabaseNotifications
*/
public function readNotifications()
{
- return $this->notifications()->whereNotNull('read_at');
+ return $this->notifications()->read();
}
/**
@@ -31,6 +31,6 @@ trait HasDatabaseNotifications
*/
public function unreadNotifications()
{
- return $this->notifications()->whereNull('read_at');
+ return $this->notifications()->unread();
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/MailMessage.php b/vendor/laravel/framework/src/Illuminate/Notifications/Messages/MailMessage.php
index 08ee2f1f..94342f30 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/MailMessage.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/Messages/MailMessage.php
@@ -6,10 +6,12 @@ use Illuminate\Container\Container;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Mail\Markdown;
-use Traversable;
+use Illuminate\Support\Traits\Conditionable;
class MailMessage extends SimpleMessage implements Renderable
{
+ use Conditionable;
+
/**
* The view to be rendered.
*
@@ -297,9 +299,7 @@ class MailMessage extends SimpleMessage implements Renderable
*/
protected function arrayOfAddresses($address)
{
- return is_array($address) ||
- $address instanceof Arrayable ||
- $address instanceof Traversable;
+ return is_iterable($address) || $address instanceof Arrayable;
}
/**
@@ -315,9 +315,10 @@ class MailMessage extends SimpleMessage implements Renderable
);
}
- return Container::getInstance()
- ->make(Markdown::class)
- ->render($this->markdown, $this->data());
+ $markdown = Container::getInstance()->make(Markdown::class);
+
+ return $markdown->theme($this->theme ?: $markdown->getTheme())
+ ->render($this->markdown, $this->data());
}
/**
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/SimpleMessage.php b/vendor/laravel/framework/src/Illuminate/Notifications/Messages/SimpleMessage.php
index f90b26e9..7dab7e45 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/Messages/SimpleMessage.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/Messages/SimpleMessage.php
@@ -157,6 +157,21 @@ class SimpleMessage
return $this->with($line);
}
+ /**
+ * Add lines of text to the notification.
+ *
+ * @param iterable $lines
+ * @return $this
+ */
+ public function lines($lines)
+ {
+ foreach ($lines as $line) {
+ $this->line($line);
+ }
+
+ return $this;
+ }
+
/**
* Add a line of text to the notification.
*
@@ -192,7 +207,7 @@ class SimpleMessage
return implode(' ', array_map('trim', $line));
}
- return trim(implode(' ', array_map('trim', preg_split('/\\r\\n|\\r|\\n/', $line))));
+ return trim(implode(' ', array_map('trim', preg_split('/\\r\\n|\\r|\\n/', $line ?? ''))));
}
/**
@@ -239,7 +254,7 @@ class SimpleMessage
'outroLines' => $this->outroLines,
'actionText' => $this->actionText,
'actionUrl' => $this->actionUrl,
- 'displayableActionUrl' => str_replace(['mailto:', 'tel:'], '', $this->actionUrl),
+ 'displayableActionUrl' => str_replace(['mailto:', 'tel:'], '', $this->actionUrl ?? ''),
];
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php b/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php
index 15128a15..c7b67ecc 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php
@@ -76,7 +76,7 @@ class NotificationSender
return $this->queueNotification($notifiables, $notification);
}
- return $this->sendNow($notifiables, $notification);
+ $this->sendNow($notifiables, $notification);
}
/**
@@ -162,6 +162,11 @@ class NotificationSender
*/
protected function shouldSendNotification($notifiable, $notification, $channel)
{
+ if (method_exists($notification, 'shouldSend') &&
+ $notification->shouldSend($notifiable, $channel) === false) {
+ return false;
+ }
+
return $this->events->until(
new NotificationSending($notifiable, $notification, $channel)
) !== false;
@@ -202,7 +207,10 @@ class NotificationSender
(new SendQueuedNotifications($notifiable, $notification, [$channel]))
->onConnection($notification->connection)
->onQueue($queue)
- ->delay($notification->delay)
+ ->delay(is_array($notification->delay) ?
+ ($notification->delay[$channel] ?? null)
+ : $notification->delay
+ )
->through(
array_merge(
method_exists($notification, 'middleware') ? $notification->middleware() : [],
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php b/vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php
index 7fc300e5..d83c8906 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php
@@ -3,6 +3,7 @@
namespace Illuminate\Notifications;
use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldBeEncrypted;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Database\Eloquent\Model;
@@ -49,6 +50,13 @@ class SendQueuedNotifications implements ShouldQueue
*/
public $timeout;
+ /**
+ * Indicates if the job should be encrypted.
+ *
+ * @var bool
+ */
+ public $shouldBeEncrypted = false;
+
/**
* Create a new job instance.
*
@@ -64,6 +72,8 @@ class SendQueuedNotifications implements ShouldQueue
$this->notifiables = $this->wrapNotifiables($notifiables);
$this->tries = property_exists($notification, 'tries') ? $notification->tries : null;
$this->timeout = property_exists($notification, 'timeout') ? $notification->timeout : null;
+ $this->afterCommit = property_exists($notification, 'afterCommit') ? $notification->afterCommit : null;
+ $this->shouldBeEncrypted = $notification instanceof ShouldBeEncrypted;
}
/**
@@ -118,17 +128,17 @@ class SendQueuedNotifications implements ShouldQueue
}
/**
- * Get the retry delay for the notification.
+ * Get the number of seconds before a released notification will be available.
*
* @return mixed
*/
- public function retryAfter()
+ public function backoff()
{
- if (! method_exists($this->notification, 'retryAfter') && ! isset($this->notification->retryAfter)) {
+ if (! method_exists($this->notification, 'backoff') && ! isset($this->notification->backoff)) {
return;
}
- return $this->notification->retryAfter ?? $this->notification->retryAfter();
+ return $this->notification->backoff ?? $this->notification->backoff();
}
/**
@@ -138,11 +148,11 @@ class SendQueuedNotifications implements ShouldQueue
*/
public function retryUntil()
{
- if (! method_exists($this->notification, 'retryUntil') && ! isset($this->notification->timeoutAt)) {
+ if (! method_exists($this->notification, 'retryUntil') && ! isset($this->notification->retryUntil)) {
return;
}
- return $this->notification->timeoutAt ?? $this->notification->retryUntil();
+ return $this->notification->retryUntil ?? $this->notification->retryUntil();
}
/**
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/composer.json b/vendor/laravel/framework/src/Illuminate/Notifications/composer.json
index 18306477..1bc673a2 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/composer.json
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/composer.json
@@ -14,15 +14,16 @@
}
],
"require": {
- "php": "^7.2.5|^8.0",
- "illuminate/broadcasting": "^7.0",
- "illuminate/bus": "^7.0",
- "illuminate/container": "^7.0",
- "illuminate/contracts": "^7.0",
- "illuminate/filesystem": "^7.0",
- "illuminate/mail": "^7.0",
- "illuminate/queue": "^7.0",
- "illuminate/support": "^7.0"
+ "php": "^7.3|^8.0",
+ "illuminate/broadcasting": "^8.0",
+ "illuminate/bus": "^8.0",
+ "illuminate/collections": "^8.0",
+ "illuminate/container": "^8.0",
+ "illuminate/contracts": "^8.0",
+ "illuminate/filesystem": "^8.0",
+ "illuminate/mail": "^8.0",
+ "illuminate/queue": "^8.0",
+ "illuminate/support": "^8.0"
},
"autoload": {
"psr-4": {
@@ -31,11 +32,11 @@
},
"extra": {
"branch-alias": {
- "dev-master": "7.x-dev"
+ "dev-master": "8.x-dev"
}
},
"suggest": {
- "illuminate/database": "Required to use the database transport (^7.0)."
+ "illuminate/database": "Required to use the database transport (^8.0)."
},
"config": {
"sort-packages": true
diff --git a/vendor/laravel/framework/src/Illuminate/Notifications/resources/views/email.blade.php b/vendor/laravel/framework/src/Illuminate/Notifications/resources/views/email.blade.php
index e7a56b46..bcf39f0a 100644
--- a/vendor/laravel/framework/src/Illuminate/Notifications/resources/views/email.blade.php
+++ b/vendor/laravel/framework/src/Illuminate/Notifications/resources/views/email.blade.php
@@ -51,7 +51,7 @@
@isset($actionText)
@slot('subcopy')
@lang(
- "If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\n".
+ "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\n".
'into your web browser:',
[
'actionText' => $actionText,
diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php b/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php
index 12ad6446..ac9ef403 100644
--- a/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php
+++ b/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php
@@ -8,13 +8,14 @@ use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\ForwardsCalls;
+use Illuminate\Support\Traits\Tappable;
/**
* @mixin \Illuminate\Support\Collection
*/
abstract class AbstractPaginator implements Htmlable
{
- use ForwardsCalls;
+ use ForwardsCalls, Tappable;
/**
* All of the items being paginated.
@@ -112,14 +113,14 @@ abstract class AbstractPaginator implements Htmlable
*
* @var string
*/
- public static $defaultView = 'pagination::bootstrap-4';
+ public static $defaultView = 'pagination::tailwind';
/**
* The default "simple" pagination view.
*
* @var string
*/
- public static $defaultSimpleView = 'pagination::simple-bootstrap-4';
+ public static $defaultSimpleView = 'pagination::simple-tailwind';
/**
* Determine if the given value is a valid page number.
@@ -335,6 +336,19 @@ abstract class AbstractPaginator implements Htmlable
return count($this->items) > 0 ? $this->firstItem() + $this->count() - 1 : null;
}
+ /**
+ * Transform each item in the slice of items using a callback.
+ *
+ * @param callable $callback
+ * @return $this
+ */
+ public function through(callable $callback)
+ {
+ $this->items->transform($callback);
+
+ return $this;
+ }
+
/**
* Get the number of items shown per page.
*
@@ -365,6 +379,16 @@ abstract class AbstractPaginator implements Htmlable
return $this->currentPage() <= 1;
}
+ /**
+ * Determine if the paginator is on the last page.
+ *
+ * @return bool
+ */
+ public function onLastPage()
+ {
+ return ! $this->hasMorePages();
+ }
+
/**
* Get the current page.
*
@@ -498,6 +522,21 @@ abstract class AbstractPaginator implements Htmlable
static::$currentPageResolver = $resolver;
}
+ /**
+ * Resolve the query string or return the default value.
+ *
+ * @param string|array|null $default
+ * @return string
+ */
+ public static function resolveQueryString($default = null)
+ {
+ if (isset(static::$queryStringResolver)) {
+ return (static::$queryStringResolver)();
+ }
+
+ return $default;
+ }
+
/**
* Set with query string resolver callback.
*
@@ -563,6 +602,17 @@ abstract class AbstractPaginator implements Htmlable
static::defaultSimpleView('pagination::simple-tailwind');
}
+ /**
+ * Indicate that Bootstrap 4 styling should be used for generated links.
+ *
+ * @return void
+ */
+ public static function useBootstrap()
+ {
+ static::defaultView('pagination::bootstrap-4');
+ static::defaultSimpleView('pagination::simple-bootstrap-4');
+ }
+
/**
* Indicate that Bootstrap 3 styling should be used for generated links.
*
@@ -579,6 +629,7 @@ abstract class AbstractPaginator implements Htmlable
*
* @return \ArrayIterator
*/
+ #[\ReturnTypeWillChange]
public function getIterator()
{
return $this->items->getIterator();
@@ -609,6 +660,7 @@ abstract class AbstractPaginator implements Htmlable
*
* @return int
*/
+ #[\ReturnTypeWillChange]
public function count()
{
return $this->items->count();
@@ -653,6 +705,7 @@ abstract class AbstractPaginator implements Htmlable
* @param mixed $key
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function offsetExists($key)
{
return $this->items->has($key);
@@ -664,6 +717,7 @@ abstract class AbstractPaginator implements Htmlable
* @param mixed $key
* @return mixed
*/
+ #[\ReturnTypeWillChange]
public function offsetGet($key)
{
return $this->items->get($key);
@@ -676,6 +730,7 @@ abstract class AbstractPaginator implements Htmlable
* @param mixed $value
* @return void
*/
+ #[\ReturnTypeWillChange]
public function offsetSet($key, $value)
{
$this->items->put($key, $value);
@@ -687,6 +742,7 @@ abstract class AbstractPaginator implements Htmlable
* @param mixed $key
* @return void
*/
+ #[\ReturnTypeWillChange]
public function offsetUnset($key)
{
$this->items->forget($key);
@@ -715,7 +771,7 @@ abstract class AbstractPaginator implements Htmlable
}
/**
- * Render the contents of the paginator when casting to string.
+ * Render the contents of the paginator when casting to a string.
*
* @return string
*/
diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php b/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php
index 46435b84..24f68b12 100644
--- a/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php
+++ b/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php
@@ -94,6 +94,36 @@ class LengthAwarePaginator extends AbstractPaginator implements Arrayable, Array
]));
}
+ /**
+ * Get the paginator links as a collection (for JSON responses).
+ *
+ * @return \Illuminate\Support\Collection
+ */
+ public function linkCollection()
+ {
+ return collect($this->elements())->flatMap(function ($item) {
+ if (! is_array($item)) {
+ return [['url' => null, 'label' => '...', 'active' => false]];
+ }
+
+ return collect($item)->map(function ($url, $page) {
+ return [
+ 'url' => $url,
+ 'label' => (string) $page,
+ 'active' => $this->currentPage() === $page,
+ ];
+ });
+ })->prepend([
+ 'url' => $this->previousPageUrl(),
+ 'label' => function_exists('__') ? __('pagination.previous') : 'Previous',
+ 'active' => false,
+ ])->push([
+ 'url' => $this->nextPageUrl(),
+ 'label' => function_exists('__') ? __('pagination.next') : 'Next',
+ 'active' => false,
+ ]);
+ }
+
/**
* Get the array of elements to pass to the view.
*
@@ -168,6 +198,7 @@ class LengthAwarePaginator extends AbstractPaginator implements Arrayable, Array
'from' => $this->firstItem(),
'last_page' => $this->lastPage(),
'last_page_url' => $this->url($this->lastPage()),
+ 'links' => $this->linkCollection()->toArray(),
'next_page_url' => $this->nextPageUrl(),
'path' => $this->path(),
'per_page' => $this->perPage(),
@@ -182,6 +213,7 @@ class LengthAwarePaginator extends AbstractPaginator implements Arrayable, Array
*
* @return array
*/
+ #[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->toArray();
diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php
old mode 100644
new mode 100755
index 6510f2f2..e94cebd6
--- a/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php
+++ b/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php
@@ -29,26 +29,6 @@ class PaginationServiceProvider extends ServiceProvider
*/
public function register()
{
- Paginator::viewFactoryResolver(function () {
- return $this->app['view'];
- });
-
- Paginator::currentPathResolver(function () {
- return $this->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 (int) $page;
- }
-
- return 1;
- });
-
- Paginator::queryStringResolver(function () {
- return $this->app['request']->query();
- });
+ PaginationState::resolveUsing($this->app);
}
}
diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php b/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php
index eb664eef..733edb8e 100644
--- a/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php
+++ b/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php
@@ -158,6 +158,7 @@ class Paginator extends AbstractPaginator implements Arrayable, ArrayAccess, Cou
*
* @return array
*/
+ #[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->toArray();
diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/UrlWindow.php b/vendor/laravel/framework/src/Illuminate/Pagination/UrlWindow.php
index 33b7216e..31c7cc2a 100644
--- a/vendor/laravel/framework/src/Illuminate/Pagination/UrlWindow.php
+++ b/vendor/laravel/framework/src/Illuminate/Pagination/UrlWindow.php
@@ -59,9 +59,9 @@ class UrlWindow
protected function getSmallSlider()
{
return [
- 'first' => $this->paginator->getUrlRange(1, $this->lastPage()),
+ 'first' => $this->paginator->getUrlRange(1, $this->lastPage()),
'slider' => null,
- 'last' => null,
+ 'last' => null,
];
}
@@ -145,9 +145,9 @@ class UrlWindow
protected function getFullSlider($onEachSide)
{
return [
- 'first' => $this->getStart(),
+ 'first' => $this->getStart(),
'slider' => $this->getAdjacentUrlRange($onEachSide),
- 'last' => $this->getFinish(),
+ 'last' => $this->getFinish(),
];
}
diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/composer.json b/vendor/laravel/framework/src/Illuminate/Pagination/composer.json
old mode 100644
new mode 100755
index 36de9820..5c8a380b
--- a/vendor/laravel/framework/src/Illuminate/Pagination/composer.json
+++ b/vendor/laravel/framework/src/Illuminate/Pagination/composer.json
@@ -14,10 +14,11 @@
}
],
"require": {
- "php": "^7.2.5|^8.0",
+ "php": "^7.3|^8.0",
"ext-json": "*",
- "illuminate/contracts": "^7.0",
- "illuminate/support": "^7.0"
+ "illuminate/collections": "^8.0",
+ "illuminate/contracts": "^8.0",
+ "illuminate/support": "^8.0"
},
"autoload": {
"psr-4": {
@@ -26,7 +27,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "7.x-dev"
+ "dev-master": "8.x-dev"
}
},
"config": {
diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-tailwind.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-tailwind.blade.php
index 1c5e52f3..6872cca3 100644
--- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-tailwind.blade.php
+++ b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/simple-tailwind.blade.php
@@ -6,14 +6,14 @@
{!! __('pagination.previous') !!}
@else
-
+
{!! __('pagination.previous') !!}
@endif
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
-
+
{!! __('pagination.next') !!}
@else
diff --git a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/tailwind.blade.php b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/tailwind.blade.php
index 4b92aaba..5bf323b4 100644
--- a/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/tailwind.blade.php
+++ b/vendor/laravel/framework/src/Illuminate/Pagination/resources/views/tailwind.blade.php
@@ -1,18 +1,18 @@
@if ($paginator->hasPages())
-