composer update

This commit is contained in:
2019-07-04 06:15:03 +00:00
parent eb2f2f86f0
commit 472c22fcfb
89 changed files with 249 additions and 6415 deletions
@@ -10,7 +10,7 @@
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
<script src="{{ asset('js/app.js') }}"></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
@@ -897,11 +897,12 @@ class Connection implements ConnectionInterface
if (is_null($this->doctrineConnection)) {
$driver = $this->getDoctrineDriver();
$this->doctrineConnection = new DoctrineConnection([
$this->doctrineConnection = new DoctrineConnection(array_filter([
'pdo' => $this->getPdo(),
'dbname' => $this->getConfig('database'),
'driver' => $driver->getName(),
], $driver);
'serverVersion' => $this->getConfig('server_version'),
]), $driver);
}
return $this->doctrineConnection;
@@ -16,7 +16,7 @@ trait QueriesRelationships
/**
* Add a relationship count / exists condition to the query.
*
* @param string $relation
* @param string|\Illuminate\Database\Eloquent\Relations\Relation $relation
* @param string $operator
* @param int $count
* @param string $boolean
@@ -25,14 +25,16 @@ trait QueriesRelationships
*/
public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null)
{
if (strpos($relation, '.') !== false) {
return $this->hasNested($relation, $operator, $count, $boolean, $callback);
if (is_string($relation)) {
if (strpos($relation, '.') !== false) {
return $this->hasNested($relation, $operator, $count, $boolean, $callback);
}
$relation = $this->getRelationWithoutConstraints($relation);
}
$relation = $this->getRelationWithoutConstraints($relation);
if ($relation instanceof MorphTo) {
throw new RuntimeException('has() and whereHas() do not support MorphTo relationships.');
throw new RuntimeException('Please use whereHasMorph() for MorphTo relationships.');
}
// If we only need to check for the existence of the relation, then we can optimize
@@ -182,6 +184,167 @@ trait QueriesRelationships
return $this->doesntHave($relation, 'or', $callback);
}
/**
* Add a polymorphic relationship count / exists condition to the query.
*
* @param string $relation
* @param string|array $types
* @param string $operator
* @param int $count
* @param string $boolean
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null)
{
$relation = $this->getRelationWithoutConstraints($relation);
$types = (array) $types;
if ($types === ['*']) {
$types = $this->model->newModelQuery()->distinct()->pluck($relation->getMorphType())->all();
foreach ($types as &$type) {
$type = Relation::getMorphedModel($type) ?? $type;
}
}
return $this->where(function ($query) use ($relation, $callback, $operator, $count, $types) {
foreach ($types as $type) {
$query->orWhere(function ($query) use ($relation, $callback, $operator, $count, $type) {
$belongsTo = $this->getBelongsToRelation($relation, $type);
if ($callback) {
$callback = function ($query) use ($callback, $type) {
return $callback($query, $type);
};
}
$query->where($relation->getMorphType(), '=', (new $type)->getMorphClass())
->whereHas($belongsTo, $callback, $operator, $count);
});
}
}, null, null, $boolean);
}
/**
* Get the BelongsTo relationship for a single polymorphic type.
*
* @param \Illuminate\Database\Eloquent\Relations\MorphTo $relation
* @param string $type
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
protected function getBelongsToRelation(MorphTo $relation, $type)
{
$belongsTo = Relation::noConstraints(function () use ($relation, $type) {
return $this->model->belongsTo(
$type,
$relation->getForeignKeyName(),
$relation->getOwnerKeyName()
);
});
$belongsTo->getQuery()->mergeConstraintsFrom($relation->getQuery());
return $belongsTo;
}
/**
* Add a polymorphic relationship count / exists condition to the query with an "or".
*
* @param string $relation
* @param string|array $types
* @param string $operator
* @param int $count
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function orHasMorph($relation, $types, $operator = '>=', $count = 1)
{
return $this->hasMorph($relation, $types, $operator, $count, 'or');
}
/**
* Add a polymorphic relationship count / exists condition to the query.
*
* @param string $relation
* @param string|array $types
* @param string $boolean
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function doesntHaveMorph($relation, $types, $boolean = 'and', Closure $callback = null)
{
return $this->hasMorph($relation, $types, '<', 1, $boolean, $callback);
}
/**
* Add a polymorphic relationship count / exists condition to the query with an "or".
*
* @param string $relation
* @param string|array $types
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function orDoesntHaveMorph($relation, $types)
{
return $this->doesntHaveMorph($relation, $types, 'or');
}
/**
* Add a polymorphic relationship count / exists condition to the query with where clauses.
*
* @param string $relation
* @param string|array $types
* @param \Closure|null $callback
* @param string $operator
* @param int $count
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function whereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1)
{
return $this->hasMorph($relation, $types, $operator, $count, 'and', $callback);
}
/**
* Add a polymorphic relationship count / exists condition to the query with where clauses and an "or".
*
* @param string $relation
* @param string|array $types
* @param \Closure $callback
* @param string $operator
* @param int $count
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function orWhereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1)
{
return $this->hasMorph($relation, $types, $operator, $count, 'or', $callback);
}
/**
* Add a polymorphic relationship count / exists condition to the query with where clauses.
*
* @param string $relation
* @param string|array $types
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function whereDoesntHaveMorph($relation, $types, Closure $callback = null)
{
return $this->doesntHaveMorph($relation, $types, 'and', $callback);
}
/**
* Add a polymorphic relationship count / exists condition to the query with where clauses and an "or".
*
* @param string $relation
* @param string|array $types
* @param \Closure $callback
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function orWhereDoesntHaveMorph($relation, $types, Closure $callback = null)
{
return $this->doesntHaveMorph($relation, $types, 'or', $callback);
}
/**
* Add subselect queries to count the relations.
*
@@ -367,7 +367,7 @@ abstract class Relation
*/
public static function getMorphedModel($alias)
{
return self::$morphMap[$alias] ?? null;
return static::$morphMap[$alias] ?? null;
}
/**
@@ -121,7 +121,7 @@ class ChangeColumn
$options['length'] = static::calculateDoctrineTextLength($fluent['type']);
}
if ($fluent['type'] === 'json') {
if (in_array($fluent['type'], ['json', 'binary'])) {
$options['customSchemaOptions'] = [
'collation' => '',
];
@@ -29,7 +29,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
*
* @var string
*/
const VERSION = '5.8.26';
const VERSION = '5.8.27';
/**
* The base path for the Laravel installation.
@@ -205,7 +205,7 @@ class Handler implements ExceptionHandlerContract
} elseif ($e instanceof TokenMismatchException) {
$e = new HttpException(419, $e->getMessage(), $e);
} elseif ($e instanceof SuspiciousOperationException) {
$e = new NotFoundHttpException(null, $e);
$e = new NotFoundHttpException('Bad hostname provided.', $e);
}
return $e;
+1 -1
View File
@@ -63,6 +63,6 @@ class Mix
}
}
return new HtmlString($manifestDirectory.$manifest[$path]);
return new HtmlString(app('config')->get('app.mix_url').$manifestDirectory.$manifest[$path]);
}
}
@@ -190,7 +190,7 @@ class ProviderRepository
throw new Exception('The bootstrap/cache directory must be present and writable.');
}
$this->files->put(
$this->files->replace(
$this->manifestPath, '<?php return '.var_export($manifest, true).';'
);
@@ -1042,7 +1042,7 @@ class TestResponse
/**
* Dump the content from the response.
*
* @return void
* @return $this
*/
public function dump()
{
@@ -1054,17 +1054,21 @@ class TestResponse
$content = $json;
}
dd($content);
dump($content);
return $this;
}
/**
* Dump the headers from the response.
*
* @return void
* @return $this
*/
public function dumpHeaders()
{
dd($this->headers->all());
dump($this->headers->all());
return $this;
}
/**
@@ -64,12 +64,16 @@ class MailgunTransport extends Transport
$message->setBcc([]);
$this->client->request(
$response = $this->client->request(
'POST',
"https://{$this->endpoint}/v3/{$this->domain}/messages.mime",
$this->payload($message, $to)
);
$message->getHeaders()->addTextHeader(
'X-Mailgun-Message-ID', $this->getMessageId($response)
);
$this->sendPerformed($message);
return $this->numberOfRecipients($message);
@@ -129,6 +133,19 @@ class MailgunTransport extends Transport
);
}
/**
* Get the message ID from the response.
*
* @param \Psr\Http\Message\ResponseInterface $response
* @return string
*/
protected function getMessageId($response)
{
return object_get(
json_decode($response->getBody()->getContents()), 'id'
);
}
/**
* Get the API key being used by the transport.
*
@@ -204,6 +204,17 @@ class RedisManager implements Factory
$this->events = false;
}
/**
* Set the default driver.
*
* @param string $driver
* @return void
*/
public function setDriver($driver)
{
$this->driver = $driver;
}
/**
* Pass methods onto the default Redis connection.
*
@@ -9,7 +9,7 @@ class MiddlewareNameResolver
/**
* Resolve the middleware name to a class name(s) preserving passed parameters.
*
* @param string $name
* @param \Closure|string $name
* @param array $map
* @param array $middlewareGroups
* @return \Closure|string|array
+4 -4
View File
@@ -632,7 +632,7 @@ class Str
'l' => ['ł', 'ľ', 'ĺ', 'ļ', 'ŀ', 'л', 'λ', 'ل', 'လ', 'ლ', 'l'],
'm' => ['м', 'μ', 'م', 'မ', 'მ', 'm'],
'n' => ['ñ', 'ń', 'ň', 'ņ', 'ʼn', 'ŋ', 'ν', 'н', 'ن', 'န', 'ნ', 'n'],
'o' => ['ó', 'ò', 'ỏ', 'õ', 'ọ', 'ô', 'ố', 'ồ', 'ổ', 'ỗ', 'ộ', 'ơ', 'ớ', 'ờ', 'ở', 'ỡ', 'ợ', 'ø', 'ō', 'ő', 'ŏ', 'ο', 'ὀ', 'ὁ', 'ὂ', 'ὃ', 'ὄ', 'ὅ', 'ὸ', 'ό', 'о', 'و', 'θ', 'ို', 'ǒ', 'ǿ', 'º', 'ო', 'ओ', 'o', 'ö'],
'o' => ['ó', 'ò', 'ỏ', 'õ', 'ọ', 'ô', 'ố', 'ồ', 'ổ', 'ỗ', 'ộ', 'ơ', 'ớ', 'ờ', 'ở', 'ỡ', 'ợ', 'ø', 'ō', 'ő', 'ŏ', 'ο', 'ὀ', 'ὁ', 'ὂ', 'ὃ', 'ὄ', 'ὅ', 'ὸ', 'ό', 'о', 'و', 'ို', 'ǒ', 'ǿ', 'º', 'ო', 'ओ', 'o', 'ö'],
'p' => ['п', 'π', 'ပ', 'პ', 'پ', 'p'],
'q' => ['ყ', 'q'],
'r' => ['ŕ', 'ř', 'ŗ', 'р', 'ρ', 'ر', 'რ', 'r'],
@@ -665,7 +665,7 @@ class Str
'shch' => ['щ'],
'ss' => ['ß'],
'sx' => ['ŝ'],
'th' => ['þ', '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implements NotificationFactory, NotificationDispatcher
*
* @param \Illuminate\Support\Collection|array|mixed $notifiables
* @param mixed $notification
* @param array|null $channels
* @return void
*/
public function sendNow($notifiables, $notification)
public function sendNow($notifiables, $notification, array $channels = null)
{
if (! $notifiables instanceof Collection && ! is_array($notifiables)) {
$notifiables = [$notifiables];
@@ -208,7 +209,7 @@ class NotificationFake implements NotificationFactory, NotificationDispatcher
$this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [
'notification' => $notification,
'channels' => $notification->via($notifiable),
'channels' => $channels ?: $notification->via($notifiable),
'notifiable' => $notifiable,
'locale' => $notification->locale ?? $this->locale ?? value(function () use ($notifiable) {
if ($notifiable instanceof HasLocalePreference) {