\Illuminate\Contracts\Database\Query\Expression|string $table * @param \Closure|\Illuminate\Contracts\Database\Query\Expression|string|null $first * @param string|null $operator * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second * @return $this */ public function crossJoin($table, $first = null, $operator = null, $second = null) { if ($first) { return $this->join($table, $first, $operator, $second, 'cross'); } $this->joins[] = $this->newJoinClause($this, 'cross', $table); return $this; } /** * Add a subquery cross join to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|string $query * @param string $as * @return $this */ public function crossJoinSub($query, $as) { [$query, $bindings] = $this->createSub($query); $expression = '('.$query.') as '.$this->grammar->wrapTable($as); $this->addBinding($bindings, 'join'); $this->joins[] = $this->newJoinClause($this, 'cross', new Expression($expression)); return $this; } /** * Get a new join clause. * * @param string $type * @param \Illuminate\Contracts\Database\Query\Expression|string $table * @return \Illuminate\Database\Query\JoinClause */ protected function newJoinClause(self $parentQuery, $type, $table) { return new JoinClause($parentQuery, $type, $table); } /** * Get a new join lateral clause. * * @param string $type * @param \Illuminate\Contracts\Database\Query\Expression|string $table * @return \Illuminate\Database\Query\JoinLateralClause */ protected function newJoinLateralClause(self $parentQuery, $type, $table) { return new JoinLateralClause($parentQuery, $type, $table); } /** * Merge an array of where clauses and bindings. * * @param array $wheres * @param array $bindings * @return $this */ public function mergeWheres($wheres, $bindings) { $this->wheres = array_merge($this->wheres, (array) $wheres); $this->bindings['where'] = array_values( array_merge($this->bindings['where'], (array) $bindings) ); return $this; } /** * Add a basic where clause to the query. * * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function where($column, $operator = null, $value = null, $boolean = 'and') { if ($column instanceof ConditionExpression) { $type = 'Expression'; $this->wheres[] = compact('type', 'column', 'boolean'); return $this; } // If the column is an array, we will assume it is an array of key-value pairs // and can add them each as a where clause. We will maintain the boolean we // received when the method was called and pass it into the nested where. if (is_array($column)) { return $this->addArrayOfWheres($column, $boolean); } // Here we will make some assumptions about the operator. If only 2 values are // passed to the method, we will assume that the operator is an equals sign // and keep going. Otherwise, we'll require the operator to be passed in. [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the column is actually a Closure instance, we will assume the developer // wants to begin a nested where statement which is wrapped in parentheses. // We will add that Closure to the query and return back out immediately. if ($column instanceof Closure && is_null($operator)) { return $this->whereNested($column, $boolean); } // If the column is a Closure instance and there is an operator value, we will // assume the developer wants to run a subquery and then compare the result // of that subquery with the given value that was provided to the method. if ($this->isQueryable($column) && ! is_null($operator)) { [$sub, $bindings] = $this->createSub($column); return $this->addBinding($bindings, 'where') ->where(new Expression('('.$sub.')'), $operator, $value, $boolean); } // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } // If the value is a Closure, it means the developer is performing an entire // sub-select within the query and we will need to compile the sub-select // within the where clause to get the appropriate query record results. if ($this->isQueryable($value)) { return $this->whereSub($column, $operator, $value, $boolean); } // If the value is "null", we will just assume the developer wants to add a // where null clause to the query. So, we will allow a short-cut here to // that method for convenience so the developer doesn't have to check. if (is_null($value)) { return $this->whereNull($column, $boolean, ! in_array($operator, ['=', '<=>'], true)); } $type = 'Basic'; $columnString = ($column instanceof ExpressionContract) ? $this->grammar->getValue($column) : $column; // If the column is making a JSON reference we'll check to see if the value // is a boolean. If it is, we'll add the raw boolean string as an actual // value to the query to ensure this is properly handled by the query. if (str_contains($columnString, '->') && is_bool($value)) { $value = new Expression($value ? 'true' : 'false'); if (is_string($column)) { $type = 'JsonBoolean'; } } if ($this->isBitwiseOperator($operator)) { $type = 'Bitwise'; } // Now that we are working with just a simple query we can put the elements // in our array and add the query binding to our array of bindings that // will be bound to each SQL statements when it is finally executed. $this->wheres[] = compact( 'type', 'column', 'operator', 'value', 'boolean' ); if (! $value instanceof ExpressionContract) { $this->addBinding($this->flattenValue($value), 'where'); } return $this; } /** * Add an array of where clauses to the query. * * @param array $column * @param string $boolean * @param string $method * @return $this */ protected function addArrayOfWheres($column, $boolean, $method = 'where') { return $this->whereNested(function ($query) use ($column, $method, $boolean) { foreach ($column as $key => $value) { if (is_numeric($key) && is_array($value)) { $query->{$method}(...array_values($value), boolean: $boolean); } else { $query->{$method}($key, '=', $value, $boolean); } } }, $boolean); } /** * Prepare the value and operator for a where clause. * * @param string $value * @param string $operator * @param bool $useDefault * @return array * * @throws \InvalidArgumentException */ public function prepareValueAndOperator($value, $operator, $useDefault = false) { if ($useDefault) { return [$operator, '=']; } elseif ($this->invalidOperatorAndValue($operator, $value)) { throw new InvalidArgumentException('Illegal operator and value combination.'); } return [$value, $operator]; } /** * Determine if the given operator and value combination is legal. * * Prevents using Null values with invalid operators. * * @param string $operator * @param mixed $value * @return bool */ protected function invalidOperatorAndValue($operator, $value) { return is_null($value) && in_array($operator, $this->operators) && ! in_array($operator, ['=', '<=>', '<>', '!=']); } /** * Determine if the given operator is supported. * * @param string $operator * @return bool */ protected function invalidOperator($operator) { return ! is_string($operator) || (! in_array(strtolower($operator), $this->operators, true) && ! in_array(strtolower($operator), $this->grammar->getOperators(), true)); } /** * Determine if the operator is a bitwise operator. * * @param string $operator * @return bool */ protected function isBitwiseOperator($operator) { return in_array(strtolower($operator), $this->bitwiseOperators, true) || in_array(strtolower($operator), $this->grammar->getBitwiseOperators(), true); } /** * Add an "or where" clause to the query. * * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhere($column, $operator = null, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->where($column, $operator, $value, 'or'); } /** * Add a basic "where not" clause to the query. * * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereNot($column, $operator = null, $value = null, $boolean = 'and') { if (is_array($column)) { return $this->whereNested(function ($query) use ($column, $operator, $value, $boolean) { $query->where($column, $operator, $value, $boolean); }, $boolean.' not'); } return $this->where($column, $operator, $value, $boolean.' not'); } /** * Add an "or where not" clause to the query. * * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereNot($column, $operator = null, $value = null) { return $this->whereNot($column, $operator, $value, 'or'); } /** * Add a "where" clause comparing two columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string|array $first * @param string|null $operator * @param string|null $second * @param string|null $boolean * @return $this */ public function whereColumn($first, $operator = null, $second = null, $boolean = 'and') { // If the column is an array, we will assume it is an array of key-value pairs // and can add them each as a where clause. We will maintain the boolean we // received when the method was called and pass it into the nested where. if (is_array($first)) { return $this->addArrayOfWheres($first, $boolean, 'whereColumn'); } // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$second, $operator] = [$operator, '=']; } // Finally, we will add this where clause into this array of clauses that we // are building for the query. All of them will be compiled via a grammar // once the query is about to be executed and run against the database. $type = 'Column'; $this->wheres[] = compact( 'type', 'first', 'operator', 'second', 'boolean' ); return $this; } /** * Add an "or where" clause comparing two columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string|array $first * @param string|null $operator * @param string|null $second * @return $this */ public function orWhereColumn($first, $operator = null, $second = null) { return $this->whereColumn($first, $operator, $second, 'or'); } /** * Add a raw where clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $sql * @param mixed $bindings * @param string $boolean * @return $this */ public function whereRaw($sql, $bindings = [], $boolean = 'and') { $this->wheres[] = ['type' => 'raw', 'sql' => $sql, 'boolean' => $boolean]; $this->addBinding((array) $bindings, 'where'); return $this; } /** * Add a raw or where clause to the query. * * @param string $sql * @param mixed $bindings * @return $this */ public function orWhereRaw($sql, $bindings = []) { return $this->whereRaw($sql, $bindings, 'or'); } /** * Add a "where like" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean * @param bool $not * @return $this */ public function whereLike($column, $value, $caseSensitive = false, $boolean = 'and', $not = false) { $type = 'Like'; $this->wheres[] = compact('type', 'column', 'value', 'caseSensitive', 'boolean', 'not'); if (method_exists($this->grammar, 'prepareWhereLikeBinding')) { $value = $this->grammar->prepareWhereLikeBinding($value, $caseSensitive); } $this->addBinding($value); return $this; } /** * Add an "or where like" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @return $this */ public function orWhereLike($column, $value, $caseSensitive = false) { return $this->whereLike($column, $value, $caseSensitive, 'or', false); } /** * Add a "where not like" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean * @return $this */ public function whereNotLike($column, $value, $caseSensitive = false, $boolean = 'and') { return $this->whereLike($column, $value, $caseSensitive, $boolean, true); } /** * Add an "or where not like" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @return $this */ public function orWhereNotLike($column, $value, $caseSensitive = false) { return $this->whereNotLike($column, $value, $caseSensitive, 'or'); } /** * Add a "where in" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param mixed $values * @param string $boolean * @param bool $not * @return $this */ public function whereIn($column, $values, $boolean = 'and', $not = false) { $type = $not ? 'NotIn' : 'In'; // If the value is a query builder instance we will assume the developer wants to // look for any values that exist within this given query. So, we will add the // query accordingly so that this query is properly executed when it is run. if ($this->isQueryable($values)) { [$query, $bindings] = $this->createSub($values); $values = [new Expression($query)]; $this->addBinding($bindings, 'where'); } // Next, if the value is Arrayable we need to cast it to its raw array form so we // have the underlying array value instead of an Arrayable object which is not // able to be added as a binding, etc. We will then add to the wheres array. if ($values instanceof Arrayable) { $values = $values->toArray(); } $this->wheres[] = compact('type', 'column', 'values', 'boolean'); if (count($values) !== count(Arr::flatten($values, 1))) { throw new InvalidArgumentException('Nested arrays may not be passed to whereIn method.'); } // Finally, we'll add a binding for each value unless that value is an expression // in which case we will just skip over it since it will be the query as a raw // string and not as a parameterized place-holder to be replaced by the PDO. $this->addBinding($this->cleanBindings($values), 'where'); return $this; } /** * Add an "or where in" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param mixed $values * @return $this */ public function orWhereIn($column, $values) { return $this->whereIn($column, $values, 'or'); } /** * Add a "where not in" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param mixed $values * @param string $boolean * @return $this */ public function whereNotIn($column, $values, $boolean = 'and') { return $this->whereIn($column, $values, $boolean, true); } /** * Add an "or where not in" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param mixed $values * @return $this */ public function orWhereNotIn($column, $values) { return $this->whereNotIn($column, $values, 'or'); } /** * Add a "where in raw" clause for integer values to the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|array $values * @param string $boolean * @param bool $not * @return $this */ public function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false) { $type = $not ? 'NotInRaw' : 'InRaw'; if ($values instanceof Arrayable) { $values = $values->toArray(); } $values = Arr::flatten($values); foreach ($values as &$value) { $value = (int) ($value instanceof BackedEnum ? $value->value : $value); } $this->wheres[] = compact('type', 'column', 'values', 'boolean'); return $this; } /** * Add an "or where in raw" clause for integer values to the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|array $values * @return $this */ public function orWhereIntegerInRaw($column, $values) { return $this->whereIntegerInRaw($column, $values, 'or'); } /** * Add a "where not in raw" clause for integer values to the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|array $values * @param string $boolean * @return $this */ public function whereIntegerNotInRaw($column, $values, $boolean = 'and') { return $this->whereIntegerInRaw($column, $values, $boolean, true); } /** * Add an "or where not in raw" clause for integer values to the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|array $values * @return $this */ public function orWhereIntegerNotInRaw($column, $values) { return $this->whereIntegerNotInRaw($column, $values, 'or'); } /** * Add a "where null" clause to the query. * * @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns * @param string $boolean * @param bool $not * @return $this */ public function whereNull($columns, $boolean = 'and', $not = false) { $type = $not ? 'NotNull' : 'Null'; foreach (Arr::wrap($columns) as $column) { $this->wheres[] = compact('type', 'column', 'boolean'); } return $this; } /** * Add an "or where null" clause to the query. * * @param string|array|\Illuminate\Contracts\Database\Query\Expression $column * @return $this */ public function orWhereNull($column) { return $this->whereNull($column, 'or'); } /** * Add a "where not null" clause to the query. * * @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns * @param string $boolean * @return $this */ public function whereNotNull($columns, $boolean = 'and') { return $this->whereNull($columns, $boolean, true); } /** * Add a where between statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $boolean * @param bool $not * @return $this */ public function whereBetween($column, iterable $values, $boolean = 'and', $not = false) { $type = 'between'; if ($values instanceof CarbonPeriod) { $values = [$values->getStartDate(), $values->getEndDate()]; } $this->wheres[] = compact('type', 'column', 'values', 'boolean', 'not'); $this->addBinding(array_slice($this->cleanBindings(Arr::flatten($values)), 0, 2), 'where'); return $this; } /** * Add a where between statement using columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $boolean * @param bool $not * @return $this */ public function whereBetweenColumns($column, array $values, $boolean = 'and', $not = false) { $type = 'betweenColumns'; $this->wheres[] = compact('type', 'column', 'values', 'boolean', 'not'); return $this; } /** * Add an or where between statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereBetween($column, iterable $values) { return $this->whereBetween($column, $values, 'or'); } /** * Add an or where between statement using columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereBetweenColumns($column, array $values) { return $this->whereBetweenColumns($column, $values, 'or'); } /** * Add a where not between statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $boolean * @return $this */ public function whereNotBetween($column, iterable $values, $boolean = 'and') { return $this->whereBetween($column, $values, $boolean, true); } /** * Add a where not between statement using columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $boolean * @return $this */ public function whereNotBetweenColumns($column, array $values, $boolean = 'and') { return $this->whereBetweenColumns($column, $values, $boolean, true); } /** * Add an or where not between statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereNotBetween($column, iterable $values) { return $this->whereNotBetween($column, $values, 'or'); } /** * Add an or where not between statement using columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereNotBetweenColumns($column, array $values) { return $this->whereNotBetweenColumns($column, $values, 'or'); } /** * Add a where between columns statement using a value to the query. * * @param mixed $value * @param array{\Illuminate\Contracts\Database\Query\Expression|string, \Illuminate\Contracts\Database\Query\Expression|string} $columns * @param string $boolean * @param bool $not * @return $this */ public function whereValueBetween($value, array $columns, $boolean = 'and', $not = false) { $type = 'valueBetween'; $this->wheres[] = compact('type', 'value', 'columns', 'boolean', 'not'); $this->addBinding($value, 'where'); return $this; } /** * Add an or where between columns statement using a value to the query. * * @param mixed $value * @param array{\Illuminate\Contracts\Database\Query\Expression|string, \Illuminate\Contracts\Database\Query\Expression|string} $columns * @return $this */ public function orWhereValueBetween($value, array $columns) { return $this->whereValueBetween($value, $columns, 'or'); } /** * Add a where not between columns statement using a value to the query. * * @param mixed $value * @param array{\Illuminate\Contracts\Database\Query\Expression|string, \Illuminate\Contracts\Database\Query\Expression|string} $columns * @param string $boolean * @return $this */ public function whereValueNotBetween($value, array $columns, $boolean = 'and') { return $this->whereValueBetween($value, $columns, $boolean, true); } /** * Add an or where not between columns statement using a value to the query. * * @param mixed $value * @param array{\Illuminate\Contracts\Database\Query\Expression|string, \Illuminate\Contracts\Database\Query\Expression|string} $columns * @return $this */ public function orWhereValueNotBetween($value, array $columns) { return $this->whereValueNotBetween($value, $columns, 'or'); } /** * Add an "or where not null" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereNotNull($column) { return $this->whereNotNull($column, 'or'); } /** * Add a "where date" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|null $operator * @param \DateTimeInterface|string|null $value * @param string $boolean * @return $this */ public function whereDate($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('Y-m-d'); } return $this->addDateBasedWhere('Date', $column, $operator, $value, $boolean); } /** * Add an "or where date" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|null $operator * @param \DateTimeInterface|string|null $value * @return $this */ public function orWhereDate($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereDate($column, $operator, $value, 'or'); } /** * Add a "where time" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|null $operator * @param \DateTimeInterface|string|null $value * @param string $boolean * @return $this */ public function whereTime($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('H:i:s'); } return $this->addDateBasedWhere('Time', $column, $operator, $value, $boolean); } /** * Add an "or where time" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|null $operator * @param \DateTimeInterface|string|null $value * @return $this */ public function orWhereTime($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereTime($column, $operator, $value, 'or'); } /** * Add a "where day" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @param string $boolean * @return $this */ public function whereDay($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('d'); } if (! $value instanceof ExpressionContract) { $value = sprintf('%02d', $value); } return $this->addDateBasedWhere('Day', $column, $operator, $value, $boolean); } /** * Add an "or where day" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @return $this */ public function orWhereDay($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereDay($column, $operator, $value, 'or'); } /** * Add a "where month" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @param string $boolean * @return $this */ public function whereMonth($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('m'); } if (! $value instanceof ExpressionContract) { $value = sprintf('%02d', $value); } return $this->addDateBasedWhere('Month', $column, $operator, $value, $boolean); } /** * Add an "or where month" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @return $this */ public function orWhereMonth($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereMonth($column, $operator, $value, 'or'); } /** * Add a "where year" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @param string $boolean * @return $this */ public function whereYear($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('Y'); } return $this->addDateBasedWhere('Year', $column, $operator, $value, $boolean); } /** * Add an "or where year" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @return $this */ public function orWhereYear($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereYear($column, $operator, $value, 'or'); } /** * Add a date based (year, month, day, time) statement to the query. * * @param string $type * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $operator * @param mixed $value * @param string $boolean * @return $this */ protected function addDateBasedWhere($type, $column, $operator, $value, $boolean = 'and') { $this->wheres[] = compact('column', 'type', 'boolean', 'operator', 'value'); if (! $value instanceof ExpressionContract) { $this->addBinding($value, 'where'); } return $this; } /** * Add a nested where statement to the query. * * @param string $boolean * @return $this */ public function whereNested(Closure $callback, $boolean = 'and') { $callback($query = $this->forNestedWhere()); return $this->addNestedWhereQuery($query, $boolean); } /** * Create a new query instance for nested where condition. * * @return \Illuminate\Database\Query\Builder */ public function forNestedWhere() { return $this->newQuery()->from($this->from); } /** * Add another query builder as a nested where to the query builder. * * @param \Illuminate\Database\Query\Builder $query * @param string $boolean * @return $this */ public function addNestedWhereQuery($query, $boolean = 'and') { if (count($query->wheres)) { $type = 'Nested'; $this->wheres[] = compact('type', 'query', 'boolean'); $this->addBinding($query->getRawBindings()['where'], 'where'); } return $this; } /** * Add a full sub-select to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $operator * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @param string $boolean * @return $this */ protected function whereSub($column, $operator, $callback, $boolean) { $type = 'Sub'; if ($callback instanceof Closure) { // Once we have the query instance we can simply execute it so it can add all // of the sub-select's conditions to itself, and then we can cache it off // in the array of where clauses for the "main" parent query instance. $callback($query = $this->forSubQuery()); } else { $query = $callback instanceof EloquentBuilder ? $callback->toBase() : $callback; } $this->wheres[] = compact( 'type', 'column', 'operator', 'query', 'boolean' ); $this->addBinding($query->getBindings(), 'where'); return $this; } /** * Add an exists clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @param string $boolean * @param bool $not * @return $this */ public function whereExists($callback, $boolean = 'and', $not = false) { if ($callback instanceof Closure) { $query = $this->forSubQuery(); // Similar to the sub-select clause, we will create a new query instance so // the developer may cleanly specify the entire exists query and we will // compile the whole thing in the grammar and insert it into the SQL. $callback($query); } else { $query = $callback instanceof EloquentBuilder ? $callback->toBase() : $callback; } return $this->addWhereExistsQuery($query, $boolean, $not); } /** * Add an or exists clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @param bool $not * @return $this */ public function orWhereExists($callback, $not = false) { return $this->whereExists($callback, 'or', $not); } /** * Add a where not exists clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @param string $boolean * @return $this */ public function whereNotExists($callback, $boolean = 'and') { return $this->whereExists($callback, $boolean, true); } /** * Add a where not exists clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @return $this */ public function orWhereNotExists($callback) { return $this->orWhereExists($callback, true); } /** * Add an exists clause to the query. * * @param string $boolean * @param bool $not * @return $this */ public function addWhereExistsQuery(self $query, $boolean = 'and', $not = false) { $type = $not ? 'NotExists' : 'Exists'; $this->wheres[] = compact('type', 'query', 'boolean'); $this->addBinding($query->getBindings(), 'where'); return $this; } /** * Adds a where condition using row values. * * @param array $columns * @param string $operator * @param array $values * @param string $boolean * @return $this * * @throws \InvalidArgumentException */ public function whereRowValues($columns, $operator, $values, $boolean = 'and') { if (count($columns) !== count($values)) { throw new InvalidArgumentException('The number of columns must match the number of values'); } $type = 'RowValues'; $this->wheres[] = compact('type', 'columns', 'operator', 'values', 'boolean'); $this->addBinding($this->cleanBindings($values)); return $this; } /** * Adds an or where condition using row values. * * @param array $columns * @param string $operator * @param array $values * @return $this */ public function orWhereRowValues($columns, $operator, $values) { return $this->whereRowValues($columns, $operator, $values, 'or'); } /** * Add a "where JSON contains" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @param bool $not * @return $this */ public function whereJsonContains($column, $value, $boolean = 'and', $not = false) { $type = 'JsonContains'; $this->wheres[] = compact('type', 'column', 'value', 'boolean', 'not'); if (! $value instanceof ExpressionContract) { $this->addBinding($this->grammar->prepareBindingForJsonContains($value)); } return $this; } /** * Add an "or where JSON contains" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonContains($column, $value) { return $this->whereJsonContains($column, $value, 'or'); } /** * Add a "where JSON not contains" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @return $this */ public function whereJsonDoesntContain($column, $value, $boolean = 'and') { return $this->whereJsonContains($column, $value, $boolean, true); } /** * Add an "or where JSON not contains" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonDoesntContain($column, $value) { return $this->whereJsonDoesntContain($column, $value, 'or'); } /** * Add a "where JSON overlaps" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @param bool $not * @return $this */ public function whereJsonOverlaps($column, $value, $boolean = 'and', $not = false) { $type = 'JsonOverlaps'; $this->wheres[] = compact('type', 'column', 'value', 'boolean', 'not'); if (! $value instanceof ExpressionContract) { $this->addBinding($this->grammar->prepareBindingForJsonContains($value)); } return $this; } /** * Add an "or where JSON overlaps" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonOverlaps($column, $value) { return $this->whereJsonOverlaps($column, $value, 'or'); } /** * Add a "where JSON not overlap" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @return $this */ public function whereJsonDoesntOverlap($column, $value, $boolean = 'and') { return $this->whereJsonOverlaps($column, $value, $boolean, true); } /** * Add an "or where JSON not overlap" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonDoesntOverlap($column, $value) { return $this->whereJsonDoesntOverlap($column, $value, 'or'); } /** * Add a clause that determines if a JSON path exists to the query. * * @param string $column * @param string $boolean * @param bool $not * @return $this */ public function whereJsonContainsKey($column, $boolean = 'and', $not = false) { $type = 'JsonContainsKey'; $this->wheres[] = compact('type', 'column', 'boolean', 'not'); return $this; } /** * Add an "or" clause that determines if a JSON path exists to the query. * * @param string $column * @return $this */ public function orWhereJsonContainsKey($column) { return $this->whereJsonContainsKey($column, 'or'); } /** * Add a clause that determines if a JSON path does not exist to the query. * * @param string $column * @param string $boolean * @return $this */ public function whereJsonDoesntContainKey($column, $boolean = 'and') { return $this->whereJsonContainsKey($column, $boolean, true); } /** * Add an "or" clause that determines if a JSON path does not exist to the query. * * @param string $column * @return $this */ public function orWhereJsonDoesntContainKey($column) { return $this->whereJsonDoesntContainKey($column, 'or'); } /** * Add a "where JSON length" clause to the query. * * @param string $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereJsonLength($column, $operator, $value = null, $boolean = 'and') { $type = 'JsonLength'; [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $this->wheres[] = compact('type', 'column', 'operator', 'value', 'boolean'); if (! $value instanceof ExpressionContract) { $this->addBinding((int) $this->flattenValue($value)); } return $this; } /** * Add an "or where JSON length" clause to the query. * * @param string $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereJsonLength($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereJsonLength($column, $operator, $value, 'or'); } /** * Handles dynamic "where" clauses to the query. * * @param string $method * @param array $parameters * @return $this */ public function dynamicWhere($method, $parameters) { $finder = substr($method, 5); $segments = preg_split( '/(And|Or)(?=[A-Z])/', $finder, -1, PREG_SPLIT_DELIM_CAPTURE ); // The connector variable will determine which connector will be used for the // query condition. We will change it as we come across new boolean values // in the dynamic method strings, which could contain a number of these. $connector = 'and'; $index = 0; foreach ($segments as $segment) { // If the segment is not a boolean connector, we can assume it is a column's name // and we will add it to the query as a new constraint as a where clause, then // we can keep iterating through the dynamic method string's segments again. if ($segment !== 'And' && $segment !== 'Or') { $this->addDynamic($segment, $connector, $parameters, $index); $index++; } // Otherwise, we will store the connector so we know how the next where clause we // find in the query should be connected to the previous ones, meaning we will // have the proper boolean connector to connect the next where clause found. else { $connector = $segment; } } return $this; } /** * Add a single dynamic where clause statement to the query. * * @param string $segment * @param string $connector * @param array $parameters * @param int $index * @return void */ protected function addDynamic($segment, $connector, $parameters, $index) { // Once we have parsed out the columns and formatted the boolean operators we // are ready to add it to this query as a where clause just like any other // clause on the query. Then we'll increment the parameter index values. $bool = strtolower($connector); $this->where(Str::snake($segment), '=', $parameters[$index], $bool); } /** * Add a "where fulltext" clause to the query. * * @param string|string[] $columns * @param string $value * @param string $boolean * @return $this */ public function whereFullText($columns, $value, array $options = [], $boolean = 'and') { $type = 'Fulltext'; $columns = (array) $columns; $this->wheres[] = compact('type', 'columns', 'value', 'options', 'boolean'); $this->addBinding($value); return $this; } /** * Add a "or where fulltext" clause to the query. * * @param string|string[] $columns * @param string $value * @return $this */ public function orWhereFullText($columns, $value, array $options = []) { return $this->whereFullText($columns, $value, $options, 'or'); } /** * Add a "where" clause to the query for multiple columns with "and" conditions between them. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereAll($columns, $operator = null, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); $this->whereNested(function ($query) use ($columns, $operator, $value) { foreach ($columns as $column) { $query->where($column, $operator, $value, 'and'); } }, $boolean); return $this; } /** * Add an "or where" clause to the query for multiple columns with "and" conditions between them. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereAll($columns, $operator = null, $value = null) { return $this->whereAll($columns, $operator, $value, 'or'); } /** * Add a "where" clause to the query for multiple columns with "or" conditions between them. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereAny($columns, $operator = null, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); $this->whereNested(function ($query) use ($columns, $operator, $value) { foreach ($columns as $column) { $query->where($column, $operator, $value, 'or'); } }, $boolean); return $this; } /** * Add an "or where" clause to the query for multiple columns with "or" conditions between them. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereAny($columns, $operator = null, $value = null) { return $this->whereAny($columns, $operator, $value, 'or'); } /** * Add a "where not" clause to the query for multiple columns where none of the conditions should be true. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereNone($columns, $operator = null, $value = null, $boolean = 'and') { return $this->whereAny($columns, $operator, $value, $boolean.' not'); } /** * Add an "or where not" clause to the query for multiple columns where none of the conditions should be true. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereNone($columns, $operator = null, $value = null) { return $this->whereNone($columns, $operator, $value, 'or'); } /** * Add a "group by" clause to the query. * * @param array|\Illuminate\Contracts\Database\Query\Expression|string ...$groups * @return $this */ public function groupBy(...$groups) { foreach ($groups as $group) { $this->groups = array_merge( (array) $this->groups, Arr::wrap($group) ); } return $this; } /** * Add a raw groupBy clause to the query. * * @param string $sql * @return $this */ public function groupByRaw($sql, array $bindings = []) { $this->groups[] = new Expression($sql); $this->addBinding($bindings, 'groupBy'); return $this; } /** * Add a "having" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|\Closure|string $column * @param \DateTimeInterface|string|int|float|null $operator * @param \Illuminate\Contracts\Database\Query\Expression|\DateTimeInterface|string|int|float|null $value * @param string $boolean * @return $this */ public function having($column, $operator = null, $value = null, $boolean = 'and') { $type = 'Basic'; if ($column instanceof ConditionExpression) { $type = 'Expression'; $this->havings[] = compact('type', 'column', 'boolean'); return $this; } // Here we will make some assumptions about the operator. If only 2 values are // passed to the method, we will assume that the operator is an equals sign // and keep going. Otherwise, we'll require the operator to be passed in. [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); if ($column instanceof Closure && is_null($operator)) { return $this->havingNested($column, $boolean); } // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } if ($this->isBitwiseOperator($operator)) { $type = 'Bitwise'; } $this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean'); if (! $value instanceof ExpressionContract) { $this->addBinding($this->flattenValue($value), 'having'); } return $this; } /** * Add an "or having" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|\Closure|string $column * @param \DateTimeInterface|string|int|float|null $operator * @param \Illuminate\Contracts\Database\Query\Expression|\DateTimeInterface|string|int|float|null $value * @return $this */ public function orHaving($column, $operator = null, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->having($column, $operator, $value, 'or'); } /** * Add a nested having statement to the query. * * @param string $boolean * @return $this */ public function havingNested(Closure $callback, $boolean = 'and') { $callback($query = $this->forNestedWhere()); return $this->addNestedHavingQuery($query, $boolean); } /** * Add another query builder as a nested having to the query builder. * * @param \Illuminate\Database\Query\Builder $query * @param string $boolean * @return $this */ public function addNestedHavingQuery($query, $boolean = 'and') { if (count($query->havings)) { $type = 'Nested'; $this->havings[] = compact('type', 'query', 'boolean'); $this->addBinding($query->getRawBindings()['having'], 'having'); } return $this; } /** * Add a "having null" clause to the query. * * @param array|string $columns * @param string $boolean * @param bool $not * @return $this */ public function havingNull($columns, $boolean = 'and', $not = false) { $type = $not ? 'NotNull' : 'Null'; foreach (Arr::wrap($columns) as $column) { $this->havings[] = compact('type', 'column', 'boolean'); } return $this; } /** * Add an "or having null" clause to the query. * * @param string $column * @return $this */ public function orHavingNull($column) { return $this->havingNull($column, 'or'); } /** * Add a "having not null" clause to the query. * * @param array|string $columns * @param string $boolean * @return $this */ public function havingNotNull($columns, $boolean = 'and') { return $this->havingNull($columns, $boolean, true); } /** * Add an "or having not null" clause to the query. * * @param string $column * @return $this */ public function orHavingNotNull($column) { return $this->havingNotNull($column, 'or'); } /** * Add a "having between " clause to the query. * * @param string $column * @param string $boolean * @param bool $not * @return $this */ public function havingBetween($column, iterable $values, $boolean = 'and', $not = false) { $type = 'between'; if ($values instanceof CarbonPeriod) { $values = [$values->getStartDate(), $values->getEndDate()]; } $this->havings[] = compact('type', 'column', 'values', 'boolean', 'not'); $this->addBinding(array_slice($this->cleanBindings(Arr::flatten($values)), 0, 2), 'having'); return $this; } /** * Add a raw having clause to the query. * * @param string $sql * @param string $boolean * @return $this */ public function havingRaw($sql, array $bindings = [], $boolean = 'and') { $type = 'Raw'; $this->havings[] = compact('type', 'sql', 'boolean'); $this->addBinding($bindings, 'having'); return $this; } /** * Add a raw or having clause to the query. * * @param string $sql * @return $this */ public function orHavingRaw($sql, array $bindings = []) { return $this->havingRaw($sql, $bindings, 'or'); } /** * Add an "order by" clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|\Illuminate\Contracts\Database\Query\Expression|string $column * @param string $direction * @return $this * * @throws \InvalidArgumentException */ public function orderBy($column, $direction = 'asc') { if ($this->isQueryable($column)) { [$query, $bindings] = $this->createSub($column); $column = new Expression('('.$query.')'); $this->addBinding($bindings, $this->unions ? 'unionOrder' : 'order'); } $direction = strtolower($direction); if (! in_array($direction, ['asc', 'desc'], true)) { throw new InvalidArgumentException('Order direction must be "asc" or "desc".'); } $this->{$this->unions ? 'unionOrders' : 'orders'}[] = [ 'column' => $column, 'direction' => $direction, ]; return $this; } /** * Add a descending "order by" clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|\Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orderByDesc($column) { return $this->orderBy($column, 'desc'); } /** * Add an "order by" clause for a timestamp to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function latest($column = 'created_at') { return $this->orderBy($column, 'desc'); } /** * Add an "order by" clause for a timestamp to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function oldest($column = 'created_at') { return $this->orderBy($column, 'asc'); } /** * Put the query's results in random order. * * @param string|int $seed * @return $this */ public function inRandomOrder($seed = '') { return $this->orderByRaw($this->grammar->compileRandom($seed)); } /** * Add a raw "order by" clause to the query. * * @param string $sql * @param array $bindings * @return $this */ public function orderByRaw($sql, $bindings = []) { $type = 'Raw'; $this->{$this->unions ? 'unionOrders' : 'orders'}[] = compact('type', 'sql'); $this->addBinding($bindings, $this->unions ? 'unionOrder' : 'order'); return $this; } /** * Alias to set the "offset" value of the query. * * @param int $value * @return $this */ public function skip($value) { return $this->offset($value); } /** * Set the "offset" value of the query. * * @param int $value * @return $this */ public function offset($value) { $property = $this->unions ? 'unionOffset' : 'offset'; $this->$property = max(0, (int) $value); return $this; } /** * Alias to set the "limit" value of the query. * * @param int $value * @return $this */ public function take($value) { return $this->limit($value); } /** * Set the "limit" value of the query. * * @param int $value * @return $this */ public function limit($value) { $property = $this->unions ? 'unionLimit' : 'limit'; if ($value >= 0) { $this->$property = ! is_null($value) ? (int) $value : null; } return $this; } /** * Add a "group limit" clause to the query. * * @param int $value * @param string $column * @return $this */ public function groupLimit($value, $column) { if ($value >= 0) { $this->groupLimit = compact('value', 'column'); } return $this; } /** * Set the limit and offset for a given page. * * @param int $page * @param int $perPage * @return $this */ public function forPage($page, $perPage = 15) { return $this->offset(($page - 1) * $perPage)->limit($perPage); } /** * Constrain the query to the previous "page" of results before a given ID. * * @param int $perPage * @param int|null $lastId * @param string $column * @return $this */ public function forPageBeforeId($perPage = 15, $lastId = 0, $column = 'id') { $this->orders = $this->removeExistingOrdersFor($column); if (is_null($lastId)) { $this->whereNotNull($column); } else { $this->where($column, '<', $lastId); } return $this->orderBy($column, 'desc') ->limit($perPage); } /** * Constrain the query to the next "page" of results after a given ID. * * @param int $perPage * @param int|null $lastId * @param string $column * @return $this */ public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') { $this->orders = $this->removeExistingOrdersFor($column); if (is_null($lastId)) { $this->whereNotNull($column); } else { $this->where($column, '>', $lastId); } return $this->orderBy($column, 'asc') ->limit($perPage); } /** * Remove all existing orders and optionally add a new order. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string|null $column * @param string $direction * @return $this */ public function reorder($column = null, $direction = 'asc') { $this->orders = null; $this->unionOrders = null; $this->bindings['order'] = []; $this->bindings['unionOrder'] = []; if ($column) { return $this->orderBy($column, $direction); } return $this; } /** * Add descending "reorder" clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string|null $column * @return $this */ public function reorderDesc($column) { return $this->reorder($column, 'desc'); } /** * Get an array with all orders with a given column removed. * * @param string $column * @return array */ protected function removeExistingOrdersFor($column) { return (new Collection($this->orders)) ->reject(fn ($order) => isset($order['column']) && $order['column'] === $column) ->values() ->all(); } /** * Add a union statement to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $query * @param bool $all * @return $this */ public function union($query, $all = false) { if ($query instanceof Closure) { $query($query = $this->newQuery()); } $this->unions[] = compact('query', 'all'); $this->addBinding($query->getBindings(), 'union'); return $this; } /** * Add a union all statement to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $query * @return $this */ public function unionAll($query) { return $this->union($query, true); } /** * Lock the selected rows in the table. * * @param string|bool $value * @return $this */ public function lock($value = true) { $this->lock = $value; if (! is_null($this->lock)) { $this->useWritePdo(); } return $this; } /** * Lock the selected rows in the table for updating. * * @return $this */ public function lockForUpdate() { return $this->lock(true); } /** * Share lock the selected rows in the table. * * @return $this */ public function sharedLock() { return $this->lock(false); } /** * Register a closure to be invoked before the query is executed. * * @return $this */ public function beforeQuery(callable $callback) { $this->beforeQueryCallbacks[] = $callback; return $this; } /** * Invoke the "before query" modification callbacks. * * @return void */ public function applyBeforeQueryCallbacks() { foreach ($this->beforeQueryCallbacks as $callback) { $callback($this); } $this->beforeQueryCallbacks = []; } /** * Register a closure to be invoked after the query is executed. * * @return $this */ public function afterQuery(Closure $callback) { $this->afterQueryCallbacks[] = $callback; return $this; } /** * Invoke the "after query" modification callbacks. * * @param mixed $result * @return mixed */ public function applyAfterQueryCallbacks($result) { foreach ($this->afterQueryCallbacks as $afterQueryCallback) { $result = $afterQueryCallback($result) ?: $result; } return $result; } /** * Get the SQL representation of the query. * * @return string */ public function toSql() { $this->applyBeforeQueryCallbacks(); return $this->grammar->compileSelect($this); } /** * Get the raw SQL representation of the query with embedded bindings. * * @return string */ public function toRawSql() { return $this->grammar->substituteBindingsIntoRawSql( $this->toSql(), $this->connection->prepareBindings($this->getBindings()) ); } /** * Execute a query for a single record by ID. * * @param int|string $id * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @return object|null */ public function find($id, $columns = ['*']) { return $this->where('id', '=', $id)->first($columns); } /** * Execute a query for a single record by ID or call a callback. * * @template TValue * * @param mixed $id * @param (\Closure(): TValue)|string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @param (\Closure(): TValue)|null $callback * @return object|TValue */ public function findOr($id, $columns = ['*'], ?Closure $callback = null) { if ($columns instanceof Closure) { $callback = $columns; $columns = ['*']; } if (! is_null($data = $this->find($id, $columns))) { return $data; } return $callback(); } /** * Get a single column's value from the first result of a query. * * @param string $column * @return mixed */ public function value($column) { $result = (array) $this->first([$column]); return count($result) > 0 ? array_first($result) : null; } /** * Get a single expression value from the first result of a query. * * @return mixed */ public function rawValue(string $expression, array $bindings = []) { $result = (array) $this->selectRaw($expression, $bindings)->first(); return count($result) > 0 ? array_first($result) : null; } /** * Get a single column's value from the first result of a query if it's the sole matching record. * * @param string $column * @return mixed * * @throws \Illuminate\Database\RecordsNotFoundException * @throws \Illuminate\Database\MultipleRecordsFoundException */ public function soleValue($column) { $result = (array) $this->sole([$column]); return array_first($result); } /** * Execute the query as a "select" statement. * * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @return \Illuminate\Support\Collection */ public function get($columns = ['*']) { $items = new Collection($this->onceWithColumns(Arr::wrap($columns), function () { return $this->processor->processSelect($this, $this->runSelect()); })); return $this->applyAfterQueryCallbacks( isset($this->groupLimit) ? $this->withoutGroupLimitKeys($items) : $items ); } /** * Run the query as a "select" statement against the connection. * * @return array */ protected function runSelect() { return $this->connection->select( $this->toSql(), $this->getBindings(), ! $this->useWritePdo ); } /** * Remove the group limit keys from the results in the collection. * * @param \Illuminate\Support\Collection $items * @return \Illuminate\Support\Collection */ protected function withoutGroupLimitKeys($items) { $keysToRemove = ['laravel_row']; if (is_string($this->groupLimit['column'])) { $column = last(explode('.', $this->groupLimit['column'])); $keysToRemove[] = '@laravel_group := '.$this->grammar->wrap($column); $keysToRemove[] = '@laravel_group := '.$this->grammar->wrap('pivot_'.$column); } $items->each(function ($item) use ($keysToRemove) { foreach ($keysToRemove as $key) { unset($item->$key); } }); return $items; } /** * Paginate the given query into a simple paginator. * * @param int|\Closure $perPage * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @param string $pageName * @param int|null $page * @param \Closure|int|null $total * @return \Illuminate\Pagination\LengthAwarePaginator */ public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null, $total = null) { $page = $page ?: Paginator::resolveCurrentPage($pageName); $total = value($total) ?? $this->getCountForPagination(); $perPage = value($perPage, $total); $results = $total ? $this->forPage($page, $perPage)->get($columns) : new Collection; return $this->paginator($results, $total, $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ]); } /** * Get a paginator only supporting simple next and previous links. * * This is more efficient on larger data-sets, etc. * * @param int $perPage * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @param string $pageName * @param int|null $page * @return \Illuminate\Contracts\Pagination\Paginator */ public function simplePaginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null) { $page = $page ?: Paginator::resolveCurrentPage($pageName); $this->offset(($page - 1) * $perPage)->limit($perPage + 1); return $this->simplePaginator($this->get($columns), $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ]); } /** * Get a paginator only supporting simple next and previous links. * * This is more efficient on larger data-sets, etc. * * @param int|null $perPage * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @param string $cursorName * @param \Illuminate\Pagination\Cursor|string|null $cursor * @return \Illuminate\Contracts\Pagination\CursorPaginator */ public function cursorPaginate($perPage = 15, $columns = ['*'], $cursorName = 'cursor', $cursor = null) { return $this->paginateUsingCursor($perPage, $columns, $cursorName, $cursor); } /** * Ensure the proper order by required for cursor pagination. * * @param bool $shouldReverse * @return \Illuminate\Support\Collection */ protected function ensureOrderForCursorPagination($shouldReverse = false) { if (empty($this->orders) && empty($this->unionOrders)) { $this->enforceOrderBy(); } $reverseDirection = function ($order) { if (! isset($order['direction'])) { return $order; } $order['direction'] = $order['direction'] === 'asc' ? 'desc' : 'asc'; return $order; }; if ($shouldReverse) { $this->orders = (new Collection($this->orders))->map($reverseDirection)->toArray(); $this->unionOrders = (new Collection($this->unionOrders))->map($reverseDirection)->toArray(); } $orders = ! empty($this->unionOrders) ? $this->unionOrders : $this->orders; return (new Collection($orders)) ->filter(fn ($order) => Arr::has($order, 'direction')) ->values(); } /** * Get the count of the total records for the paginator. * * @param array $columns * @return int<0, max> */ public function getCountForPagination($columns = ['*']) { $results = $this->runPaginationCountQuery($columns); // Once we have run the pagination count query, we will get the resulting count and // take into account what type of query it was. When there is a group by we will // just return the count of the entire results set since that will be correct. if (! isset($results[0])) { return 0; } elseif (is_object($results[0])) { return (int) $results[0]->aggregate; } return (int) array_change_key_case((array) $results[0])['aggregate']; } /** * Run a pagination count query. * * @param array $columns * @return array */ protected function runPaginationCountQuery($columns = ['*']) { if ($this->groups || $this->havings) { $clone = $this->cloneForPaginationCount(); if (is_null($clone->columns) && ! empty($this->joins)) { $clone->select($this->from.'.*'); } return $this->newQuery() ->from(new Expression('('.$clone->toSql().') as '.$this->grammar->wrap('aggregate_table'))) ->mergeBindings($clone) ->setAggregate('count', $this->withoutSelectAliases($columns)) ->get()->all(); } $without = $this->unions ? ['unionOrders', 'unionLimit', 'unionOffset'] : ['columns', 'orders', 'limit', 'offset']; return $this->cloneWithout($without) ->cloneWithoutBindings($this->unions ? ['unionOrder'] : ['select', 'order']) ->setAggregate('count', $this->withoutSelectAliases($columns)) ->get()->all(); } /** * Clone the existing query instance for usage in a pagination subquery. * * @return self */ protected function cloneForPaginationCount() { return $this->cloneWithout(['orders', 'limit', 'offset']) ->cloneWithoutBindings(['order']); } /** * Remove the column aliases since they will break count queries. * * @param array $columns * @return array */ protected function withoutSelectAliases(array $columns) { return array_map(function ($column) { return is_string($column) && ($aliasPosition = stripos($column, ' as ')) !== false ? substr($column, 0, $aliasPosition) : $column; }, $columns); } /** * Get a lazy collection for the given query. * * @return \Illuminate\Support\LazyCollection */ public function cursor() { if (is_null($this->columns)) { $this->columns = ['*']; } return (new LazyCollection(function () { yield from $this->connection->cursor( $this->toSql(), $this->getBindings(), ! $this->useWritePdo ); }))->map(function ($item) { return $this->applyAfterQueryCallbacks(new Collection([$item]))->first(); })->reject(fn ($item) => is_null($item)); } /** * Throw an exception if the query doesn't have an orderBy clause. * * @return void * * @throws \RuntimeException */ protected function enforceOrderBy() { if (empty($this->orders) && empty($this->unionOrders)) { throw new RuntimeException('You must specify an orderBy clause when using this function.'); } } /** * Get a collection instance containing the values of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string|null $key * @return \Illuminate\Support\Collection */ public function pluck($column, $key = null) { // First, we will need to select the results of the query accounting for the // given columns / key. Once we have the results, we will be able to take // the results and get the exact data that was requested for the query. $queryResult = $this->onceWithColumns( is_null($key) || $key === $column ? [$column] : [$column, $key], function () { return $this->processor->processSelect( $this, $this->runSelect() ); } ); if (empty($queryResult)) { return new Collection; } // If the columns are qualified with a table or have an alias, we cannot use // those directly in the "pluck" operations since the results from the DB // are only keyed by the column itself. We'll strip the table out here. $column = $this->stripTableForPluck($column); $key = $this->stripTableForPluck($key); return $this->applyAfterQueryCallbacks( is_array($queryResult[0]) ? $this->pluckFromArrayColumn($queryResult, $column, $key) : $this->pluckFromObjectColumn($queryResult, $column, $key) ); } /** * Strip off the table name or alias from a column identifier. * * @param string $column * @return string|null */ protected function stripTableForPluck($column) { if (is_null($column)) { return $column; } $columnString = $column instanceof ExpressionContract ? $this->grammar->getValue($column) : $column; $separator = str_contains(strtolower($columnString), ' as ') ? ' as ' : '\.'; return last(preg_split('~'.$separator.'~i', $columnString)); } /** * Retrieve column values from rows represented as objects. * * @param array $queryResult * @param string $column * @param string $key * @return \Illuminate\Support\Collection */ protected function pluckFromObjectColumn($queryResult, $column, $key) { $results = []; if (is_null($key)) { foreach ($queryResult as $row) { $results[] = $row->$column; } } else { foreach ($queryResult as $row) { $results[$row->$key] = $row->$column; } } return new Collection($results); } /** * Retrieve column values from rows represented as arrays. * * @param array $queryResult * @param string $column * @param string $key * @return \Illuminate\Support\Collection */ protected function pluckFromArrayColumn($queryResult, $column, $key) { $results = []; if (is_null($key)) { foreach ($queryResult as $row) { $results[] = $row[$column]; } } else { foreach ($queryResult as $row) { $results[$row[$key]] = $row[$column]; } } return new Collection($results); } /** * Concatenate values of a given column as a string. * * @param string $column * @param string $glue * @return string */ public function implode($column, $glue = '') { return $this->pluck($column)->implode($glue); } /** * Determine if any rows exist for the current query. * * @return bool */ public function exists() { $this->applyBeforeQueryCallbacks(); $results = $this->connection->select( $this->grammar->compileExists($this), $this->getBindings(), ! $this->useWritePdo ); // If the results have rows, we will get the row and see if the exists column is a // boolean true. If there are no results for this query we will return false as // there are no rows for this query at all, and we can return that info here. if (isset($results[0])) { $results = (array) $results[0]; return (bool) $results['exists']; } return false; } /** * Determine if no rows exist for the current query. * * @return bool */ public function doesntExist() { return ! $this->exists(); } /** * Execute the given callback if no rows exist for the current query. * * @return mixed */ public function existsOr(Closure $callback) { return $this->exists() ? true : $callback(); } /** * Execute the given callback if rows exist for the current query. * * @return mixed */ public function doesntExistOr(Closure $callback) { return $this->doesntExist() ? true : $callback(); } /** * Retrieve the "count" result of the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $columns * @return int<0, max> */ public function count($columns = '*') { return (int) $this->aggregate(__FUNCTION__, Arr::wrap($columns)); } /** * Retrieve the minimum value of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function min($column) { return $this->aggregate(__FUNCTION__, [$column]); } /** * Retrieve the maximum value of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function max($column) { return $this->aggregate(__FUNCTION__, [$column]); } /** * Retrieve the sum of the values of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function sum($column) { $result = $this->aggregate(__FUNCTION__, [$column]); return $result ?: 0; } /** * Retrieve the average of the values of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function avg($column) { return $this->aggregate(__FUNCTION__, [$column]); } /** * Alias for the "avg" method. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function average($column) { return $this->avg($column); } /** * Execute an aggregate function on the database. * * @param string $function * @param array $columns * @return mixed */ public function aggregate($function, $columns = ['*']) { $results = $this->cloneWithout($this->unions || $this->havings ? [] : ['columns']) ->cloneWithoutBindings($this->unions || $this->havings ? [] : ['select']) ->setAggregate($function, $columns) ->get($columns); if (! $results->isEmpty()) { return array_change_key_case((array) $results[0])['aggregate']; } } /** * Execute a numeric aggregate function on the database. * * @param string $function * @param array $columns * @return float|int */ public function numericAggregate($function, $columns = ['*']) { $result = $this->aggregate($function, $columns); // If there is no result, we can obviously just return 0 here. Next, we will check // if the result is an integer or float. If it is already one of these two data // types we can just return the result as-is, otherwise we will convert this. if (! $result) { return 0; } if (is_int($result) || is_float($result)) { return $result; } // If the result doesn't contain a decimal place, we will assume it is an int then // cast it to one. When it does we will cast it to a float since it needs to be // cast to the expected data type for the developers out of pure convenience. return ! str_contains((string) $result, '.') ? (int) $result : (float) $result; } /** * Set the aggregate property without running the query. * * @param string $function * @param array<\Illuminate\Contracts\Database\Query\Expression|string> $columns * @return $this */ protected function setAggregate($function, $columns) { $this->aggregate = compact('function', 'columns'); if (empty($this->groups)) { $this->orders = null; $this->bindings['order'] = []; } return $this; } /** * Execute the given callback while selecting the given columns. * * After running the callback, the columns are reset to the original value. * * @template TResult * * @param array $columns * @param callable(): TResult $callback * @return TResult */ protected function onceWithColumns($columns, $callback) { $original = $this->columns; if (is_null($original)) { $this->columns = $columns; } $result = $callback(); $this->columns = $original; return $result; } /** * Insert new records into the database. * * @return bool */ public function insert(array $values) { // Since every insert gets treated like a batch insert, we will make sure the // bindings are structured in a way that is convenient when building these // inserts statements by verifying these elements are actually an array. if (empty($values)) { return true; } if (! is_array(array_first($values))) { $values = [$values]; } // Here, we will sort the insert keys for every record so that each insert is // in the same order for the record. We need to make sure this is the case // so there are not any errors or problems when inserting these records. else { foreach ($values as $key => $value) { ksort($value); $values[$key] = $value; } } $this->applyBeforeQueryCallbacks(); // Finally, we will run this query against the database connection and return // the results. We will need to also flatten these bindings before running // the query so they are all in one huge, flattened array for execution. return $this->connection->insert( $this->grammar->compileInsert($this, $values), $this->cleanBindings(Arr::flatten($values, 1)) ); } /** * Insert new records into the database while ignoring errors. * * @return int<0, max> */ public function insertOrIgnore(array $values) { if (empty($values)) { return 0; } if (! is_array(array_first($values))) { $values = [$values]; } else { foreach ($values as $key => $value) { ksort($value); $values[$key] = $value; } } $this->applyBeforeQueryCallbacks(); return $this->connection->affectingStatement( $this->grammar->compileInsertOrIgnore($this, $values), $this->cleanBindings(Arr::flatten($values, 1)) ); } /** * Insert a new record and get the value of the primary key. * * @param string|null $sequence * @return int */ public function insertGetId(array $values, $sequence = null) { $this->applyBeforeQueryCallbacks(); $sql = $this->grammar->compileInsertGetId($this, $values, $sequence); $values = $this->cleanBindings($values); return $this->processor->processInsertGetId($this, $sql, $values, $sequence); } /** * Insert new records into the table using a subquery. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|string $query * @return int */ public function insertUsing(array $columns, $query) { $this->applyBeforeQueryCallbacks(); [$sql, $bindings] = $this->createSub($query); return $this->connection->affectingStatement( $this->grammar->compileInsertUsing($this, $columns, $sql), $this->cleanBindings($bindings) ); } /** * Insert new records into the table using a subquery while ignoring errors. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|string $query * @return int */ public function insertOrIgnoreUsing(array $columns, $query) { $this->applyBeforeQueryCallbacks(); [$sql, $bindings] = $this->createSub($query); return $this->connection->affectingStatement( $this->grammar->compileInsertOrIgnoreUsing($this, $columns, $sql), $this->cleanBindings($bindings) ); } /** * Update records in the database. * * @return int<0, max> */ public function update(array $values) { $this->applyBeforeQueryCallbacks(); $values = (new Collection($values))->map(function ($value) { if (! $value instanceof Builder) { return ['value' => $value, 'bindings' => match (true) { $value instanceof Collection => $value->all(), $value instanceof UnitEnum => enum_value($value), default => $value, }]; } [$query, $bindings] = $this->parseSub($value); return ['value' => new Expression("({$query})"), 'bindings' => fn () => $bindings]; }); $sql = $this->grammar->compileUpdate($this, $values->map(fn ($value) => $value['value'])->all()); return $this->connection->update($sql, $this->cleanBindings( $this->grammar->prepareBindingsForUpdate($this->bindings, $values->map(fn ($value) => $value['bindings'])->all()) )); } /** * Update records in a PostgreSQL database using the update from syntax. * * @return int */ public function updateFrom(array $values) { if (! method_exists($this->grammar, 'compileUpdateFrom')) { throw new LogicException('This database engine does not support the updateFrom method.'); } $this->applyBeforeQueryCallbacks(); $sql = $this->grammar->compileUpdateFrom($this, $values); return $this->connection->update($sql, $this->cleanBindings( $this->grammar->prepareBindingsForUpdateFrom($this->bindings, $values) )); } /** * Insert or update a record matching the attributes, and fill it with values. * * @return bool */ public function updateOrInsert(array $attributes, array|callable $values = []) { $exists = $this->where($attributes)->exists(); if ($values instanceof Closure) { $values = $values($exists); } if (! $exists) { return $this->insert(array_merge($attributes, $values)); } if (empty($values)) { return true; } return (bool) $this->limit(1)->update($values); } /** * Insert new records or update the existing ones. * * @return int */ public function upsert(array $values, array|string $uniqueBy, ?array $update = null) { if (empty($values)) { return 0; } elseif ($update === []) { return (int) $this->insert($values); } if (! is_array(array_first($values))) { $values = [$values]; } else { foreach ($values as $key => $value) { ksort($value); $values[$key] = $value; } } if (is_null($update)) { $update = array_keys(array_first($values)); } $this->applyBeforeQueryCallbacks(); $bindings = $this->cleanBindings(array_merge( Arr::flatten($values, 1), (new Collection($update)) ->reject(fn ($value, $key) => is_int($key)) ->all() )); return $this->connection->affectingStatement( $this->grammar->compileUpsert($this, $values, (array) $uniqueBy, $update), $bindings ); } /** * Increment a column's value by a given amount. * * @param string $column * @param float|int $amount * @return int<0, max> * * @throws \InvalidArgumentException */ public function increment($column, $amount = 1, array $extra = []) { if (! is_numeric($amount)) { throw new InvalidArgumentException('Non-numeric value passed to increment method.'); } return $this->incrementEach([$column => $amount], $extra); } /** * Increment the given column's values by the given amounts. * * @param array $columns * @param array $extra * @return int<0, max> * * @throws \InvalidArgumentException */ public function incrementEach(array $columns, array $extra = []) { foreach ($columns as $column => $amount) { if (! is_numeric($amount)) { throw new InvalidArgumentException("Non-numeric value passed as increment amount for column: '$column'."); } elseif (! is_string($column)) { throw new InvalidArgumentException('Non-associative array passed to incrementEach method.'); } $columns[$column] = $this->raw("{$this->grammar->wrap($column)} + $amount"); } return $this->update(array_merge($columns, $extra)); } /** * Decrement a column's value by a given amount. * * @param string $column * @param float|int $amount * @return int<0, max> * * @throws \InvalidArgumentException */ public function decrement($column, $amount = 1, array $extra = []) { if (! is_numeric($amount)) { throw new InvalidArgumentException('Non-numeric value passed to decrement method.'); } return $this->decrementEach([$column => $amount], $extra); } /** * Decrement the given column's values by the given amounts. * * @param array $columns * @param array $extra * @return int<0, max> * * @throws \InvalidArgumentException */ public function decrementEach(array $columns, array $extra = []) { foreach ($columns as $column => $amount) { if (! is_numeric($amount)) { throw new InvalidArgumentException("Non-numeric value passed as decrement amount for column: '$column'."); } elseif (! is_string($column)) { throw new InvalidArgumentException('Non-associative array passed to decrementEach method.'); } $columns[$column] = $this->raw("{$this->grammar->wrap($column)} - $amount"); } return $this->update(array_merge($columns, $extra)); } /** * Delete records from the database. * * @param mixed $id * @return int */ public function delete($id = null) { // If an ID is passed to the method, we will set the where clause to check the // ID to let developers to simply and quickly remove a single row from this // database without manually specifying the "where" clauses on the query. if (! is_null($id)) { $this->where($this->from.'.id', '=', $id); } $this->applyBeforeQueryCallbacks(); return $this->connection->delete( $this->grammar->compileDelete($this), $this->cleanBindings( $this->grammar->prepareBindingsForDelete($this->bindings) ) ); } /** * Run a truncate statement on the table. * * @return void */ public function truncate() { $this->applyBeforeQueryCallbacks(); foreach ($this->grammar->compileTruncate($this) as $sql => $bindings) { $this->connection->statement($sql, $bindings); } } /** * Get a new instance of the query builder. * * @return \Illuminate\Database\Query\Builder */ public function newQuery() { return new static($this->connection, $this->grammar, $this->processor); } /** * Create a new query instance for a sub-query. * * @return \Illuminate\Database\Query\Builder */ protected function forSubQuery() { return $this->newQuery(); } /** * Get all of the query builder's columns in a text-only array with all expressions evaluated. * * @return list */ public function getColumns() { return ! is_null($this->columns) ? array_map(fn ($column) => $this->grammar->getValue($column), $this->columns) : []; } /** * Create a raw database expression. * * @param mixed $value * @return \Illuminate\Contracts\Database\Query\Expression */ public function raw($value) { return $this->connection->raw($value); } /** * Get the query builder instances that are used in the union of the query. * * @return \Illuminate\Support\Collection */ protected function getUnionBuilders() { return isset($this->unions) ? (new Collection($this->unions))->pluck('query') : new Collection; } /** * Get the "limit" value for the query or null if it's not set. * * @return mixed */ public function getLimit() { $value = $this->unions ? $this->unionLimit : $this->limit; return ! is_null($value) ? (int) $value : null; } /** * Get the "offset" value for the query or null if it's not set. * * @return mixed */ public function getOffset() { $value = $this->unions ? $this->unionOffset : $this->offset; return ! is_null($value) ? (int) $value : null; } /** * Get the current query value bindings in a flattened array. * * @return list */ public function getBindings() { return Arr::flatten($this->bindings); } /** * Get the raw array of bindings. * * @return array{ * select: list, * from: list, * join: list, * where: list, * groupBy: list, * having: list, * order: list, * union: list, * unionOrder: list, * } */ public function getRawBindings() { return $this->bindings; } /** * Set the bindings on the query builder. * * @param list $bindings * @param "select"|"from"|"join"|"where"|"groupBy"|"having"|"order"|"union"|"unionOrder" $type * @return $this * * @throws \InvalidArgumentException */ public function setBindings(array $bindings, $type = 'where') { if (! array_key_exists($type, $this->bindings)) { throw new InvalidArgumentException("Invalid binding type: {$type}."); } $this->bindings[$type] = $bindings; return $this; } /** * Add a binding to the query. * * @param mixed $value * @param "select"|"from"|"join"|"where"|"groupBy"|"having"|"order"|"union"|"unionOrder" $type * @return $this * * @throws \InvalidArgumentException */ public function addBinding($value, $type = 'where') { if (! array_key_exists($type, $this->bindings)) { throw new InvalidArgumentException("Invalid binding type: {$type}."); } if (is_array($value)) { $this->bindings[$type] = array_values(array_map( $this->castBinding(...), array_merge($this->bindings[$type], $value), )); } else { $this->bindings[$type][] = $this->castBinding($value); } return $this; } /** * Cast the given binding value. * * @param mixed $value * @return mixed */ public function castBinding($value) { if ($value instanceof UnitEnum) { return enum_value($value); } return $value; } /** * Merge an array of bindings into our bindings. * * @param self $query * @return $this */ public function mergeBindings(self $query) { $this->bindings = array_merge_recursive($this->bindings, $query->bindings); return $this; } /** * Remove all of the expressions from a list of bindings. * * @param array $bindings * @return list */ public function cleanBindings(array $bindings) { return (new Collection($bindings)) ->reject(function ($binding) { return $binding instanceof ExpressionContract; }) ->map($this->castBinding(...)) ->values() ->all(); } /** * Get a scalar type value from an unknown type of input. * * @param mixed $value * @return mixed */ protected function flattenValue($value) { return is_array($value) ? head(Arr::flatten($value)) : $value; } /** * Get the default key name of the table. * * @return string */ protected function defaultKeyName() { return 'id'; } /** * Get the database connection instance. * * @return \Illuminate\Database\ConnectionInterface */ public function getConnection() { return $this->connection; } /** * Get the database query processor instance. * * @return \Illuminate\Database\Query\Processors\Processor */ public function getProcessor() { return $this->processor; } /** * Get the query grammar instance. * * @return \Illuminate\Database\Query\Grammars\Grammar */ public function getGrammar() { return $this->grammar; } /** * Use the "write" PDO connection when executing the query. * * @return $this */ public function useWritePdo() { $this->useWritePdo = true; return $this; } /** * Determine if the value is a query builder instance or a Closure. * * @param mixed $value * @return bool */ protected function isQueryable($value) { return $value instanceof self || $value instanceof EloquentBuilder || $value instanceof Relation || $value instanceof Closure; } /** * Clone the query. * * @return static */ public function clone() { return clone $this; } /** * Clone the query without the given properties. * * @return static */ public function cloneWithout(array $properties) { return tap($this->clone(), function ($clone) use ($properties) { foreach ($properties as $property) { $clone->{$property} = null; } }); } /** * Clone the query without the given bindings. * * @return static */ public function cloneWithoutBindings(array $except) { return tap($this->clone(), function ($clone) use ($except) { foreach ($except as $type) { $clone->bindings[$type] = []; } }); } /** * Dump the current SQL and bindings. * * @param mixed ...$args * @return $this */ public function dump(...$args) { dump( $this->toSql(), $this->getBindings(), ...$args, ); return $this; } /** * Dump the raw current SQL with embedded bindings. * * @return $this */ public function dumpRawSql() { dump($this->toRawSql()); return $this; } /** * Die and dump the current SQL and bindings. * * @return never */ public function dd() { dd($this->toSql(), $this->getBindings()); } /** * Die and dump the current SQL with embedded bindings. * * @return never */ public function ddRawSql() { dd($this->toRawSql()); } /** * Handle dynamic method calls into the method. * * @param string $method * @param array $parameters * @return mixed * * @throws \BadMethodCallException */ public function __call($method, $parameters) { if (static::hasMacro($method)) { return $this->macroCall($method, $parameters); } if (str_starts_with($method, 'where')) { return $this->dynamicWhere($method, $parameters); } static::throwBadMethodCallException($method); } } \Illuminate\Contracts\Database\Query\Expression|string $table * @param \Closure|\Illuminate\Contracts\Database\Query\Expression|string|null $first * @param string|null $operator * @param \Illuminate\Contracts\Database\Query\Expression|string|null $second * @return $this */ public function crossJoin($table, $first = null, $operator = null, $second = null) { if ($first) { return $this->join($table, $first, $operator, $second, 'cross'); } $this->joins[] = $this->newJoinClause($this, 'cross', $table); return $this; } /** * Add a subquery cross join to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|string $query * @param string $as * @return $this */ public function crossJoinSub($query, $as) { [$query, $bindings] = $this->createSub($query); $expression = '('.$query.') as '.$this->grammar->wrapTable($as); $this->addBinding($bindings, 'join'); $this->joins[] = $this->newJoinClause($this, 'cross', new Expression($expression)); return $this; } /** * Get a new join clause. * * @param string $type * @param \Illuminate\Contracts\Database\Query\Expression|string $table * @return \Illuminate\Database\Query\JoinClause */ protected function newJoinClause(self $parentQuery, $type, $table) { return new JoinClause($parentQuery, $type, $table); } /** * Get a new join lateral clause. * * @param string $type * @param \Illuminate\Contracts\Database\Query\Expression|string $table * @return \Illuminate\Database\Query\JoinLateralClause */ protected function newJoinLateralClause(self $parentQuery, $type, $table) { return new JoinLateralClause($parentQuery, $type, $table); } /** * Merge an array of where clauses and bindings. * * @param array $wheres * @param array $bindings * @return $this */ public function mergeWheres($wheres, $bindings) { $this->wheres = array_merge($this->wheres, (array) $wheres); $this->bindings['where'] = array_values( array_merge($this->bindings['where'], (array) $bindings) ); return $this; } /** * Add a basic where clause to the query. * * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function where($column, $operator = null, $value = null, $boolean = 'and') { if ($column instanceof ConditionExpression) { $type = 'Expression'; $this->wheres[] = compact('type', 'column', 'boolean'); return $this; } // If the column is an array, we will assume it is an array of key-value pairs // and can add them each as a where clause. We will maintain the boolean we // received when the method was called and pass it into the nested where. if (is_array($column)) { return $this->addArrayOfWheres($column, $boolean); } // Here we will make some assumptions about the operator. If only 2 values are // passed to the method, we will assume that the operator is an equals sign // and keep going. Otherwise, we'll require the operator to be passed in. [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the column is actually a Closure instance, we will assume the developer // wants to begin a nested where statement which is wrapped in parentheses. // We will add that Closure to the query and return back out immediately. if ($column instanceof Closure && is_null($operator)) { return $this->whereNested($column, $boolean); } // If the column is a Closure instance and there is an operator value, we will // assume the developer wants to run a subquery and then compare the result // of that subquery with the given value that was provided to the method. if ($this->isQueryable($column) && ! is_null($operator)) { [$sub, $bindings] = $this->createSub($column); return $this->addBinding($bindings, 'where') ->where(new Expression('('.$sub.')'), $operator, $value, $boolean); } // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } // If the value is a Closure, it means the developer is performing an entire // sub-select within the query and we will need to compile the sub-select // within the where clause to get the appropriate query record results. if ($this->isQueryable($value)) { return $this->whereSub($column, $operator, $value, $boolean); } // If the value is "null", we will just assume the developer wants to add a // where null clause to the query. So, we will allow a short-cut here to // that method for convenience so the developer doesn't have to check. if (is_null($value)) { return $this->whereNull($column, $boolean, ! in_array($operator, ['=', '<=>'], true)); } $type = 'Basic'; $columnString = ($column instanceof ExpressionContract) ? $this->grammar->getValue($column) : $column; // If the column is making a JSON reference we'll check to see if the value // is a boolean. If it is, we'll add the raw boolean string as an actual // value to the query to ensure this is properly handled by the query. if (str_contains($columnString, '->') && is_bool($value)) { $value = new Expression($value ? 'true' : 'false'); if (is_string($column)) { $type = 'JsonBoolean'; } } if ($this->isBitwiseOperator($operator)) { $type = 'Bitwise'; } // Now that we are working with just a simple query we can put the elements // in our array and add the query binding to our array of bindings that // will be bound to each SQL statements when it is finally executed. $this->wheres[] = compact( 'type', 'column', 'operator', 'value', 'boolean' ); if (! $value instanceof ExpressionContract) { $this->addBinding($this->flattenValue($value), 'where'); } return $this; } /** * Add an array of where clauses to the query. * * @param array $column * @param string $boolean * @param string $method * @return $this */ protected function addArrayOfWheres($column, $boolean, $method = 'where') { return $this->whereNested(function ($query) use ($column, $method, $boolean) { foreach ($column as $key => $value) { if (is_numeric($key) && is_array($value)) { $query->{$method}(...array_values($value), boolean: $boolean); } else { $query->{$method}($key, '=', $value, $boolean); } } }, $boolean); } /** * Prepare the value and operator for a where clause. * * @param string $value * @param string $operator * @param bool $useDefault * @return array * * @throws \InvalidArgumentException */ public function prepareValueAndOperator($value, $operator, $useDefault = false) { if ($useDefault) { return [$operator, '=']; } elseif ($this->invalidOperatorAndValue($operator, $value)) { throw new InvalidArgumentException('Illegal operator and value combination.'); } return [$value, $operator]; } /** * Determine if the given operator and value combination is legal. * * Prevents using Null values with invalid operators. * * @param string $operator * @param mixed $value * @return bool */ protected function invalidOperatorAndValue($operator, $value) { return is_null($value) && in_array($operator, $this->operators) && ! in_array($operator, ['=', '<=>', '<>', '!=']); } /** * Determine if the given operator is supported. * * @param string $operator * @return bool */ protected function invalidOperator($operator) { return ! is_string($operator) || (! in_array(strtolower($operator), $this->operators, true) && ! in_array(strtolower($operator), $this->grammar->getOperators(), true)); } /** * Determine if the operator is a bitwise operator. * * @param string $operator * @return bool */ protected function isBitwiseOperator($operator) { return in_array(strtolower($operator), $this->bitwiseOperators, true) || in_array(strtolower($operator), $this->grammar->getBitwiseOperators(), true); } /** * Add an "or where" clause to the query. * * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhere($column, $operator = null, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->where($column, $operator, $value, 'or'); } /** * Add a basic "where not" clause to the query. * * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereNot($column, $operator = null, $value = null, $boolean = 'and') { if (is_array($column)) { return $this->whereNested(function ($query) use ($column, $operator, $value, $boolean) { $query->where($column, $operator, $value, $boolean); }, $boolean.' not'); } return $this->where($column, $operator, $value, $boolean.' not'); } /** * Add an "or where not" clause to the query. * * @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereNot($column, $operator = null, $value = null) { return $this->whereNot($column, $operator, $value, 'or'); } /** * Add a "where" clause comparing two columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string|array $first * @param string|null $operator * @param string|null $second * @param string|null $boolean * @return $this */ public function whereColumn($first, $operator = null, $second = null, $boolean = 'and') { // If the column is an array, we will assume it is an array of key-value pairs // and can add them each as a where clause. We will maintain the boolean we // received when the method was called and pass it into the nested where. if (is_array($first)) { return $this->addArrayOfWheres($first, $boolean, 'whereColumn'); } // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$second, $operator] = [$operator, '=']; } // Finally, we will add this where clause into this array of clauses that we // are building for the query. All of them will be compiled via a grammar // once the query is about to be executed and run against the database. $type = 'Column'; $this->wheres[] = compact( 'type', 'first', 'operator', 'second', 'boolean' ); return $this; } /** * Add an "or where" clause comparing two columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string|array $first * @param string|null $operator * @param string|null $second * @return $this */ public function orWhereColumn($first, $operator = null, $second = null) { return $this->whereColumn($first, $operator, $second, 'or'); } /** * Add a raw where clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $sql * @param mixed $bindings * @param string $boolean * @return $this */ public function whereRaw($sql, $bindings = [], $boolean = 'and') { $this->wheres[] = ['type' => 'raw', 'sql' => $sql, 'boolean' => $boolean]; $this->addBinding((array) $bindings, 'where'); return $this; } /** * Add a raw or where clause to the query. * * @param string $sql * @param mixed $bindings * @return $this */ public function orWhereRaw($sql, $bindings = []) { return $this->whereRaw($sql, $bindings, 'or'); } /** * Add a "where like" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean * @param bool $not * @return $this */ public function whereLike($column, $value, $caseSensitive = false, $boolean = 'and', $not = false) { $type = 'Like'; $this->wheres[] = compact('type', 'column', 'value', 'caseSensitive', 'boolean', 'not'); if (method_exists($this->grammar, 'prepareWhereLikeBinding')) { $value = $this->grammar->prepareWhereLikeBinding($value, $caseSensitive); } $this->addBinding($value); return $this; } /** * Add an "or where like" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @return $this */ public function orWhereLike($column, $value, $caseSensitive = false) { return $this->whereLike($column, $value, $caseSensitive, 'or', false); } /** * Add a "where not like" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean * @return $this */ public function whereNotLike($column, $value, $caseSensitive = false, $boolean = 'and') { return $this->whereLike($column, $value, $caseSensitive, $boolean, true); } /** * Add an "or where not like" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @return $this */ public function orWhereNotLike($column, $value, $caseSensitive = false) { return $this->whereNotLike($column, $value, $caseSensitive, 'or'); } /** * Add a "where in" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param mixed $values * @param string $boolean * @param bool $not * @return $this */ public function whereIn($column, $values, $boolean = 'and', $not = false) { $type = $not ? 'NotIn' : 'In'; // If the value is a query builder instance we will assume the developer wants to // look for any values that exist within this given query. So, we will add the // query accordingly so that this query is properly executed when it is run. if ($this->isQueryable($values)) { [$query, $bindings] = $this->createSub($values); $values = [new Expression($query)]; $this->addBinding($bindings, 'where'); } // Next, if the value is Arrayable we need to cast it to its raw array form so we // have the underlying array value instead of an Arrayable object which is not // able to be added as a binding, etc. We will then add to the wheres array. if ($values instanceof Arrayable) { $values = $values->toArray(); } $this->wheres[] = compact('type', 'column', 'values', 'boolean'); if (count($values) !== count(Arr::flatten($values, 1))) { throw new InvalidArgumentException('Nested arrays may not be passed to whereIn method.'); } // Finally, we'll add a binding for each value unless that value is an expression // in which case we will just skip over it since it will be the query as a raw // string and not as a parameterized place-holder to be replaced by the PDO. $this->addBinding($this->cleanBindings($values), 'where'); return $this; } /** * Add an "or where in" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param mixed $values * @return $this */ public function orWhereIn($column, $values) { return $this->whereIn($column, $values, 'or'); } /** * Add a "where not in" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param mixed $values * @param string $boolean * @return $this */ public function whereNotIn($column, $values, $boolean = 'and') { return $this->whereIn($column, $values, $boolean, true); } /** * Add an "or where not in" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param mixed $values * @return $this */ public function orWhereNotIn($column, $values) { return $this->whereNotIn($column, $values, 'or'); } /** * Add a "where in raw" clause for integer values to the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|array $values * @param string $boolean * @param bool $not * @return $this */ public function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false) { $type = $not ? 'NotInRaw' : 'InRaw'; if ($values instanceof Arrayable) { $values = $values->toArray(); } $values = Arr::flatten($values); foreach ($values as &$value) { $value = (int) ($value instanceof BackedEnum ? $value->value : $value); } $this->wheres[] = compact('type', 'column', 'values', 'boolean'); return $this; } /** * Add an "or where in raw" clause for integer values to the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|array $values * @return $this */ public function orWhereIntegerInRaw($column, $values) { return $this->whereIntegerInRaw($column, $values, 'or'); } /** * Add a "where not in raw" clause for integer values to the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|array $values * @param string $boolean * @return $this */ public function whereIntegerNotInRaw($column, $values, $boolean = 'and') { return $this->whereIntegerInRaw($column, $values, $boolean, true); } /** * Add an "or where not in raw" clause for integer values to the query. * * @param string $column * @param \Illuminate\Contracts\Support\Arrayable|array $values * @return $this */ public function orWhereIntegerNotInRaw($column, $values) { return $this->whereIntegerNotInRaw($column, $values, 'or'); } /** * Add a "where null" clause to the query. * * @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns * @param string $boolean * @param bool $not * @return $this */ public function whereNull($columns, $boolean = 'and', $not = false) { $type = $not ? 'NotNull' : 'Null'; foreach (Arr::wrap($columns) as $column) { $this->wheres[] = compact('type', 'column', 'boolean'); } return $this; } /** * Add an "or where null" clause to the query. * * @param string|array|\Illuminate\Contracts\Database\Query\Expression $column * @return $this */ public function orWhereNull($column) { return $this->whereNull($column, 'or'); } /** * Add a "where not null" clause to the query. * * @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns * @param string $boolean * @return $this */ public function whereNotNull($columns, $boolean = 'and') { return $this->whereNull($columns, $boolean, true); } /** * Add a where between statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $boolean * @param bool $not * @return $this */ public function whereBetween($column, iterable $values, $boolean = 'and', $not = false) { $type = 'between'; if ($values instanceof CarbonPeriod) { $values = [$values->getStartDate(), $values->getEndDate()]; } $this->wheres[] = compact('type', 'column', 'values', 'boolean', 'not'); $this->addBinding(array_slice($this->cleanBindings(Arr::flatten($values)), 0, 2), 'where'); return $this; } /** * Add a where between statement using columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $boolean * @param bool $not * @return $this */ public function whereBetweenColumns($column, array $values, $boolean = 'and', $not = false) { $type = 'betweenColumns'; $this->wheres[] = compact('type', 'column', 'values', 'boolean', 'not'); return $this; } /** * Add an or where between statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereBetween($column, iterable $values) { return $this->whereBetween($column, $values, 'or'); } /** * Add an or where between statement using columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereBetweenColumns($column, array $values) { return $this->whereBetweenColumns($column, $values, 'or'); } /** * Add a where not between statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $boolean * @return $this */ public function whereNotBetween($column, iterable $values, $boolean = 'and') { return $this->whereBetween($column, $values, $boolean, true); } /** * Add a where not between statement using columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $boolean * @return $this */ public function whereNotBetweenColumns($column, array $values, $boolean = 'and') { return $this->whereBetweenColumns($column, $values, $boolean, true); } /** * Add an or where not between statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereNotBetween($column, iterable $values) { return $this->whereNotBetween($column, $values, 'or'); } /** * Add an or where not between statement using columns to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereNotBetweenColumns($column, array $values) { return $this->whereNotBetweenColumns($column, $values, 'or'); } /** * Add a where between columns statement using a value to the query. * * @param mixed $value * @param array{\Illuminate\Contracts\Database\Query\Expression|string, \Illuminate\Contracts\Database\Query\Expression|string} $columns * @param string $boolean * @param bool $not * @return $this */ public function whereValueBetween($value, array $columns, $boolean = 'and', $not = false) { $type = 'valueBetween'; $this->wheres[] = compact('type', 'value', 'columns', 'boolean', 'not'); $this->addBinding($value, 'where'); return $this; } /** * Add an or where between columns statement using a value to the query. * * @param mixed $value * @param array{\Illuminate\Contracts\Database\Query\Expression|string, \Illuminate\Contracts\Database\Query\Expression|string} $columns * @return $this */ public function orWhereValueBetween($value, array $columns) { return $this->whereValueBetween($value, $columns, 'or'); } /** * Add a where not between columns statement using a value to the query. * * @param mixed $value * @param array{\Illuminate\Contracts\Database\Query\Expression|string, \Illuminate\Contracts\Database\Query\Expression|string} $columns * @param string $boolean * @return $this */ public function whereValueNotBetween($value, array $columns, $boolean = 'and') { return $this->whereValueBetween($value, $columns, $boolean, true); } /** * Add an or where not between columns statement using a value to the query. * * @param mixed $value * @param array{\Illuminate\Contracts\Database\Query\Expression|string, \Illuminate\Contracts\Database\Query\Expression|string} $columns * @return $this */ public function orWhereValueNotBetween($value, array $columns) { return $this->whereValueNotBetween($value, $columns, 'or'); } /** * Add an "or where not null" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orWhereNotNull($column) { return $this->whereNotNull($column, 'or'); } /** * Add a "where date" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|null $operator * @param \DateTimeInterface|string|null $value * @param string $boolean * @return $this */ public function whereDate($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('Y-m-d'); } return $this->addDateBasedWhere('Date', $column, $operator, $value, $boolean); } /** * Add an "or where date" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|null $operator * @param \DateTimeInterface|string|null $value * @return $this */ public function orWhereDate($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereDate($column, $operator, $value, 'or'); } /** * Add a "where time" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|null $operator * @param \DateTimeInterface|string|null $value * @param string $boolean * @return $this */ public function whereTime($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('H:i:s'); } return $this->addDateBasedWhere('Time', $column, $operator, $value, $boolean); } /** * Add an "or where time" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|null $operator * @param \DateTimeInterface|string|null $value * @return $this */ public function orWhereTime($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereTime($column, $operator, $value, 'or'); } /** * Add a "where day" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @param string $boolean * @return $this */ public function whereDay($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('d'); } if (! $value instanceof ExpressionContract) { $value = sprintf('%02d', $value); } return $this->addDateBasedWhere('Day', $column, $operator, $value, $boolean); } /** * Add an "or where day" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @return $this */ public function orWhereDay($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereDay($column, $operator, $value, 'or'); } /** * Add a "where month" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @param string $boolean * @return $this */ public function whereMonth($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('m'); } if (! $value instanceof ExpressionContract) { $value = sprintf('%02d', $value); } return $this->addDateBasedWhere('Month', $column, $operator, $value, $boolean); } /** * Add an "or where month" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @return $this */ public function orWhereMonth($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereMonth($column, $operator, $value, 'or'); } /** * Add a "where year" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @param string $boolean * @return $this */ public function whereYear($column, $operator, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $value = $this->flattenValue($value); if ($value instanceof DateTimeInterface) { $value = $value->format('Y'); } return $this->addDateBasedWhere('Year', $column, $operator, $value, $boolean); } /** * Add an "or where year" statement to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param \DateTimeInterface|string|int|null $operator * @param \DateTimeInterface|string|int|null $value * @return $this */ public function orWhereYear($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereYear($column, $operator, $value, 'or'); } /** * Add a date based (year, month, day, time) statement to the query. * * @param string $type * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $operator * @param mixed $value * @param string $boolean * @return $this */ protected function addDateBasedWhere($type, $column, $operator, $value, $boolean = 'and') { $this->wheres[] = compact('column', 'type', 'boolean', 'operator', 'value'); if (! $value instanceof ExpressionContract) { $this->addBinding($value, 'where'); } return $this; } /** * Add a nested where statement to the query. * * @param string $boolean * @return $this */ public function whereNested(Closure $callback, $boolean = 'and') { $callback($query = $this->forNestedWhere()); return $this->addNestedWhereQuery($query, $boolean); } /** * Create a new query instance for nested where condition. * * @return \Illuminate\Database\Query\Builder */ public function forNestedWhere() { return $this->newQuery()->from($this->from); } /** * Add another query builder as a nested where to the query builder. * * @param \Illuminate\Database\Query\Builder $query * @param string $boolean * @return $this */ public function addNestedWhereQuery($query, $boolean = 'and') { if (count($query->wheres)) { $type = 'Nested'; $this->wheres[] = compact('type', 'query', 'boolean'); $this->addBinding($query->getRawBindings()['where'], 'where'); } return $this; } /** * Add a full sub-select to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $operator * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @param string $boolean * @return $this */ protected function whereSub($column, $operator, $callback, $boolean) { $type = 'Sub'; if ($callback instanceof Closure) { // Once we have the query instance we can simply execute it so it can add all // of the sub-select's conditions to itself, and then we can cache it off // in the array of where clauses for the "main" parent query instance. $callback($query = $this->forSubQuery()); } else { $query = $callback instanceof EloquentBuilder ? $callback->toBase() : $callback; } $this->wheres[] = compact( 'type', 'column', 'operator', 'query', 'boolean' ); $this->addBinding($query->getBindings(), 'where'); return $this; } /** * Add an exists clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @param string $boolean * @param bool $not * @return $this */ public function whereExists($callback, $boolean = 'and', $not = false) { if ($callback instanceof Closure) { $query = $this->forSubQuery(); // Similar to the sub-select clause, we will create a new query instance so // the developer may cleanly specify the entire exists query and we will // compile the whole thing in the grammar and insert it into the SQL. $callback($query); } else { $query = $callback instanceof EloquentBuilder ? $callback->toBase() : $callback; } return $this->addWhereExistsQuery($query, $boolean, $not); } /** * Add an or exists clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @param bool $not * @return $this */ public function orWhereExists($callback, $not = false) { return $this->whereExists($callback, 'or', $not); } /** * Add a where not exists clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @param string $boolean * @return $this */ public function whereNotExists($callback, $boolean = 'and') { return $this->whereExists($callback, $boolean, true); } /** * Add a where not exists clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $callback * @return $this */ public function orWhereNotExists($callback) { return $this->orWhereExists($callback, true); } /** * Add an exists clause to the query. * * @param string $boolean * @param bool $not * @return $this */ public function addWhereExistsQuery(self $query, $boolean = 'and', $not = false) { $type = $not ? 'NotExists' : 'Exists'; $this->wheres[] = compact('type', 'query', 'boolean'); $this->addBinding($query->getBindings(), 'where'); return $this; } /** * Adds a where condition using row values. * * @param array $columns * @param string $operator * @param array $values * @param string $boolean * @return $this * * @throws \InvalidArgumentException */ public function whereRowValues($columns, $operator, $values, $boolean = 'and') { if (count($columns) !== count($values)) { throw new InvalidArgumentException('The number of columns must match the number of values'); } $type = 'RowValues'; $this->wheres[] = compact('type', 'columns', 'operator', 'values', 'boolean'); $this->addBinding($this->cleanBindings($values)); return $this; } /** * Adds an or where condition using row values. * * @param array $columns * @param string $operator * @param array $values * @return $this */ public function orWhereRowValues($columns, $operator, $values) { return $this->whereRowValues($columns, $operator, $values, 'or'); } /** * Add a "where JSON contains" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @param bool $not * @return $this */ public function whereJsonContains($column, $value, $boolean = 'and', $not = false) { $type = 'JsonContains'; $this->wheres[] = compact('type', 'column', 'value', 'boolean', 'not'); if (! $value instanceof ExpressionContract) { $this->addBinding($this->grammar->prepareBindingForJsonContains($value)); } return $this; } /** * Add an "or where JSON contains" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonContains($column, $value) { return $this->whereJsonContains($column, $value, 'or'); } /** * Add a "where JSON not contains" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @return $this */ public function whereJsonDoesntContain($column, $value, $boolean = 'and') { return $this->whereJsonContains($column, $value, $boolean, true); } /** * Add an "or where JSON not contains" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonDoesntContain($column, $value) { return $this->whereJsonDoesntContain($column, $value, 'or'); } /** * Add a "where JSON overlaps" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @param bool $not * @return $this */ public function whereJsonOverlaps($column, $value, $boolean = 'and', $not = false) { $type = 'JsonOverlaps'; $this->wheres[] = compact('type', 'column', 'value', 'boolean', 'not'); if (! $value instanceof ExpressionContract) { $this->addBinding($this->grammar->prepareBindingForJsonContains($value)); } return $this; } /** * Add an "or where JSON overlaps" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonOverlaps($column, $value) { return $this->whereJsonOverlaps($column, $value, 'or'); } /** * Add a "where JSON not overlap" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @return $this */ public function whereJsonDoesntOverlap($column, $value, $boolean = 'and') { return $this->whereJsonOverlaps($column, $value, $boolean, true); } /** * Add an "or where JSON not overlap" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonDoesntOverlap($column, $value) { return $this->whereJsonDoesntOverlap($column, $value, 'or'); } /** * Add a clause that determines if a JSON path exists to the query. * * @param string $column * @param string $boolean * @param bool $not * @return $this */ public function whereJsonContainsKey($column, $boolean = 'and', $not = false) { $type = 'JsonContainsKey'; $this->wheres[] = compact('type', 'column', 'boolean', 'not'); return $this; } /** * Add an "or" clause that determines if a JSON path exists to the query. * * @param string $column * @return $this */ public function orWhereJsonContainsKey($column) { return $this->whereJsonContainsKey($column, 'or'); } /** * Add a clause that determines if a JSON path does not exist to the query. * * @param string $column * @param string $boolean * @return $this */ public function whereJsonDoesntContainKey($column, $boolean = 'and') { return $this->whereJsonContainsKey($column, $boolean, true); } /** * Add an "or" clause that determines if a JSON path does not exist to the query. * * @param string $column * @return $this */ public function orWhereJsonDoesntContainKey($column) { return $this->whereJsonDoesntContainKey($column, 'or'); } /** * Add a "where JSON length" clause to the query. * * @param string $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereJsonLength($column, $operator, $value = null, $boolean = 'and') { $type = 'JsonLength'; [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } $this->wheres[] = compact('type', 'column', 'operator', 'value', 'boolean'); if (! $value instanceof ExpressionContract) { $this->addBinding((int) $this->flattenValue($value)); } return $this; } /** * Add an "or where JSON length" clause to the query. * * @param string $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereJsonLength($column, $operator, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->whereJsonLength($column, $operator, $value, 'or'); } /** * Handles dynamic "where" clauses to the query. * * @param string $method * @param array $parameters * @return $this */ public function dynamicWhere($method, $parameters) { $finder = substr($method, 5); $segments = preg_split( '/(And|Or)(?=[A-Z])/', $finder, -1, PREG_SPLIT_DELIM_CAPTURE ); // The connector variable will determine which connector will be used for the // query condition. We will change it as we come across new boolean values // in the dynamic method strings, which could contain a number of these. $connector = 'and'; $index = 0; foreach ($segments as $segment) { // If the segment is not a boolean connector, we can assume it is a column's name // and we will add it to the query as a new constraint as a where clause, then // we can keep iterating through the dynamic method string's segments again. if ($segment !== 'And' && $segment !== 'Or') { $this->addDynamic($segment, $connector, $parameters, $index); $index++; } // Otherwise, we will store the connector so we know how the next where clause we // find in the query should be connected to the previous ones, meaning we will // have the proper boolean connector to connect the next where clause found. else { $connector = $segment; } } return $this; } /** * Add a single dynamic where clause statement to the query. * * @param string $segment * @param string $connector * @param array $parameters * @param int $index * @return void */ protected function addDynamic($segment, $connector, $parameters, $index) { // Once we have parsed out the columns and formatted the boolean operators we // are ready to add it to this query as a where clause just like any other // clause on the query. Then we'll increment the parameter index values. $bool = strtolower($connector); $this->where(Str::snake($segment), '=', $parameters[$index], $bool); } /** * Add a "where fulltext" clause to the query. * * @param string|string[] $columns * @param string $value * @param string $boolean * @return $this */ public function whereFullText($columns, $value, array $options = [], $boolean = 'and') { $type = 'Fulltext'; $columns = (array) $columns; $this->wheres[] = compact('type', 'columns', 'value', 'options', 'boolean'); $this->addBinding($value); return $this; } /** * Add a "or where fulltext" clause to the query. * * @param string|string[] $columns * @param string $value * @return $this */ public function orWhereFullText($columns, $value, array $options = []) { return $this->whereFullText($columns, $value, $options, 'or'); } /** * Add a "where" clause to the query for multiple columns with "and" conditions between them. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereAll($columns, $operator = null, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); $this->whereNested(function ($query) use ($columns, $operator, $value) { foreach ($columns as $column) { $query->where($column, $operator, $value, 'and'); } }, $boolean); return $this; } /** * Add an "or where" clause to the query for multiple columns with "and" conditions between them. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereAll($columns, $operator = null, $value = null) { return $this->whereAll($columns, $operator, $value, 'or'); } /** * Add a "where" clause to the query for multiple columns with "or" conditions between them. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereAny($columns, $operator = null, $value = null, $boolean = 'and') { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); $this->whereNested(function ($query) use ($columns, $operator, $value) { foreach ($columns as $column) { $query->where($column, $operator, $value, 'or'); } }, $boolean); return $this; } /** * Add an "or where" clause to the query for multiple columns with "or" conditions between them. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereAny($columns, $operator = null, $value = null) { return $this->whereAny($columns, $operator, $value, 'or'); } /** * Add a "where not" clause to the query for multiple columns where none of the conditions should be true. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereNone($columns, $operator = null, $value = null, $boolean = 'and') { return $this->whereAny($columns, $operator, $value, $boolean.' not'); } /** * Add an "or where not" clause to the query for multiple columns where none of the conditions should be true. * * @param \Illuminate\Contracts\Database\Query\Expression[]|\Closure[]|string[] $columns * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereNone($columns, $operator = null, $value = null) { return $this->whereNone($columns, $operator, $value, 'or'); } /** * Add a "group by" clause to the query. * * @param array|\Illuminate\Contracts\Database\Query\Expression|string ...$groups * @return $this */ public function groupBy(...$groups) { foreach ($groups as $group) { $this->groups = array_merge( (array) $this->groups, Arr::wrap($group) ); } return $this; } /** * Add a raw groupBy clause to the query. * * @param string $sql * @return $this */ public function groupByRaw($sql, array $bindings = []) { $this->groups[] = new Expression($sql); $this->addBinding($bindings, 'groupBy'); return $this; } /** * Add a "having" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|\Closure|string $column * @param \DateTimeInterface|string|int|float|null $operator * @param \Illuminate\Contracts\Database\Query\Expression|\DateTimeInterface|string|int|float|null $value * @param string $boolean * @return $this */ public function having($column, $operator = null, $value = null, $boolean = 'and') { $type = 'Basic'; if ($column instanceof ConditionExpression) { $type = 'Expression'; $this->havings[] = compact('type', 'column', 'boolean'); return $this; } // Here we will make some assumptions about the operator. If only 2 values are // passed to the method, we will assume that the operator is an equals sign // and keep going. Otherwise, we'll require the operator to be passed in. [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); if ($column instanceof Closure && is_null($operator)) { return $this->havingNested($column, $boolean); } // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. if ($this->invalidOperator($operator)) { [$value, $operator] = [$operator, '=']; } if ($this->isBitwiseOperator($operator)) { $type = 'Bitwise'; } $this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean'); if (! $value instanceof ExpressionContract) { $this->addBinding($this->flattenValue($value), 'having'); } return $this; } /** * Add an "or having" clause to the query. * * @param \Illuminate\Contracts\Database\Query\Expression|\Closure|string $column * @param \DateTimeInterface|string|int|float|null $operator * @param \Illuminate\Contracts\Database\Query\Expression|\DateTimeInterface|string|int|float|null $value * @return $this */ public function orHaving($column, $operator = null, $value = null) { [$value, $operator] = $this->prepareValueAndOperator( $value, $operator, func_num_args() === 2 ); return $this->having($column, $operator, $value, 'or'); } /** * Add a nested having statement to the query. * * @param string $boolean * @return $this */ public function havingNested(Closure $callback, $boolean = 'and') { $callback($query = $this->forNestedWhere()); return $this->addNestedHavingQuery($query, $boolean); } /** * Add another query builder as a nested having to the query builder. * * @param \Illuminate\Database\Query\Builder $query * @param string $boolean * @return $this */ public function addNestedHavingQuery($query, $boolean = 'and') { if (count($query->havings)) { $type = 'Nested'; $this->havings[] = compact('type', 'query', 'boolean'); $this->addBinding($query->getRawBindings()['having'], 'having'); } return $this; } /** * Add a "having null" clause to the query. * * @param array|string $columns * @param string $boolean * @param bool $not * @return $this */ public function havingNull($columns, $boolean = 'and', $not = false) { $type = $not ? 'NotNull' : 'Null'; foreach (Arr::wrap($columns) as $column) { $this->havings[] = compact('type', 'column', 'boolean'); } return $this; } /** * Add an "or having null" clause to the query. * * @param string $column * @return $this */ public function orHavingNull($column) { return $this->havingNull($column, 'or'); } /** * Add a "having not null" clause to the query. * * @param array|string $columns * @param string $boolean * @return $this */ public function havingNotNull($columns, $boolean = 'and') { return $this->havingNull($columns, $boolean, true); } /** * Add an "or having not null" clause to the query. * * @param string $column * @return $this */ public function orHavingNotNull($column) { return $this->havingNotNull($column, 'or'); } /** * Add a "having between " clause to the query. * * @param string $column * @param string $boolean * @param bool $not * @return $this */ public function havingBetween($column, iterable $values, $boolean = 'and', $not = false) { $type = 'between'; if ($values instanceof CarbonPeriod) { $values = [$values->getStartDate(), $values->getEndDate()]; } $this->havings[] = compact('type', 'column', 'values', 'boolean', 'not'); $this->addBinding(array_slice($this->cleanBindings(Arr::flatten($values)), 0, 2), 'having'); return $this; } /** * Add a raw having clause to the query. * * @param string $sql * @param string $boolean * @return $this */ public function havingRaw($sql, array $bindings = [], $boolean = 'and') { $type = 'Raw'; $this->havings[] = compact('type', 'sql', 'boolean'); $this->addBinding($bindings, 'having'); return $this; } /** * Add a raw or having clause to the query. * * @param string $sql * @return $this */ public function orHavingRaw($sql, array $bindings = []) { return $this->havingRaw($sql, $bindings, 'or'); } /** * Add an "order by" clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|\Illuminate\Contracts\Database\Query\Expression|string $column * @param string $direction * @return $this * * @throws \InvalidArgumentException */ public function orderBy($column, $direction = 'asc') { if ($this->isQueryable($column)) { [$query, $bindings] = $this->createSub($column); $column = new Expression('('.$query.')'); $this->addBinding($bindings, $this->unions ? 'unionOrder' : 'order'); } $direction = strtolower($direction); if (! in_array($direction, ['asc', 'desc'], true)) { throw new InvalidArgumentException('Order direction must be "asc" or "desc".'); } $this->{$this->unions ? 'unionOrders' : 'orders'}[] = [ 'column' => $column, 'direction' => $direction, ]; return $this; } /** * Add a descending "order by" clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|\Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function orderByDesc($column) { return $this->orderBy($column, 'desc'); } /** * Add an "order by" clause for a timestamp to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function latest($column = 'created_at') { return $this->orderBy($column, 'desc'); } /** * Add an "order by" clause for a timestamp to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string $column * @return $this */ public function oldest($column = 'created_at') { return $this->orderBy($column, 'asc'); } /** * Put the query's results in random order. * * @param string|int $seed * @return $this */ public function inRandomOrder($seed = '') { return $this->orderByRaw($this->grammar->compileRandom($seed)); } /** * Add a raw "order by" clause to the query. * * @param string $sql * @param array $bindings * @return $this */ public function orderByRaw($sql, $bindings = []) { $type = 'Raw'; $this->{$this->unions ? 'unionOrders' : 'orders'}[] = compact('type', 'sql'); $this->addBinding($bindings, $this->unions ? 'unionOrder' : 'order'); return $this; } /** * Alias to set the "offset" value of the query. * * @param int $value * @return $this */ public function skip($value) { return $this->offset($value); } /** * Set the "offset" value of the query. * * @param int $value * @return $this */ public function offset($value) { $property = $this->unions ? 'unionOffset' : 'offset'; $this->$property = max(0, (int) $value); return $this; } /** * Alias to set the "limit" value of the query. * * @param int $value * @return $this */ public function take($value) { return $this->limit($value); } /** * Set the "limit" value of the query. * * @param int $value * @return $this */ public function limit($value) { $property = $this->unions ? 'unionLimit' : 'limit'; if ($value >= 0) { $this->$property = ! is_null($value) ? (int) $value : null; } return $this; } /** * Add a "group limit" clause to the query. * * @param int $value * @param string $column * @return $this */ public function groupLimit($value, $column) { if ($value >= 0) { $this->groupLimit = compact('value', 'column'); } return $this; } /** * Set the limit and offset for a given page. * * @param int $page * @param int $perPage * @return $this */ public function forPage($page, $perPage = 15) { return $this->offset(($page - 1) * $perPage)->limit($perPage); } /** * Constrain the query to the previous "page" of results before a given ID. * * @param int $perPage * @param int|null $lastId * @param string $column * @return $this */ public function forPageBeforeId($perPage = 15, $lastId = 0, $column = 'id') { $this->orders = $this->removeExistingOrdersFor($column); if (is_null($lastId)) { $this->whereNotNull($column); } else { $this->where($column, '<', $lastId); } return $this->orderBy($column, 'desc') ->limit($perPage); } /** * Constrain the query to the next "page" of results after a given ID. * * @param int $perPage * @param int|null $lastId * @param string $column * @return $this */ public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') { $this->orders = $this->removeExistingOrdersFor($column); if (is_null($lastId)) { $this->whereNotNull($column); } else { $this->where($column, '>', $lastId); } return $this->orderBy($column, 'asc') ->limit($perPage); } /** * Remove all existing orders and optionally add a new order. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string|null $column * @param string $direction * @return $this */ public function reorder($column = null, $direction = 'asc') { $this->orders = null; $this->unionOrders = null; $this->bindings['order'] = []; $this->bindings['unionOrder'] = []; if ($column) { return $this->orderBy($column, $direction); } return $this; } /** * Add descending "reorder" clause to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string|null $column * @return $this */ public function reorderDesc($column) { return $this->reorder($column, 'desc'); } /** * Get an array with all orders with a given column removed. * * @param string $column * @return array */ protected function removeExistingOrdersFor($column) { return (new Collection($this->orders)) ->reject(fn ($order) => isset($order['column']) && $order['column'] === $column) ->values() ->all(); } /** * Add a union statement to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $query * @param bool $all * @return $this */ public function union($query, $all = false) { if ($query instanceof Closure) { $query($query = $this->newQuery()); } $this->unions[] = compact('query', 'all'); $this->addBinding($query->getBindings(), 'union'); return $this; } /** * Add a union all statement to the query. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*> $query * @return $this */ public function unionAll($query) { return $this->union($query, true); } /** * Lock the selected rows in the table. * * @param string|bool $value * @return $this */ public function lock($value = true) { $this->lock = $value; if (! is_null($this->lock)) { $this->useWritePdo(); } return $this; } /** * Lock the selected rows in the table for updating. * * @return $this */ public function lockForUpdate() { return $this->lock(true); } /** * Share lock the selected rows in the table. * * @return $this */ public function sharedLock() { return $this->lock(false); } /** * Register a closure to be invoked before the query is executed. * * @return $this */ public function beforeQuery(callable $callback) { $this->beforeQueryCallbacks[] = $callback; return $this; } /** * Invoke the "before query" modification callbacks. * * @return void */ public function applyBeforeQueryCallbacks() { foreach ($this->beforeQueryCallbacks as $callback) { $callback($this); } $this->beforeQueryCallbacks = []; } /** * Register a closure to be invoked after the query is executed. * * @return $this */ public function afterQuery(Closure $callback) { $this->afterQueryCallbacks[] = $callback; return $this; } /** * Invoke the "after query" modification callbacks. * * @param mixed $result * @return mixed */ public function applyAfterQueryCallbacks($result) { foreach ($this->afterQueryCallbacks as $afterQueryCallback) { $result = $afterQueryCallback($result) ?: $result; } return $result; } /** * Get the SQL representation of the query. * * @return string */ public function toSql() { $this->applyBeforeQueryCallbacks(); return $this->grammar->compileSelect($this); } /** * Get the raw SQL representation of the query with embedded bindings. * * @return string */ public function toRawSql() { return $this->grammar->substituteBindingsIntoRawSql( $this->toSql(), $this->connection->prepareBindings($this->getBindings()) ); } /** * Execute a query for a single record by ID. * * @param int|string $id * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @return object|null */ public function find($id, $columns = ['*']) { return $this->where('id', '=', $id)->first($columns); } /** * Execute a query for a single record by ID or call a callback. * * @template TValue * * @param mixed $id * @param (\Closure(): TValue)|string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @param (\Closure(): TValue)|null $callback * @return object|TValue */ public function findOr($id, $columns = ['*'], ?Closure $callback = null) { if ($columns instanceof Closure) { $callback = $columns; $columns = ['*']; } if (! is_null($data = $this->find($id, $columns))) { return $data; } return $callback(); } /** * Get a single column's value from the first result of a query. * * @param string $column * @return mixed */ public function value($column) { $result = (array) $this->first([$column]); return count($result) > 0 ? array_first($result) : null; } /** * Get a single expression value from the first result of a query. * * @return mixed */ public function rawValue(string $expression, array $bindings = []) { $result = (array) $this->selectRaw($expression, $bindings)->first(); return count($result) > 0 ? array_first($result) : null; } /** * Get a single column's value from the first result of a query if it's the sole matching record. * * @param string $column * @return mixed * * @throws \Illuminate\Database\RecordsNotFoundException * @throws \Illuminate\Database\MultipleRecordsFoundException */ public function soleValue($column) { $result = (array) $this->sole([$column]); return array_first($result); } /** * Execute the query as a "select" statement. * * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @return \Illuminate\Support\Collection */ public function get($columns = ['*']) { $items = new Collection($this->onceWithColumns(Arr::wrap($columns), function () { return $this->processor->processSelect($this, $this->runSelect()); })); return $this->applyAfterQueryCallbacks( isset($this->groupLimit) ? $this->withoutGroupLimitKeys($items) : $items ); } /** * Run the query as a "select" statement against the connection. * * @return array */ protected function runSelect() { return $this->connection->select( $this->toSql(), $this->getBindings(), ! $this->useWritePdo ); } /** * Remove the group limit keys from the results in the collection. * * @param \Illuminate\Support\Collection $items * @return \Illuminate\Support\Collection */ protected function withoutGroupLimitKeys($items) { $keysToRemove = ['laravel_row']; if (is_string($this->groupLimit['column'])) { $column = last(explode('.', $this->groupLimit['column'])); $keysToRemove[] = '@laravel_group := '.$this->grammar->wrap($column); $keysToRemove[] = '@laravel_group := '.$this->grammar->wrap('pivot_'.$column); } $items->each(function ($item) use ($keysToRemove) { foreach ($keysToRemove as $key) { unset($item->$key); } }); return $items; } /** * Paginate the given query into a simple paginator. * * @param int|\Closure $perPage * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @param string $pageName * @param int|null $page * @param \Closure|int|null $total * @return \Illuminate\Pagination\LengthAwarePaginator */ public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null, $total = null) { $page = $page ?: Paginator::resolveCurrentPage($pageName); $total = value($total) ?? $this->getCountForPagination(); $perPage = value($perPage, $total); $results = $total ? $this->forPage($page, $perPage)->get($columns) : new Collection; return $this->paginator($results, $total, $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ]); } /** * Get a paginator only supporting simple next and previous links. * * This is more efficient on larger data-sets, etc. * * @param int $perPage * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @param string $pageName * @param int|null $page * @return \Illuminate\Contracts\Pagination\Paginator */ public function simplePaginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null) { $page = $page ?: Paginator::resolveCurrentPage($pageName); $this->offset(($page - 1) * $perPage)->limit($perPage + 1); return $this->simplePaginator($this->get($columns), $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ]); } /** * Get a paginator only supporting simple next and previous links. * * This is more efficient on larger data-sets, etc. * * @param int|null $perPage * @param string|\Illuminate\Contracts\Database\Query\Expression|array $columns * @param string $cursorName * @param \Illuminate\Pagination\Cursor|string|null $cursor * @return \Illuminate\Contracts\Pagination\CursorPaginator */ public function cursorPaginate($perPage = 15, $columns = ['*'], $cursorName = 'cursor', $cursor = null) { return $this->paginateUsingCursor($perPage, $columns, $cursorName, $cursor); } /** * Ensure the proper order by required for cursor pagination. * * @param bool $shouldReverse * @return \Illuminate\Support\Collection */ protected function ensureOrderForCursorPagination($shouldReverse = false) { if (empty($this->orders) && empty($this->unionOrders)) { $this->enforceOrderBy(); } $reverseDirection = function ($order) { if (! isset($order['direction'])) { return $order; } $order['direction'] = $order['direction'] === 'asc' ? 'desc' : 'asc'; return $order; }; if ($shouldReverse) { $this->orders = (new Collection($this->orders))->map($reverseDirection)->toArray(); $this->unionOrders = (new Collection($this->unionOrders))->map($reverseDirection)->toArray(); } $orders = ! empty($this->unionOrders) ? $this->unionOrders : $this->orders; return (new Collection($orders)) ->filter(fn ($order) => Arr::has($order, 'direction')) ->values(); } /** * Get the count of the total records for the paginator. * * @param array $columns * @return int<0, max> */ public function getCountForPagination($columns = ['*']) { $results = $this->runPaginationCountQuery($columns); // Once we have run the pagination count query, we will get the resulting count and // take into account what type of query it was. When there is a group by we will // just return the count of the entire results set since that will be correct. if (! isset($results[0])) { return 0; } elseif (is_object($results[0])) { return (int) $results[0]->aggregate; } return (int) array_change_key_case((array) $results[0])['aggregate']; } /** * Run a pagination count query. * * @param array $columns * @return array */ protected function runPaginationCountQuery($columns = ['*']) { if ($this->groups || $this->havings) { $clone = $this->cloneForPaginationCount(); if (is_null($clone->columns) && ! empty($this->joins)) { $clone->select($this->from.'.*'); } return $this->newQuery() ->from(new Expression('('.$clone->toSql().') as '.$this->grammar->wrap('aggregate_table'))) ->mergeBindings($clone) ->setAggregate('count', $this->withoutSelectAliases($columns)) ->get()->all(); } $without = $this->unions ? ['unionOrders', 'unionLimit', 'unionOffset'] : ['columns', 'orders', 'limit', 'offset']; return $this->cloneWithout($without) ->cloneWithoutBindings($this->unions ? ['unionOrder'] : ['select', 'order']) ->setAggregate('count', $this->withoutSelectAliases($columns)) ->get()->all(); } /** * Clone the existing query instance for usage in a pagination subquery. * * @return self */ protected function cloneForPaginationCount() { return $this->cloneWithout(['orders', 'limit', 'offset']) ->cloneWithoutBindings(['order']); } /** * Remove the column aliases since they will break count queries. * * @param array $columns * @return array */ protected function withoutSelectAliases(array $columns) { return array_map(function ($column) { return is_string($column) && ($aliasPosition = stripos($column, ' as ')) !== false ? substr($column, 0, $aliasPosition) : $column; }, $columns); } /** * Get a lazy collection for the given query. * * @return \Illuminate\Support\LazyCollection */ public function cursor() { if (is_null($this->columns)) { $this->columns = ['*']; } return (new LazyCollection(function () { yield from $this->connection->cursor( $this->toSql(), $this->getBindings(), ! $this->useWritePdo ); }))->map(function ($item) { return $this->applyAfterQueryCallbacks(new Collection([$item]))->first(); })->reject(fn ($item) => is_null($item)); } /** * Throw an exception if the query doesn't have an orderBy clause. * * @return void * * @throws \RuntimeException */ protected function enforceOrderBy() { if (empty($this->orders) && empty($this->unionOrders)) { throw new RuntimeException('You must specify an orderBy clause when using this function.'); } } /** * Get a collection instance containing the values of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string|null $key * @return \Illuminate\Support\Collection */ public function pluck($column, $key = null) { // First, we will need to select the results of the query accounting for the // given columns / key. Once we have the results, we will be able to take // the results and get the exact data that was requested for the query. $queryResult = $this->onceWithColumns( is_null($key) || $key === $column ? [$column] : [$column, $key], function () { return $this->processor->processSelect( $this, $this->runSelect() ); } ); if (empty($queryResult)) { return new Collection; } // If the columns are qualified with a table or have an alias, we cannot use // those directly in the "pluck" operations since the results from the DB // are only keyed by the column itself. We'll strip the table out here. $column = $this->stripTableForPluck($column); $key = $this->stripTableForPluck($key); return $this->applyAfterQueryCallbacks( is_array($queryResult[0]) ? $this->pluckFromArrayColumn($queryResult, $column, $key) : $this->pluckFromObjectColumn($queryResult, $column, $key) ); } /** * Strip off the table name or alias from a column identifier. * * @param string $column * @return string|null */ protected function stripTableForPluck($column) { if (is_null($column)) { return $column; } $columnString = $column instanceof ExpressionContract ? $this->grammar->getValue($column) : $column; $separator = str_contains(strtolower($columnString), ' as ') ? ' as ' : '\.'; return last(preg_split('~'.$separator.'~i', $columnString)); } /** * Retrieve column values from rows represented as objects. * * @param array $queryResult * @param string $column * @param string $key * @return \Illuminate\Support\Collection */ protected function pluckFromObjectColumn($queryResult, $column, $key) { $results = []; if (is_null($key)) { foreach ($queryResult as $row) { $results[] = $row->$column; } } else { foreach ($queryResult as $row) { $results[$row->$key] = $row->$column; } } return new Collection($results); } /** * Retrieve column values from rows represented as arrays. * * @param array $queryResult * @param string $column * @param string $key * @return \Illuminate\Support\Collection */ protected function pluckFromArrayColumn($queryResult, $column, $key) { $results = []; if (is_null($key)) { foreach ($queryResult as $row) { $results[] = $row[$column]; } } else { foreach ($queryResult as $row) { $results[$row[$key]] = $row[$column]; } } return new Collection($results); } /** * Concatenate values of a given column as a string. * * @param string $column * @param string $glue * @return string */ public function implode($column, $glue = '') { return $this->pluck($column)->implode($glue); } /** * Determine if any rows exist for the current query. * * @return bool */ public function exists() { $this->applyBeforeQueryCallbacks(); $results = $this->connection->select( $this->grammar->compileExists($this), $this->getBindings(), ! $this->useWritePdo ); // If the results have rows, we will get the row and see if the exists column is a // boolean true. If there are no results for this query we will return false as // there are no rows for this query at all, and we can return that info here. if (isset($results[0])) { $results = (array) $results[0]; return (bool) $results['exists']; } return false; } /** * Determine if no rows exist for the current query. * * @return bool */ public function doesntExist() { return ! $this->exists(); } /** * Execute the given callback if no rows exist for the current query. * * @return mixed */ public function existsOr(Closure $callback) { return $this->exists() ? true : $callback(); } /** * Execute the given callback if rows exist for the current query. * * @return mixed */ public function doesntExistOr(Closure $callback) { return $this->doesntExist() ? true : $callback(); } /** * Retrieve the "count" result of the query. * * @param \Illuminate\Contracts\Database\Query\Expression|string $columns * @return int<0, max> */ public function count($columns = '*') { return (int) $this->aggregate(__FUNCTION__, Arr::wrap($columns)); } /** * Retrieve the minimum value of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function min($column) { return $this->aggregate(__FUNCTION__, [$column]); } /** * Retrieve the maximum value of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function max($column) { return $this->aggregate(__FUNCTION__, [$column]); } /** * Retrieve the sum of the values of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function sum($column) { $result = $this->aggregate(__FUNCTION__, [$column]); return $result ?: 0; } /** * Retrieve the average of the values of a given column. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function avg($column) { return $this->aggregate(__FUNCTION__, [$column]); } /** * Alias for the "avg" method. * * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @return mixed */ public function average($column) { return $this->avg($column); } /** * Execute an aggregate function on the database. * * @param string $function * @param array $columns * @return mixed */ public function aggregate($function, $columns = ['*']) { $results = $this->cloneWithout($this->unions || $this->havings ? [] : ['columns']) ->cloneWithoutBindings($this->unions || $this->havings ? [] : ['select']) ->setAggregate($function, $columns) ->get($columns); if (! $results->isEmpty()) { return array_change_key_case((array) $results[0])['aggregate']; } } /** * Execute a numeric aggregate function on the database. * * @param string $function * @param array $columns * @return float|int */ public function numericAggregate($function, $columns = ['*']) { $result = $this->aggregate($function, $columns); // If there is no result, we can obviously just return 0 here. Next, we will check // if the result is an integer or float. If it is already one of these two data // types we can just return the result as-is, otherwise we will convert this. if (! $result) { return 0; } if (is_int($result) || is_float($result)) { return $result; } // If the result doesn't contain a decimal place, we will assume it is an int then // cast it to one. When it does we will cast it to a float since it needs to be // cast to the expected data type for the developers out of pure convenience. return ! str_contains((string) $result, '.') ? (int) $result : (float) $result; } /** * Set the aggregate property without running the query. * * @param string $function * @param array<\Illuminate\Contracts\Database\Query\Expression|string> $columns * @return $this */ protected function setAggregate($function, $columns) { $this->aggregate = compact('function', 'columns'); if (empty($this->groups)) { $this->orders = null; $this->bindings['order'] = []; } return $this; } /** * Execute the given callback while selecting the given columns. * * After running the callback, the columns are reset to the original value. * * @template TResult * * @param array $columns * @param callable(): TResult $callback * @return TResult */ protected function onceWithColumns($columns, $callback) { $original = $this->columns; if (is_null($original)) { $this->columns = $columns; } $result = $callback(); $this->columns = $original; return $result; } /** * Insert new records into the database. * * @return bool */ public function insert(array $values) { // Since every insert gets treated like a batch insert, we will make sure the // bindings are structured in a way that is convenient when building these // inserts statements by verifying these elements are actually an array. if (empty($values)) { return true; } if (! is_array(array_first($values))) { $values = [$values]; } // Here, we will sort the insert keys for every record so that each insert is // in the same order for the record. We need to make sure this is the case // so there are not any errors or problems when inserting these records. else { foreach ($values as $key => $value) { ksort($value); $values[$key] = $value; } } $this->applyBeforeQueryCallbacks(); // Finally, we will run this query against the database connection and return // the results. We will need to also flatten these bindings before running // the query so they are all in one huge, flattened array for execution. return $this->connection->insert( $this->grammar->compileInsert($this, $values), $this->cleanBindings(Arr::flatten($values, 1)) ); } /** * Insert new records into the database while ignoring errors. * * @return int<0, max> */ public function insertOrIgnore(array $values) { if (empty($values)) { return 0; } if (! is_array(array_first($values))) { $values = [$values]; } else { foreach ($values as $key => $value) { ksort($value); $values[$key] = $value; } } $this->applyBeforeQueryCallbacks(); return $this->connection->affectingStatement( $this->grammar->compileInsertOrIgnore($this, $values), $this->cleanBindings(Arr::flatten($values, 1)) ); } /** * Insert a new record and get the value of the primary key. * * @param string|null $sequence * @return int */ public function insertGetId(array $values, $sequence = null) { $this->applyBeforeQueryCallbacks(); $sql = $this->grammar->compileInsertGetId($this, $values, $sequence); $values = $this->cleanBindings($values); return $this->processor->processInsertGetId($this, $sql, $values, $sequence); } /** * Insert new records into the table using a subquery. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|string $query * @return int */ public function insertUsing(array $columns, $query) { $this->applyBeforeQueryCallbacks(); [$sql, $bindings] = $this->createSub($query); return $this->connection->affectingStatement( $this->grammar->compileInsertUsing($this, $columns, $sql), $this->cleanBindings($bindings) ); } /** * Insert new records into the table using a subquery while ignoring errors. * * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder<*>|string $query * @return int */ public function insertOrIgnoreUsing(array $columns, $query) { $this->applyBeforeQueryCallbacks(); [$sql, $bindings] = $this->createSub($query); return $this->connection->affectingStatement( $this->grammar->compileInsertOrIgnoreUsing($this, $columns, $sql), $this->cleanBindings($bindings) ); } /** * Update records in the database. * * @return int<0, max> */ public function update(array $values) { $this->applyBeforeQueryCallbacks(); $values = (new Collection($values))->map(function ($value) { if (! $value instanceof Builder) { return ['value' => $value, 'bindings' => match (true) { $value instanceof Collection => $value->all(), $value instanceof UnitEnum => enum_value($value), default => $value, }]; } [$query, $bindings] = $this->parseSub($value); return ['value' => new Expression("({$query})"), 'bindings' => fn () => $bindings]; }); $sql = $this->grammar->compileUpdate($this, $values->map(fn ($value) => $value['value'])->all()); return $this->connection->update($sql, $this->cleanBindings( $this->grammar->prepareBindingsForUpdate($this->bindings, $values->map(fn ($value) => $value['bindings'])->all()) )); } /** * Update records in a PostgreSQL database using the update from syntax. * * @return int */ public function updateFrom(array $values) { if (! method_exists($this->grammar, 'compileUpdateFrom')) { throw new LogicException('This database engine does not support the updateFrom method.'); } $this->applyBeforeQueryCallbacks(); $sql = $this->grammar->compileUpdateFrom($this, $values); return $this->connection->update($sql, $this->cleanBindings( $this->grammar->prepareBindingsForUpdateFrom($this->bindings, $values) )); } /** * Insert or update a record matching the attributes, and fill it with values. * * @return bool */ public function updateOrInsert(array $attributes, array|callable $values = []) { $exists = $this->where($attributes)->exists(); if ($values instanceof Closure) { $values = $values($exists); } if (! $exists) { return $this->insert(array_merge($attributes, $values)); } if (empty($values)) { return true; } return (bool) $this->limit(1)->update($values); } /** * Insert new records or update the existing ones. * * @return int */ public function upsert(array $values, array|string $uniqueBy, ?array $update = null) { if (empty($values)) { return 0; } elseif ($update === []) { return (int) $this->insert($values); } if (! is_array(array_first($values))) { $values = [$values]; } else { foreach ($values as $key => $value) { ksort($value); $values[$key] = $value; } } if (is_null($update)) { $update = array_keys(array_first($values)); } $this->applyBeforeQueryCallbacks(); $bindings = $this->cleanBindings(array_merge( Arr::flatten($values, 1), (new Collection($update)) ->reject(fn ($value, $key) => is_int($key)) ->all() )); return $this->connection->affectingStatement( $this->grammar->compileUpsert($this, $values, (array) $uniqueBy, $update), $bindings ); } /** * Increment a column's value by a given amount. * * @param string $column * @param float|int $amount * @return int<0, max> * * @throws \InvalidArgumentException */ public function increment($column, $amount = 1, array $extra = []) { if (! is_numeric($amount)) { throw new InvalidArgumentException('Non-numeric value passed to increment method.'); } return $this->incrementEach([$column => $amount], $extra); } /** * Increment the given column's values by the given amounts. * * @param array $columns * @param array $extra * @return int<0, max> * * @throws \InvalidArgumentException */ public function incrementEach(array $columns, array $extra = []) { foreach ($columns as $column => $amount) { if (! is_numeric($amount)) { throw new InvalidArgumentException("Non-numeric value passed as increment amount for column: '$column'."); } elseif (! is_string($column)) { throw new InvalidArgumentException('Non-associative array passed to incrementEach method.'); } $columns[$column] = $this->raw("{$this->grammar->wrap($column)} + $amount"); } return $this->update(array_merge($columns, $extra)); } /** * Decrement a column's value by a given amount. * * @param string $column * @param float|int $amount * @return int<0, max> * * @throws \InvalidArgumentException */ public function decrement($column, $amount = 1, array $extra = []) { if (! is_numeric($amount)) { throw new InvalidArgumentException('Non-numeric value passed to decrement method.'); } return $this->decrementEach([$column => $amount], $extra); } /** * Decrement the given column's values by the given amounts. * * @param array $columns * @param array $extra * @return int<0, max> * * @throws \InvalidArgumentException */ public function decrementEach(array $columns, array $extra = []) { foreach ($columns as $column => $amount) { if (! is_numeric($amount)) { throw new InvalidArgumentException("Non-numeric value passed as decrement amount for column: '$column'."); } elseif (! is_string($column)) { throw new InvalidArgumentException('Non-associative array passed to decrementEach method.'); } $columns[$column] = $this->raw("{$this->grammar->wrap($column)} - $amount"); } return $this->update(array_merge($columns, $extra)); } /** * Delete records from the database. * * @param mixed $id * @return int */ public function delete($id = null) { // If an ID is passed to the method, we will set the where clause to check the // ID to let developers to simply and quickly remove a single row from this // database without manually specifying the "where" clauses on the query. if (! is_null($id)) { $this->where($this->from.'.id', '=', $id); } $this->applyBeforeQueryCallbacks(); return $this->connection->delete( $this->grammar->compileDelete($this), $this->cleanBindings( $this->grammar->prepareBindingsForDelete($this->bindings) ) ); } /** * Run a truncate statement on the table. * * @return void */ public function truncate() { $this->applyBeforeQueryCallbacks(); foreach ($this->grammar->compileTruncate($this) as $sql => $bindings) { $this->connection->statement($sql, $bindings); } } /** * Get a new instance of the query builder. * * @return \Illuminate\Database\Query\Builder */ public function newQuery() { return new static($this->connection, $this->grammar, $this->processor); } /** * Create a new query instance for a sub-query. * * @return \Illuminate\Database\Query\Builder */ protected function forSubQuery() { return $this->newQuery(); } /** * Get all of the query builder's columns in a text-only array with all expressions evaluated. * * @return list */ public function getColumns() { return ! is_null($this->columns) ? array_map(fn ($column) => $this->grammar->getValue($column), $this->columns) : []; } /** * Create a raw database expression. * * @param mixed $value * @return \Illuminate\Contracts\Database\Query\Expression */ public function raw($value) { return $this->connection->raw($value); } /** * Get the query builder instances that are used in the union of the query. * * @return \Illuminate\Support\Collection */ protected function getUnionBuilders() { return isset($this->unions) ? (new Collection($this->unions))->pluck('query') : new Collection; } /** * Get the "limit" value for the query or null if it's not set. * * @return mixed */ public function getLimit() { $value = $this->unions ? $this->unionLimit : $this->limit; return ! is_null($value) ? (int) $value : null; } /** * Get the "offset" value for the query or null if it's not set. * * @return mixed */ public function getOffset() { $value = $this->unions ? $this->unionOffset : $this->offset; return ! is_null($value) ? (int) $value : null; } /** * Get the current query value bindings in a flattened array. * * @return list */ public function getBindings() { return Arr::flatten($this->bindings); } /** * Get the raw array of bindings. * * @return array{ * select: list, * from: list, * join: list, * where: list, * groupBy: list, * having: list, * order: list, * union: list, * unionOrder: list, * } */ public function getRawBindings() { return $this->bindings; } /** * Set the bindings on the query builder. * * @param list $bindings * @param "select"|"from"|"join"|"where"|"groupBy"|"having"|"order"|"union"|"unionOrder" $type * @return $this * * @throws \InvalidArgumentException */ public function setBindings(array $bindings, $type = 'where') { if (! array_key_exists($type, $this->bindings)) { throw new InvalidArgumentException("Invalid binding type: {$type}."); } $this->bindings[$type] = $bindings; return $this; } /** * Add a binding to the query. * * @param mixed $value * @param "select"|"from"|"join"|"where"|"groupBy"|"having"|"order"|"union"|"unionOrder" $type * @return $this * * @throws \InvalidArgumentException */ public function addBinding($value, $type = 'where') { if (! array_key_exists($type, $this->bindings)) { throw new InvalidArgumentException("Invalid binding type: {$type}."); } if (is_array($value)) { $this->bindings[$type] = array_values(array_map( $this->castBinding(...), array_merge($this->bindings[$type], $value), )); } else { $this->bindings[$type][] = $this->castBinding($value); } return $this; } /** * Cast the given binding value. * * @param mixed $value * @return mixed */ public function castBinding($value) { if ($value instanceof UnitEnum) { return enum_value($value); } return $value; } /** * Merge an array of bindings into our bindings. * * @param self $query * @return $this */ public function mergeBindings(self $query) { $this->bindings = array_merge_recursive($this->bindings, $query->bindings); return $this; } /** * Remove all of the expressions from a list of bindings. * * @param array $bindings * @return list */ public function cleanBindings(array $bindings) { return (new Collection($bindings)) ->reject(function ($binding) { return $binding instanceof ExpressionContract; }) ->map($this->castBinding(...)) ->values() ->all(); } /** * Get a scalar type value from an unknown type of input. * * @param mixed $value * @return mixed */ protected function flattenValue($value) { return is_array($value) ? head(Arr::flatten($value)) : $value; } /** * Get the default key name of the table. * * @return string */ protected function defaultKeyName() { return 'id'; } /** * Get the database connection instance. * * @return \Illuminate\Database\ConnectionInterface */ public function getConnection() { return $this->connection; } /** * Get the database query processor instance. * * @return \Illuminate\Database\Query\Processors\Processor */ public function getProcessor() { return $this->processor; } /** * Get the query grammar instance. * * @return \Illuminate\Database\Query\Grammars\Grammar */ public function getGrammar() { return $this->grammar; } /** * Use the "write" PDO connection when executing the query. * * @return $this */ public function useWritePdo() { $this->useWritePdo = true; return $this; } /** * Determine if the value is a query builder instance or a Closure. * * @param mixed $value * @return bool */ protected function isQueryable($value) { return $value instanceof self || $value instanceof EloquentBuilder || $value instanceof Relation || $value instanceof Closure; } /** * Clone the query. * * @return static */ public function clone() { return clone $this; } /** * Clone the query without the given properties. * * @return static */ public function cloneWithout(array $properties) { return tap($this->clone(), function ($clone) use ($properties) { foreach ($properties as $property) { $clone->{$property} = null; } }); } /** * Clone the query without the given bindings. * * @return static */ public function cloneWithoutBindings(array $except) { return tap($this->clone(), function ($clone) use ($except) { foreach ($except as $type) { $clone->bindings[$type] = []; } }); } /** * Dump the current SQL and bindings. * * @param mixed ...$args * @return $this */ public function dump(...$args) { dump( $this->toSql(), $this->getBindings(), ...$args, ); return $this; } /** * Dump the raw current SQL with embedded bindings. * * @return $this */ public function dumpRawSql() { dump($this->toRawSql()); return $this; } /** * Die and dump the current SQL and bindings. * * @return never */ public function dd() { dd($this->toSql(), $this->getBindings()); } /** * Die and dump the current SQL with embedded bindings. * * @return never */ public function ddRawSql() { dd($this->toRawSql()); } /** * Handle dynamic method calls into the method. * * @param string $method * @param array $parameters * @return mixed * * @throws \BadMethodCallException */ public function __call($method, $parameters) { if (static::hasMacro($method)) { return $this->macroCall($method, $parameters); } if (str_starts_with($method, 'where')) { return $this->dynamicWhere($method, $parameters); } static::throwBadMethodCallException($method); } } syntax error, unexpected end of file (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php) (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php) (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php) (500 Internal Server Error)

Symfony Exception

syntax error, unexpected end of file (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php) (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php) (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php)

Exceptions 4

Illuminate\View\ ViewException

Show exception properties
Illuminate\View\ViewException {#1127
  #severity: E_ERROR
}
  1. <?php if ($component->shouldRender()): ?>
  2. <?php $__env->startComponent($component->resolveView(), $component->data()); ?>
  3. <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
  4. <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
  5. <?php endif; ?>
  6. <?php $component->withAttributes(['class' => 'w-3 h-3 text-blue-500 dark:text-emerald-500','x-show' => 'expanded'])
  1. // flush out any stray output that might get out before an error occurs or
  2. // an exception is thrown. This prevents any partial views from leaking.
  3. try {
  4. $this->files->getRequire($path, $data);
  5. } catch (Throwable $e) {
  6. $this->handleViewException($e, $obLevel);
  7. }
  8. return ltrim(ob_get_clean());
  9. }
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. ])->render();
  2. return $this->viewFactory->make('laravel-exceptions-renderer::show', [
  3. 'exception' => $exception,
  4. 'exceptionAsMarkdown' => $exceptionAsMarkdown,
  5. ])->render();
  6. }
  7. /**
  8. * Get the renderer's CSS content.
  9. *
  1. try {
  2. if (config('app.debug')) {
  3. if (app()->has(ExceptionRenderer::class)) {
  4. return $this->renderExceptionWithCustomRenderer($e);
  5. } elseif ($this->container->bound(Renderer::class)) {
  6. return $this->container->make(Renderer::class)->render(request(), $e);
  7. }
  8. }
  9. return $this->renderExceptionWithSymfony($e, config('app.debug'));
  10. } catch (Throwable $e) {
  1. * @return \Symfony\Component\HttpFoundation\Response
  2. */
  3. protected function convertExceptionToResponse(Throwable $e)
  4. {
  5. return new SymfonyResponse(
  6. $this->renderExceptionContent($e),
  7. $this->isHttpException($e) ? $e->getStatusCode() : 500,
  8. $this->isHttpException($e) ? $e->getHeaders() : []
  9. );
  10. }
  1. * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
  2. */
  3. protected function prepareResponse($request, Throwable $e)
  4. {
  5. if (! $this->isHttpException($e) && config('app.debug')) {
  6. return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e)->prepare($request);
  7. }
  8. if (! $this->isHttpException($e)) {
  9. $e = new HttpException(500, $e->getMessage(), $e);
  10. }
  1. */
  2. protected function renderExceptionResponse($request, Throwable $e)
  3. {
  4. return $this->shouldReturnJson($request, $e)
  5. ? $this->prepareJsonResponse($request, $e)
  6. : $this->prepareResponse($request, $e);
  7. }
  8. /**
  9. * Convert an authentication exception into a response.
  10. *
  1. return $this->finalizeRenderedResponse($request, match (true) {
  2. $e instanceof HttpResponseException => $e->getResponse(),
  3. $e instanceof AuthenticationException => $this->unauthenticated($request, $e),
  4. $e instanceof ValidationException => $this->convertValidationExceptionToResponse($e, $request),
  5. default => $this->renderExceptionResponse($request, $e),
  6. }, $e);
  7. }
  8. /**
  9. * Prepare the final, rendered response to be returned to the browser.
  1. $handler = $this->container->make(ExceptionHandler::class);
  2. $handler->report($e);
  3. $response = $handler->render($passable, $e);
  4. if (is_object($response) && method_exists($response, 'withException')) {
  5. $response->withException($e);
  6. }
  1. ? $pipe->{$this->method}(...$parameters)
  2. : $pipe(...$parameters);
  3. return $this->handleCarry($carry);
  4. } catch (Throwable $e) {
  5. return $this->handleException($passable, $e);
  6. }
  7. };
  8. };
  9. }
  1. * @param \Closure $next
  2. * @return mixed
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. $response = $next($request);
  7. foreach ($this->cookies->getQueuedCookies() as $cookie) {
  8. $response->headers->setCookie($cookie);
  9. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. return $this->encrypt($next($this->decrypt($request)));
  7. }
  8. /**
  9. * Decrypt the cookies on the request.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 137)
  1. );
  2. try {
  3. return $this->withinTransaction !== false
  4. ? $this->getContainer()->make('db')->connection($this->withinTransaction)->transaction(fn () => $pipeline($this->passable))
  5. : $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
  2. return (new Pipeline($this->container))
  3. ->send($request)
  4. ->through($middleware)
  5. ->then(fn ($request) => $this->prepareResponse(
  6. $request, $route->run()
  7. ));
  8. }
  9. /**
  1. $request->setRouteResolver(fn () => $route);
  2. $this->events->dispatch(new RouteMatched($route, $request));
  3. return $this->prepareResponse($request,
  4. $this->runRouteWithinStack($route, $request)
  5. );
  6. }
  7. /**
  8. * Run the given route within a Stack "onion" instance.
  1. * @param \Illuminate\Http\Request $request
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function dispatchToRoute(Request $request)
  5. {
  6. return $this->runRoute($request, $this->findRoute($request));
  7. }
  8. /**
  9. * Find the route matching a given request.
  10. *
  1. */
  2. public function dispatch(Request $request)
  3. {
  4. $this->currentRequest = $request;
  5. return $this->dispatchToRoute($request);
  6. }
  7. /**
  8. * Dispatch the request to a route and return the response.
  9. *
  1. protected function dispatchToRouter()
  2. {
  3. return function ($request) {
  4. $this->app->instance('request', $request);
  5. return $this->router->dispatch($request);
  6. };
  7. }
  8. /**
  9. * Call the terminate method on any terminable middleware.
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():197} (line 180)
  1. */
  2. protected function prepareDestination(Closure $destination)
  3. {
  4. return function ($passable) use ($destination) {
  5. try {
  6. return $destination($passable);
  7. } catch (Throwable $e) {
  8. return $this->handleException($passable, $e);
  9. }
  10. };
  11. }
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
  2. throw new PostTooLargeException('The POST data is too large.');
  3. }
  4. return $next($request);
  5. }
  6. /**
  7. * Determine the server 'post_max_size' as bytes.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. null,
  2. $this->getHeaders($data)
  3. );
  4. }
  5. return $next($request);
  6. }
  7. /**
  8. * Determine if the incoming request has a maintenance mode bypass cookie.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 48)
  1. * @return \Illuminate\Http\Response
  2. */
  3. public function handle($request, Closure $next)
  4. {
  5. if (! $this->hasMatchingPath($request)) {
  6. return $next($request);
  7. }
  8. $this->cors->setOptions($this->container['config']->get('cors', []));
  9. if ($this->cors->isPreflightRequest($request)) {
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 58)
  1. {
  2. $request::setTrustedProxies([], $this->getTrustedHeaderNames());
  3. $this->setTrustedProxyIpAddresses($request);
  4. return $next($request);
  5. }
  6. /**
  7. * Sets the trusted proxies on the request.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle(Request $request, Closure $next)
  5. {
  6. return $next($request);
  7. }
  8. /**
  9. * Invoke the deferred callbacks.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. if (! mb_check_encoding($decodedPath, 'UTF-8')) {
  2. throw new MalformedUrlException;
  3. }
  4. return $next($request);
  5. }
  6. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}() in /home/srv83227/domains/asted.cloud/public_html/app/Http/Middleware/NormalizeRequestPath.php (line 50)
  1. $normalizedPath = $trimmedPath;
  2. }
  3. }
  4. if ($normalizedPath === $path) {
  5. return $next($request);
  6. }
  7. $query = parse_url($requestUri, PHP_URL_QUERY);
  8. $normalizedUri = $normalizedPath . ($query ? '?' . $query : '');
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 137)
  1. );
  2. try {
  3. return $this->withinTransaction !== false
  4. ? $this->getContainer()->make('db')->connection($this->withinTransaction)->transaction(fn () => $pipeline($this->passable))
  5. : $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $this->bootstrap();
  2. return (new Pipeline($this->app))
  3. ->send($request)
  4. ->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
  5. ->then($this->dispatchToRouter());
  6. }
  7. /**
  8. * Bootstrap the application for HTTP requests.
  9. *
  1. $this->requestStartedAt = Carbon::now();
  2. try {
  3. $request->enableHttpMethodParameterOverride();
  4. $response = $this->sendRequestThroughRouter($request);
  5. } catch (Throwable $e) {
  6. $this->reportException($e);
  7. $response = $this->renderException($request, $e);
  8. }
  1. */
  2. public function handleRequest(Request $request)
  3. {
  4. $kernel = $this->make(HttpKernelContract::class);
  5. $response = $kernel->handle($request)->send();
  6. $kernel->terminate($request, $response);
  7. }
  8. /**
Application->handleRequest() in /home/srv83227/domains/asted.cloud/public_html/index.php (line 18)
  1. // Register the Composer autoloader...
  2. require __DIR__.'/vendor/autoload.php';
  3. $app = require_once __DIR__.'/bootstrap/app.php';
  4. $app->handleRequest(Request::capture());

Illuminate\View\ ViewException

syntax error, unexpected end of file (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php) (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php)

  1. <?php if ($component->shouldRender()): ?>
  2. <?php $__env->startComponent($component->resolveView(), $component->data()); ?>
  3. <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
  4. <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
  5. <?php endif; ?>
  6. <?php $component->withAttributes(['class' => 'w-3 h-3 text-blue-500 dark:text-emerald-500','x-show' => 'expanded'])
  1. // flush out any stray output that might get out before an error occurs or
  2. // an exception is thrown. This prevents any partial views from leaking.
  3. try {
  4. $this->files->getRequire($path, $data);
  5. } catch (Throwable $e) {
  6. $this->handleViewException($e, $obLevel);
  7. }
  8. return ltrim(ob_get_clean());
  9. }
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. if ($view instanceof View) {
  2. return $view->with($data)->render();
  3. } elseif ($view instanceof Htmlable) {
  4. return $view->toHtml();
  5. } else {
  6. return $this->make($view, $data)->render();
  7. }
  8. } finally {
  9. $this->currentComponentData = $previousComponentData;
  10. }
  11. }
  1. <?php $__env->startComponent($component->resolveView(), $component->data()); ?>
  2. <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
  3. <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
  4. <?php endif; ?>
  5. <?php $component->withAttributes(['exception' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($exception)]); ?>
  6. <?php echo $__env->renderComponent(); ?>
  7. <?php endif; ?>
  8. <?php if (isset($__attributesOriginal92c1a431b4816bac5d5a20d0fc1238ab)): ?>
  9. <?php $attributes = $__attributesOriginal92c1a431b4816bac5d5a20d0fc1238ab; ?>
  10. <?php unset($__attributesOriginal92c1a431b4816bac5d5a20d0fc1238ab); ?>
  11. <?php endif; ?>
  1. $__data = $data;
  2. return (static function () use ($__path, $__data) {
  3. extract($__data, EXTR_SKIP);
  4. return require $__path;
  5. })();
  6. }
  7. throw new FileNotFoundException("File does not exist at path {$path}.");
  8. }
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php :: {closure:Illuminate\Filesystem\Filesystem::getRequire():120} (line 124)
  1. return (static function () use ($__path, $__data) {
  2. extract($__data, EXTR_SKIP);
  3. return require $__path;
  4. })();
  5. }
  6. throw new FileNotFoundException("File does not exist at path {$path}.");
  7. }
  1. // We'll evaluate the contents of the view inside a try/catch block so we can
  2. // flush out any stray output that might get out before an error occurs or
  3. // an exception is thrown. This prevents any partial views from leaking.
  4. try {
  5. $this->files->getRequire($path, $data);
  6. } catch (Throwable $e) {
  7. $this->handleViewException($e, $obLevel);
  8. }
  9. return ltrim(ob_get_clean());
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. ])->render();
  2. return $this->viewFactory->make('laravel-exceptions-renderer::show', [
  3. 'exception' => $exception,
  4. 'exceptionAsMarkdown' => $exceptionAsMarkdown,
  5. ])->render();
  6. }
  7. /**
  8. * Get the renderer's CSS content.
  9. *
  1. try {
  2. if (config('app.debug')) {
  3. if (app()->has(ExceptionRenderer::class)) {
  4. return $this->renderExceptionWithCustomRenderer($e);
  5. } elseif ($this->container->bound(Renderer::class)) {
  6. return $this->container->make(Renderer::class)->render(request(), $e);
  7. }
  8. }
  9. return $this->renderExceptionWithSymfony($e, config('app.debug'));
  10. } catch (Throwable $e) {
  1. * @return \Symfony\Component\HttpFoundation\Response
  2. */
  3. protected function convertExceptionToResponse(Throwable $e)
  4. {
  5. return new SymfonyResponse(
  6. $this->renderExceptionContent($e),
  7. $this->isHttpException($e) ? $e->getStatusCode() : 500,
  8. $this->isHttpException($e) ? $e->getHeaders() : []
  9. );
  10. }
  1. * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
  2. */
  3. protected function prepareResponse($request, Throwable $e)
  4. {
  5. if (! $this->isHttpException($e) && config('app.debug')) {
  6. return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e)->prepare($request);
  7. }
  8. if (! $this->isHttpException($e)) {
  9. $e = new HttpException(500, $e->getMessage(), $e);
  10. }
  1. */
  2. protected function renderExceptionResponse($request, Throwable $e)
  3. {
  4. return $this->shouldReturnJson($request, $e)
  5. ? $this->prepareJsonResponse($request, $e)
  6. : $this->prepareResponse($request, $e);
  7. }
  8. /**
  9. * Convert an authentication exception into a response.
  10. *
  1. return $this->finalizeRenderedResponse($request, match (true) {
  2. $e instanceof HttpResponseException => $e->getResponse(),
  3. $e instanceof AuthenticationException => $this->unauthenticated($request, $e),
  4. $e instanceof ValidationException => $this->convertValidationExceptionToResponse($e, $request),
  5. default => $this->renderExceptionResponse($request, $e),
  6. }, $e);
  7. }
  8. /**
  9. * Prepare the final, rendered response to be returned to the browser.
  1. $handler = $this->container->make(ExceptionHandler::class);
  2. $handler->report($e);
  3. $response = $handler->render($passable, $e);
  4. if (is_object($response) && method_exists($response, 'withException')) {
  5. $response->withException($e);
  6. }
  1. ? $pipe->{$this->method}(...$parameters)
  2. : $pipe(...$parameters);
  3. return $this->handleCarry($carry);
  4. } catch (Throwable $e) {
  5. return $this->handleException($passable, $e);
  6. }
  7. };
  8. };
  9. }
  1. * @param \Closure $next
  2. * @return mixed
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. $response = $next($request);
  7. foreach ($this->cookies->getQueuedCookies() as $cookie) {
  8. $response->headers->setCookie($cookie);
  9. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. return $this->encrypt($next($this->decrypt($request)));
  7. }
  8. /**
  9. * Decrypt the cookies on the request.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 137)
  1. );
  2. try {
  3. return $this->withinTransaction !== false
  4. ? $this->getContainer()->make('db')->connection($this->withinTransaction)->transaction(fn () => $pipeline($this->passable))
  5. : $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
  2. return (new Pipeline($this->container))
  3. ->send($request)
  4. ->through($middleware)
  5. ->then(fn ($request) => $this->prepareResponse(
  6. $request, $route->run()
  7. ));
  8. }
  9. /**
  1. $request->setRouteResolver(fn () => $route);
  2. $this->events->dispatch(new RouteMatched($route, $request));
  3. return $this->prepareResponse($request,
  4. $this->runRouteWithinStack($route, $request)
  5. );
  6. }
  7. /**
  8. * Run the given route within a Stack "onion" instance.
  1. * @param \Illuminate\Http\Request $request
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function dispatchToRoute(Request $request)
  5. {
  6. return $this->runRoute($request, $this->findRoute($request));
  7. }
  8. /**
  9. * Find the route matching a given request.
  10. *
  1. */
  2. public function dispatch(Request $request)
  3. {
  4. $this->currentRequest = $request;
  5. return $this->dispatchToRoute($request);
  6. }
  7. /**
  8. * Dispatch the request to a route and return the response.
  9. *
  1. protected function dispatchToRouter()
  2. {
  3. return function ($request) {
  4. $this->app->instance('request', $request);
  5. return $this->router->dispatch($request);
  6. };
  7. }
  8. /**
  9. * Call the terminate method on any terminable middleware.
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():197} (line 180)
  1. */
  2. protected function prepareDestination(Closure $destination)
  3. {
  4. return function ($passable) use ($destination) {
  5. try {
  6. return $destination($passable);
  7. } catch (Throwable $e) {
  8. return $this->handleException($passable, $e);
  9. }
  10. };
  11. }
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
  2. throw new PostTooLargeException('The POST data is too large.');
  3. }
  4. return $next($request);
  5. }
  6. /**
  7. * Determine the server 'post_max_size' as bytes.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. null,
  2. $this->getHeaders($data)
  3. );
  4. }
  5. return $next($request);
  6. }
  7. /**
  8. * Determine if the incoming request has a maintenance mode bypass cookie.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 48)
  1. * @return \Illuminate\Http\Response
  2. */
  3. public function handle($request, Closure $next)
  4. {
  5. if (! $this->hasMatchingPath($request)) {
  6. return $next($request);
  7. }
  8. $this->cors->setOptions($this->container['config']->get('cors', []));
  9. if ($this->cors->isPreflightRequest($request)) {
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 58)
  1. {
  2. $request::setTrustedProxies([], $this->getTrustedHeaderNames());
  3. $this->setTrustedProxyIpAddresses($request);
  4. return $next($request);
  5. }
  6. /**
  7. * Sets the trusted proxies on the request.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle(Request $request, Closure $next)
  5. {
  6. return $next($request);
  7. }
  8. /**
  9. * Invoke the deferred callbacks.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. if (! mb_check_encoding($decodedPath, 'UTF-8')) {
  2. throw new MalformedUrlException;
  3. }
  4. return $next($request);
  5. }
  6. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}() in /home/srv83227/domains/asted.cloud/public_html/app/Http/Middleware/NormalizeRequestPath.php (line 50)
  1. $normalizedPath = $trimmedPath;
  2. }
  3. }
  4. if ($normalizedPath === $path) {
  5. return $next($request);
  6. }
  7. $query = parse_url($requestUri, PHP_URL_QUERY);
  8. $normalizedUri = $normalizedPath . ($query ? '?' . $query : '');
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 137)
  1. );
  2. try {
  3. return $this->withinTransaction !== false
  4. ? $this->getContainer()->make('db')->connection($this->withinTransaction)->transaction(fn () => $pipeline($this->passable))
  5. : $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $this->bootstrap();
  2. return (new Pipeline($this->app))
  3. ->send($request)
  4. ->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
  5. ->then($this->dispatchToRouter());
  6. }
  7. /**
  8. * Bootstrap the application for HTTP requests.
  9. *
  1. $this->requestStartedAt = Carbon::now();
  2. try {
  3. $request->enableHttpMethodParameterOverride();
  4. $response = $this->sendRequestThroughRouter($request);
  5. } catch (Throwable $e) {
  6. $this->reportException($e);
  7. $response = $this->renderException($request, $e);
  8. }
  1. */
  2. public function handleRequest(Request $request)
  3. {
  4. $kernel = $this->make(HttpKernelContract::class);
  5. $response = $kernel->handle($request)->send();
  6. $kernel->terminate($request, $response);
  7. }
  8. /**
Application->handleRequest() in /home/srv83227/domains/asted.cloud/public_html/index.php (line 18)
  1. // Register the Composer autoloader...
  2. require __DIR__.'/vendor/autoload.php';
  3. $app = require_once __DIR__.'/bootstrap/app.php';
  4. $app->handleRequest(Request::capture());

Illuminate\View\ ViewException

syntax error, unexpected end of file (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php)

  1. <?php if ($component->shouldRender()): ?>
  2. <?php $__env->startComponent($component->resolveView(), $component->data()); ?>
  3. <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
  4. <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
  5. <?php endif; ?>
  6. <?php $component->withAttributes(['class' => 'w-3 h-3 text-blue-500 dark:text-emerald-500','x-show' => 'expanded'])
  1. // flush out any stray output that might get out before an error occurs or
  2. // an exception is thrown. This prevents any partial views from leaking.
  3. try {
  4. $this->files->getRequire($path, $data);
  5. } catch (Throwable $e) {
  6. $this->handleViewException($e, $obLevel);
  7. }
  8. return ltrim(ob_get_clean());
  9. }
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. if ($view instanceof View) {
  2. return $view->with($data)->render();
  3. } elseif ($view instanceof Htmlable) {
  4. return $view->toHtml();
  5. } else {
  6. return $this->make($view, $data)->render();
  7. }
  8. } finally {
  9. $this->currentComponentData = $previousComponentData;
  10. }
  11. }
  1. <?php $__env->startComponent($component->resolveView(), $component->data()); ?>
  2. <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
  3. <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
  4. <?php endif; ?>
  5. <?php $component->withAttributes(['frames' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($group['frames'])]); ?>
  6. <?php echo $__env->renderComponent(); ?>
  7. <?php endif; ?>
  8. <?php if (isset($__attributesOriginal449787012edfba29f0e80f325065fad5)): ?>
  9. <?php $attributes = $__attributesOriginal449787012edfba29f0e80f325065fad5; ?>
  10. <?php unset($__attributesOriginal449787012edfba29f0e80f325065fad5); ?>
  11. <?php endif; ?>
  1. $__data = $data;
  2. return (static function () use ($__path, $__data) {
  3. extract($__data, EXTR_SKIP);
  4. return require $__path;
  5. })();
  6. }
  7. throw new FileNotFoundException("File does not exist at path {$path}.");
  8. }
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php :: {closure:Illuminate\Filesystem\Filesystem::getRequire():120} (line 124)
  1. return (static function () use ($__path, $__data) {
  2. extract($__data, EXTR_SKIP);
  3. return require $__path;
  4. })();
  5. }
  6. throw new FileNotFoundException("File does not exist at path {$path}.");
  7. }
  1. // We'll evaluate the contents of the view inside a try/catch block so we can
  2. // flush out any stray output that might get out before an error occurs or
  3. // an exception is thrown. This prevents any partial views from leaking.
  4. try {
  5. $this->files->getRequire($path, $data);
  6. } catch (Throwable $e) {
  7. $this->handleViewException($e, $obLevel);
  8. }
  9. return ltrim(ob_get_clean());
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. if ($view instanceof View) {
  2. return $view->with($data)->render();
  3. } elseif ($view instanceof Htmlable) {
  4. return $view->toHtml();
  5. } else {
  6. return $this->make($view, $data)->render();
  7. }
  8. } finally {
  9. $this->currentComponentData = $previousComponentData;
  10. }
  11. }
  1. <?php $__env->startComponent($component->resolveView(), $component->data()); ?>
  2. <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
  3. <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
  4. <?php endif; ?>
  5. <?php $component->withAttributes(['exception' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($exception)]); ?>
  6. <?php echo $__env->renderComponent(); ?>
  7. <?php endif; ?>
  8. <?php if (isset($__attributesOriginal92c1a431b4816bac5d5a20d0fc1238ab)): ?>
  9. <?php $attributes = $__attributesOriginal92c1a431b4816bac5d5a20d0fc1238ab; ?>
  10. <?php unset($__attributesOriginal92c1a431b4816bac5d5a20d0fc1238ab); ?>
  11. <?php endif; ?>
  1. $__data = $data;
  2. return (static function () use ($__path, $__data) {
  3. extract($__data, EXTR_SKIP);
  4. return require $__path;
  5. })();
  6. }
  7. throw new FileNotFoundException("File does not exist at path {$path}.");
  8. }
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php :: {closure:Illuminate\Filesystem\Filesystem::getRequire():120} (line 124)
  1. return (static function () use ($__path, $__data) {
  2. extract($__data, EXTR_SKIP);
  3. return require $__path;
  4. })();
  5. }
  6. throw new FileNotFoundException("File does not exist at path {$path}.");
  7. }
  1. // We'll evaluate the contents of the view inside a try/catch block so we can
  2. // flush out any stray output that might get out before an error occurs or
  3. // an exception is thrown. This prevents any partial views from leaking.
  4. try {
  5. $this->files->getRequire($path, $data);
  6. } catch (Throwable $e) {
  7. $this->handleViewException($e, $obLevel);
  8. }
  9. return ltrim(ob_get_clean());
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. ])->render();
  2. return $this->viewFactory->make('laravel-exceptions-renderer::show', [
  3. 'exception' => $exception,
  4. 'exceptionAsMarkdown' => $exceptionAsMarkdown,
  5. ])->render();
  6. }
  7. /**
  8. * Get the renderer's CSS content.
  9. *
  1. try {
  2. if (config('app.debug')) {
  3. if (app()->has(ExceptionRenderer::class)) {
  4. return $this->renderExceptionWithCustomRenderer($e);
  5. } elseif ($this->container->bound(Renderer::class)) {
  6. return $this->container->make(Renderer::class)->render(request(), $e);
  7. }
  8. }
  9. return $this->renderExceptionWithSymfony($e, config('app.debug'));
  10. } catch (Throwable $e) {
  1. * @return \Symfony\Component\HttpFoundation\Response
  2. */
  3. protected function convertExceptionToResponse(Throwable $e)
  4. {
  5. return new SymfonyResponse(
  6. $this->renderExceptionContent($e),
  7. $this->isHttpException($e) ? $e->getStatusCode() : 500,
  8. $this->isHttpException($e) ? $e->getHeaders() : []
  9. );
  10. }
  1. * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
  2. */
  3. protected function prepareResponse($request, Throwable $e)
  4. {
  5. if (! $this->isHttpException($e) && config('app.debug')) {
  6. return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e)->prepare($request);
  7. }
  8. if (! $this->isHttpException($e)) {
  9. $e = new HttpException(500, $e->getMessage(), $e);
  10. }
  1. */
  2. protected function renderExceptionResponse($request, Throwable $e)
  3. {
  4. return $this->shouldReturnJson($request, $e)
  5. ? $this->prepareJsonResponse($request, $e)
  6. : $this->prepareResponse($request, $e);
  7. }
  8. /**
  9. * Convert an authentication exception into a response.
  10. *
  1. return $this->finalizeRenderedResponse($request, match (true) {
  2. $e instanceof HttpResponseException => $e->getResponse(),
  3. $e instanceof AuthenticationException => $this->unauthenticated($request, $e),
  4. $e instanceof ValidationException => $this->convertValidationExceptionToResponse($e, $request),
  5. default => $this->renderExceptionResponse($request, $e),
  6. }, $e);
  7. }
  8. /**
  9. * Prepare the final, rendered response to be returned to the browser.
  1. $handler = $this->container->make(ExceptionHandler::class);
  2. $handler->report($e);
  3. $response = $handler->render($passable, $e);
  4. if (is_object($response) && method_exists($response, 'withException')) {
  5. $response->withException($e);
  6. }
  1. ? $pipe->{$this->method}(...$parameters)
  2. : $pipe(...$parameters);
  3. return $this->handleCarry($carry);
  4. } catch (Throwable $e) {
  5. return $this->handleException($passable, $e);
  6. }
  7. };
  8. };
  9. }
  1. * @param \Closure $next
  2. * @return mixed
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. $response = $next($request);
  7. foreach ($this->cookies->getQueuedCookies() as $cookie) {
  8. $response->headers->setCookie($cookie);
  9. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. return $this->encrypt($next($this->decrypt($request)));
  7. }
  8. /**
  9. * Decrypt the cookies on the request.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 137)
  1. );
  2. try {
  3. return $this->withinTransaction !== false
  4. ? $this->getContainer()->make('db')->connection($this->withinTransaction)->transaction(fn () => $pipeline($this->passable))
  5. : $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
  2. return (new Pipeline($this->container))
  3. ->send($request)
  4. ->through($middleware)
  5. ->then(fn ($request) => $this->prepareResponse(
  6. $request, $route->run()
  7. ));
  8. }
  9. /**
  1. $request->setRouteResolver(fn () => $route);
  2. $this->events->dispatch(new RouteMatched($route, $request));
  3. return $this->prepareResponse($request,
  4. $this->runRouteWithinStack($route, $request)
  5. );
  6. }
  7. /**
  8. * Run the given route within a Stack "onion" instance.
  1. * @param \Illuminate\Http\Request $request
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function dispatchToRoute(Request $request)
  5. {
  6. return $this->runRoute($request, $this->findRoute($request));
  7. }
  8. /**
  9. * Find the route matching a given request.
  10. *
  1. */
  2. public function dispatch(Request $request)
  3. {
  4. $this->currentRequest = $request;
  5. return $this->dispatchToRoute($request);
  6. }
  7. /**
  8. * Dispatch the request to a route and return the response.
  9. *
  1. protected function dispatchToRouter()
  2. {
  3. return function ($request) {
  4. $this->app->instance('request', $request);
  5. return $this->router->dispatch($request);
  6. };
  7. }
  8. /**
  9. * Call the terminate method on any terminable middleware.
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():197} (line 180)
  1. */
  2. protected function prepareDestination(Closure $destination)
  3. {
  4. return function ($passable) use ($destination) {
  5. try {
  6. return $destination($passable);
  7. } catch (Throwable $e) {
  8. return $this->handleException($passable, $e);
  9. }
  10. };
  11. }
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
  2. throw new PostTooLargeException('The POST data is too large.');
  3. }
  4. return $next($request);
  5. }
  6. /**
  7. * Determine the server 'post_max_size' as bytes.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. null,
  2. $this->getHeaders($data)
  3. );
  4. }
  5. return $next($request);
  6. }
  7. /**
  8. * Determine if the incoming request has a maintenance mode bypass cookie.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 48)
  1. * @return \Illuminate\Http\Response
  2. */
  3. public function handle($request, Closure $next)
  4. {
  5. if (! $this->hasMatchingPath($request)) {
  6. return $next($request);
  7. }
  8. $this->cors->setOptions($this->container['config']->get('cors', []));
  9. if ($this->cors->isPreflightRequest($request)) {
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 58)
  1. {
  2. $request::setTrustedProxies([], $this->getTrustedHeaderNames());
  3. $this->setTrustedProxyIpAddresses($request);
  4. return $next($request);
  5. }
  6. /**
  7. * Sets the trusted proxies on the request.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle(Request $request, Closure $next)
  5. {
  6. return $next($request);
  7. }
  8. /**
  9. * Invoke the deferred callbacks.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. if (! mb_check_encoding($decodedPath, 'UTF-8')) {
  2. throw new MalformedUrlException;
  3. }
  4. return $next($request);
  5. }
  6. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}() in /home/srv83227/domains/asted.cloud/public_html/app/Http/Middleware/NormalizeRequestPath.php (line 50)
  1. $normalizedPath = $trimmedPath;
  2. }
  3. }
  4. if ($normalizedPath === $path) {
  5. return $next($request);
  6. }
  7. $query = parse_url($requestUri, PHP_URL_QUERY);
  8. $normalizedUri = $normalizedPath . ($query ? '?' . $query : '');
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 137)
  1. );
  2. try {
  3. return $this->withinTransaction !== false
  4. ? $this->getContainer()->make('db')->connection($this->withinTransaction)->transaction(fn () => $pipeline($this->passable))
  5. : $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $this->bootstrap();
  2. return (new Pipeline($this->app))
  3. ->send($request)
  4. ->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
  5. ->then($this->dispatchToRouter());
  6. }
  7. /**
  8. * Bootstrap the application for HTTP requests.
  9. *
  1. $this->requestStartedAt = Carbon::now();
  2. try {
  3. $request->enableHttpMethodParameterOverride();
  4. $response = $this->sendRequestThroughRouter($request);
  5. } catch (Throwable $e) {
  6. $this->reportException($e);
  7. $response = $this->renderException($request, $e);
  8. }
  1. */
  2. public function handleRequest(Request $request)
  3. {
  4. $kernel = $this->make(HttpKernelContract::class);
  5. $response = $kernel->handle($request)->send();
  6. $kernel->terminate($request, $response);
  7. }
  8. /**
Application->handleRequest() in /home/srv83227/domains/asted.cloud/public_html/index.php (line 18)
  1. // Register the Composer autoloader...
  2. require __DIR__.'/vendor/autoload.php';
  3. $app = require_once __DIR__.'/bootstrap/app.php';
  4. $app->handleRequest(Request::capture());

ParseError

syntax error, unexpected end of file

  1. <?php if ($component->shouldRender()): ?>
  2. <?php $__env->startComponent($component->resolveView(), $component->data()); ?>
  3. <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
  4. <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
  5. <?php endif; ?>
  6. <?php $component->withAttributes(['class' => 'w-3 h-3 text-blue-500 dark:text-emerald-500','x-show' => 'expanded'])
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php :: {closure:Illuminate\Filesystem\Filesystem::getRequire():120} (line 124)
  1. return (static function () use ($__path, $__data) {
  2. extract($__data, EXTR_SKIP);
  3. return require $__path;
  4. })();
  5. }
  6. throw new FileNotFoundException("File does not exist at path {$path}.");
  7. }
  1. // We'll evaluate the contents of the view inside a try/catch block so we can
  2. // flush out any stray output that might get out before an error occurs or
  3. // an exception is thrown. This prevents any partial views from leaking.
  4. try {
  5. $this->files->getRequire($path, $data);
  6. } catch (Throwable $e) {
  7. $this->handleViewException($e, $obLevel);
  8. }
  9. return ltrim(ob_get_clean());
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. if ($view instanceof View) {
  2. return $view->with($data)->render();
  3. } elseif ($view instanceof Htmlable) {
  4. return $view->toHtml();
  5. } else {
  6. return $this->make($view, $data)->render();
  7. }
  8. } finally {
  9. $this->currentComponentData = $previousComponentData;
  10. }
  11. }
  1. <?php $__env->startComponent($component->resolveView(), $component->data()); ?>
  2. <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
  3. <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
  4. <?php endif; ?>
  5. <?php $component->withAttributes(['frames' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($group['frames'])]); ?>
  6. <?php echo $__env->renderComponent(); ?>
  7. <?php endif; ?>
  8. <?php if (isset($__attributesOriginal449787012edfba29f0e80f325065fad5)): ?>
  9. <?php $attributes = $__attributesOriginal449787012edfba29f0e80f325065fad5; ?>
  10. <?php unset($__attributesOriginal449787012edfba29f0e80f325065fad5); ?>
  11. <?php endif; ?>
  1. $__data = $data;
  2. return (static function () use ($__path, $__data) {
  3. extract($__data, EXTR_SKIP);
  4. return require $__path;
  5. })();
  6. }
  7. throw new FileNotFoundException("File does not exist at path {$path}.");
  8. }
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php :: {closure:Illuminate\Filesystem\Filesystem::getRequire():120} (line 124)
  1. return (static function () use ($__path, $__data) {
  2. extract($__data, EXTR_SKIP);
  3. return require $__path;
  4. })();
  5. }
  6. throw new FileNotFoundException("File does not exist at path {$path}.");
  7. }
  1. // We'll evaluate the contents of the view inside a try/catch block so we can
  2. // flush out any stray output that might get out before an error occurs or
  3. // an exception is thrown. This prevents any partial views from leaking.
  4. try {
  5. $this->files->getRequire($path, $data);
  6. } catch (Throwable $e) {
  7. $this->handleViewException($e, $obLevel);
  8. }
  9. return ltrim(ob_get_clean());
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. if ($view instanceof View) {
  2. return $view->with($data)->render();
  3. } elseif ($view instanceof Htmlable) {
  4. return $view->toHtml();
  5. } else {
  6. return $this->make($view, $data)->render();
  7. }
  8. } finally {
  9. $this->currentComponentData = $previousComponentData;
  10. }
  11. }
  1. <?php $__env->startComponent($component->resolveView(), $component->data()); ?>
  2. <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
  3. <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
  4. <?php endif; ?>
  5. <?php $component->withAttributes(['exception' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($exception)]); ?>
  6. <?php echo $__env->renderComponent(); ?>
  7. <?php endif; ?>
  8. <?php if (isset($__attributesOriginal92c1a431b4816bac5d5a20d0fc1238ab)): ?>
  9. <?php $attributes = $__attributesOriginal92c1a431b4816bac5d5a20d0fc1238ab; ?>
  10. <?php unset($__attributesOriginal92c1a431b4816bac5d5a20d0fc1238ab); ?>
  11. <?php endif; ?>
  1. $__data = $data;
  2. return (static function () use ($__path, $__data) {
  3. extract($__data, EXTR_SKIP);
  4. return require $__path;
  5. })();
  6. }
  7. throw new FileNotFoundException("File does not exist at path {$path}.");
  8. }
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php :: {closure:Illuminate\Filesystem\Filesystem::getRequire():120} (line 124)
  1. return (static function () use ($__path, $__data) {
  2. extract($__data, EXTR_SKIP);
  3. return require $__path;
  4. })();
  5. }
  6. throw new FileNotFoundException("File does not exist at path {$path}.");
  7. }
  1. // We'll evaluate the contents of the view inside a try/catch block so we can
  2. // flush out any stray output that might get out before an error occurs or
  3. // an exception is thrown. This prevents any partial views from leaking.
  4. try {
  5. $this->files->getRequire($path, $data);
  6. } catch (Throwable $e) {
  7. $this->handleViewException($e, $obLevel);
  8. }
  9. return ltrim(ob_get_clean());
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. ])->render();
  2. return $this->viewFactory->make('laravel-exceptions-renderer::show', [
  3. 'exception' => $exception,
  4. 'exceptionAsMarkdown' => $exceptionAsMarkdown,
  5. ])->render();
  6. }
  7. /**
  8. * Get the renderer's CSS content.
  9. *
  1. try {
  2. if (config('app.debug')) {
  3. if (app()->has(ExceptionRenderer::class)) {
  4. return $this->renderExceptionWithCustomRenderer($e);
  5. } elseif ($this->container->bound(Renderer::class)) {
  6. return $this->container->make(Renderer::class)->render(request(), $e);
  7. }
  8. }
  9. return $this->renderExceptionWithSymfony($e, config('app.debug'));
  10. } catch (Throwable $e) {
  1. * @return \Symfony\Component\HttpFoundation\Response
  2. */
  3. protected function convertExceptionToResponse(Throwable $e)
  4. {
  5. return new SymfonyResponse(
  6. $this->renderExceptionContent($e),
  7. $this->isHttpException($e) ? $e->getStatusCode() : 500,
  8. $this->isHttpException($e) ? $e->getHeaders() : []
  9. );
  10. }
  1. * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
  2. */
  3. protected function prepareResponse($request, Throwable $e)
  4. {
  5. if (! $this->isHttpException($e) && config('app.debug')) {
  6. return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e)->prepare($request);
  7. }
  8. if (! $this->isHttpException($e)) {
  9. $e = new HttpException(500, $e->getMessage(), $e);
  10. }
  1. */
  2. protected function renderExceptionResponse($request, Throwable $e)
  3. {
  4. return $this->shouldReturnJson($request, $e)
  5. ? $this->prepareJsonResponse($request, $e)
  6. : $this->prepareResponse($request, $e);
  7. }
  8. /**
  9. * Convert an authentication exception into a response.
  10. *
  1. return $this->finalizeRenderedResponse($request, match (true) {
  2. $e instanceof HttpResponseException => $e->getResponse(),
  3. $e instanceof AuthenticationException => $this->unauthenticated($request, $e),
  4. $e instanceof ValidationException => $this->convertValidationExceptionToResponse($e, $request),
  5. default => $this->renderExceptionResponse($request, $e),
  6. }, $e);
  7. }
  8. /**
  9. * Prepare the final, rendered response to be returned to the browser.
  1. $handler = $this->container->make(ExceptionHandler::class);
  2. $handler->report($e);
  3. $response = $handler->render($passable, $e);
  4. if (is_object($response) && method_exists($response, 'withException')) {
  5. $response->withException($e);
  6. }
  1. ? $pipe->{$this->method}(...$parameters)
  2. : $pipe(...$parameters);
  3. return $this->handleCarry($carry);
  4. } catch (Throwable $e) {
  5. return $this->handleException($passable, $e);
  6. }
  7. };
  8. };
  9. }
  1. * @param \Closure $next
  2. * @return mixed
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. $response = $next($request);
  7. foreach ($this->cookies->getQueuedCookies() as $cookie) {
  8. $response->headers->setCookie($cookie);
  9. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. return $this->encrypt($next($this->decrypt($request)));
  7. }
  8. /**
  9. * Decrypt the cookies on the request.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 137)
  1. );
  2. try {
  3. return $this->withinTransaction !== false
  4. ? $this->getContainer()->make('db')->connection($this->withinTransaction)->transaction(fn () => $pipeline($this->passable))
  5. : $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
  2. return (new Pipeline($this->container))
  3. ->send($request)
  4. ->through($middleware)
  5. ->then(fn ($request) => $this->prepareResponse(
  6. $request, $route->run()
  7. ));
  8. }
  9. /**
  1. $request->setRouteResolver(fn () => $route);
  2. $this->events->dispatch(new RouteMatched($route, $request));
  3. return $this->prepareResponse($request,
  4. $this->runRouteWithinStack($route, $request)
  5. );
  6. }
  7. /**
  8. * Run the given route within a Stack "onion" instance.
  1. * @param \Illuminate\Http\Request $request
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function dispatchToRoute(Request $request)
  5. {
  6. return $this->runRoute($request, $this->findRoute($request));
  7. }
  8. /**
  9. * Find the route matching a given request.
  10. *
  1. */
  2. public function dispatch(Request $request)
  3. {
  4. $this->currentRequest = $request;
  5. return $this->dispatchToRoute($request);
  6. }
  7. /**
  8. * Dispatch the request to a route and return the response.
  9. *
  1. protected function dispatchToRouter()
  2. {
  3. return function ($request) {
  4. $this->app->instance('request', $request);
  5. return $this->router->dispatch($request);
  6. };
  7. }
  8. /**
  9. * Call the terminate method on any terminable middleware.
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():197} (line 180)
  1. */
  2. protected function prepareDestination(Closure $destination)
  3. {
  4. return function ($passable) use ($destination) {
  5. try {
  6. return $destination($passable);
  7. } catch (Throwable $e) {
  8. return $this->handleException($passable, $e);
  9. }
  10. };
  11. }
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
  2. throw new PostTooLargeException('The POST data is too large.');
  3. }
  4. return $next($request);
  5. }
  6. /**
  7. * Determine the server 'post_max_size' as bytes.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. null,
  2. $this->getHeaders($data)
  3. );
  4. }
  5. return $next($request);
  6. }
  7. /**
  8. * Determine if the incoming request has a maintenance mode bypass cookie.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 48)
  1. * @return \Illuminate\Http\Response
  2. */
  3. public function handle($request, Closure $next)
  4. {
  5. if (! $this->hasMatchingPath($request)) {
  6. return $next($request);
  7. }
  8. $this->cors->setOptions($this->container['config']->get('cors', []));
  9. if ($this->cors->isPreflightRequest($request)) {
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 58)
  1. {
  2. $request::setTrustedProxies([], $this->getTrustedHeaderNames());
  3. $this->setTrustedProxyIpAddresses($request);
  4. return $next($request);
  5. }
  6. /**
  7. * Sets the trusted proxies on the request.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle(Request $request, Closure $next)
  5. {
  6. return $next($request);
  7. }
  8. /**
  9. * Invoke the deferred callbacks.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. if (! mb_check_encoding($decodedPath, 'UTF-8')) {
  2. throw new MalformedUrlException;
  3. }
  4. return $next($request);
  5. }
  6. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}() in /home/srv83227/domains/asted.cloud/public_html/app/Http/Middleware/NormalizeRequestPath.php (line 50)
  1. $normalizedPath = $trimmedPath;
  2. }
  3. }
  4. if ($normalizedPath === $path) {
  5. return $next($request);
  6. }
  7. $query = parse_url($requestUri, PHP_URL_QUERY);
  8. $normalizedUri = $normalizedPath . ($query ? '?' . $query : '');
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
in /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php -> {closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195} (line 137)
  1. );
  2. try {
  3. return $this->withinTransaction !== false
  4. ? $this->getContainer()->make('db')->connection($this->withinTransaction)->transaction(fn () => $pipeline($this->passable))
  5. : $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $this->bootstrap();
  2. return (new Pipeline($this->app))
  3. ->send($request)
  4. ->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
  5. ->then($this->dispatchToRouter());
  6. }
  7. /**
  8. * Bootstrap the application for HTTP requests.
  9. *
  1. $this->requestStartedAt = Carbon::now();
  2. try {
  3. $request->enableHttpMethodParameterOverride();
  4. $response = $this->sendRequestThroughRouter($request);
  5. } catch (Throwable $e) {
  6. $this->reportException($e);
  7. $response = $this->renderException($request, $e);
  8. }
  1. */
  2. public function handleRequest(Request $request)
  3. {
  4. $kernel = $this->make(HttpKernelContract::class);
  5. $response = $kernel->handle($request)->send();
  6. $kernel->terminate($request, $response);
  7. }
  8. /**
Application->handleRequest() in /home/srv83227/domains/asted.cloud/public_html/index.php (line 18)
  1. // Register the Composer autoloader...
  2. require __DIR__.'/vendor/autoload.php';
  3. $app = require_once __DIR__.'/bootstrap/app.php';
  4. $app->handleRequest(Request::capture());

Stack Traces 4

[4/4] ViewException
Illuminate\View\ViewException:
syntax error, unexpected end of file (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php) (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php) (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php)

  at /home/srv83227/domains/asted.cloud/public_html/storage/framework/views/4152b4a132c5d138c0a225cc8dfb49be.php:74
  at Illuminate\View\Engines\CompilerEngine->handleViewException()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:59)
  at Illuminate\View\Engines\PhpEngine->evaluatePath()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:76)
  at Illuminate\View\Engines\CompilerEngine->get()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:208)
  at Illuminate\View\View->getContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:191)
  at Illuminate\View\View->renderContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:160)
  at Illuminate\View\View->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Renderer/Renderer.php:100)
  at Illuminate\Foundation\Exceptions\Renderer\Renderer->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:879)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionContent()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:860)
  at Illuminate\Foundation\Exceptions\Handler->convertExceptionToResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:839)
  at Illuminate\Foundation\Exceptions\Handler->prepareResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:738)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:626)
  at Illuminate\Foundation\Exceptions\Handler->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:51)
  at Illuminate\Routing\Pipeline->handleException()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:224)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:36)
  at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:74)
  at Illuminate\Cookie\Middleware\EncryptCookies->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:137)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:821)
  at Illuminate\Routing\Router->runRouteWithinStack()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:800)
  at Illuminate\Routing\Router->runRoute()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:764)
  at Illuminate\Routing\Router->dispatchToRoute()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:753)
  at Illuminate\Routing\Router->dispatch()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:200)
  at Illuminate\Foundation\Http\Kernel->{closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():197}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->{closure:Illuminate\Pipeline\Pipeline::prepareDestination():178}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31)
  at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:51)
  at Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Http\Middleware\ValidatePostSize->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:109)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:48)
  at Illuminate\Http\Middleware\HandleCors->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:58)
  at Illuminate\Http\Middleware\TrustProxies->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/InvokeDeferredCallbacks.php:22)
  at Illuminate\Foundation\Http\Middleware\InvokeDeferredCallbacks->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePathEncoding.php:26)
  at Illuminate\Http\Middleware\ValidatePathEncoding->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/app/Http/Middleware/NormalizeRequestPath.php:50)
  at App\Http\Middleware\NormalizeRequestPath->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:137)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144)
  at Illuminate\Foundation\Http\Kernel->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1220)
  at Illuminate\Foundation\Application->handleRequest()
     (/home/srv83227/domains/asted.cloud/public_html/index.php:18)                
[3/4] ViewException
Illuminate\View\ViewException:
syntax error, unexpected end of file (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php) (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php)

  at /home/srv83227/domains/asted.cloud/public_html/storage/framework/views/4152b4a132c5d138c0a225cc8dfb49be.php:74
  at Illuminate\View\Engines\CompilerEngine->handleViewException()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:59)
  at Illuminate\View\Engines\PhpEngine->evaluatePath()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:76)
  at Illuminate\View\Engines\CompilerEngine->get()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:208)
  at Illuminate\View\View->getContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:191)
  at Illuminate\View\View->renderContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:160)
  at Illuminate\View\View->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesComponents.php:103)
  at Illuminate\View\Factory->renderComponent()
     (/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/306b791f283049c38102ca826877d9f4.php:155)
  at require('/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/306b791f283049c38102ca826877d9f4.php')
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:123)
  at Illuminate\Filesystem\Filesystem::{closure:Illuminate\Filesystem\Filesystem::getRequire():120}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:124)
  at Illuminate\Filesystem\Filesystem->getRequire()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:57)
  at Illuminate\View\Engines\PhpEngine->evaluatePath()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:76)
  at Illuminate\View\Engines\CompilerEngine->get()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:208)
  at Illuminate\View\View->getContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:191)
  at Illuminate\View\View->renderContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:160)
  at Illuminate\View\View->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Renderer/Renderer.php:100)
  at Illuminate\Foundation\Exceptions\Renderer\Renderer->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:879)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionContent()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:860)
  at Illuminate\Foundation\Exceptions\Handler->convertExceptionToResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:839)
  at Illuminate\Foundation\Exceptions\Handler->prepareResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:738)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:626)
  at Illuminate\Foundation\Exceptions\Handler->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:51)
  at Illuminate\Routing\Pipeline->handleException()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:224)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:36)
  at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:74)
  at Illuminate\Cookie\Middleware\EncryptCookies->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:137)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:821)
  at Illuminate\Routing\Router->runRouteWithinStack()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:800)
  at Illuminate\Routing\Router->runRoute()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:764)
  at Illuminate\Routing\Router->dispatchToRoute()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:753)
  at Illuminate\Routing\Router->dispatch()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:200)
  at Illuminate\Foundation\Http\Kernel->{closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():197}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->{closure:Illuminate\Pipeline\Pipeline::prepareDestination():178}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31)
  at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:51)
  at Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Http\Middleware\ValidatePostSize->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:109)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:48)
  at Illuminate\Http\Middleware\HandleCors->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:58)
  at Illuminate\Http\Middleware\TrustProxies->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/InvokeDeferredCallbacks.php:22)
  at Illuminate\Foundation\Http\Middleware\InvokeDeferredCallbacks->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePathEncoding.php:26)
  at Illuminate\Http\Middleware\ValidatePathEncoding->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/app/Http/Middleware/NormalizeRequestPath.php:50)
  at App\Http\Middleware\NormalizeRequestPath->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:137)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144)
  at Illuminate\Foundation\Http\Kernel->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1220)
  at Illuminate\Foundation\Application->handleRequest()
     (/home/srv83227/domains/asted.cloud/public_html/index.php:18)                
[2/4] ViewException
Illuminate\View\ViewException:
syntax error, unexpected end of file (View: /home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/resources/exceptions/renderer/components/vendor-frames.blade.php)

  at /home/srv83227/domains/asted.cloud/public_html/storage/framework/views/4152b4a132c5d138c0a225cc8dfb49be.php:74
  at Illuminate\View\Engines\CompilerEngine->handleViewException()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:59)
  at Illuminate\View\Engines\PhpEngine->evaluatePath()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:76)
  at Illuminate\View\Engines\CompilerEngine->get()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:208)
  at Illuminate\View\View->getContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:191)
  at Illuminate\View\View->renderContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:160)
  at Illuminate\View\View->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesComponents.php:103)
  at Illuminate\View\Factory->renderComponent()
     (/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/1a497e07c116e84df11422423e60d9ae.php:71)
  at require('/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/1a497e07c116e84df11422423e60d9ae.php')
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:123)
  at Illuminate\Filesystem\Filesystem::{closure:Illuminate\Filesystem\Filesystem::getRequire():120}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:124)
  at Illuminate\Filesystem\Filesystem->getRequire()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:57)
  at Illuminate\View\Engines\PhpEngine->evaluatePath()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:76)
  at Illuminate\View\Engines\CompilerEngine->get()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:208)
  at Illuminate\View\View->getContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:191)
  at Illuminate\View\View->renderContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:160)
  at Illuminate\View\View->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesComponents.php:103)
  at Illuminate\View\Factory->renderComponent()
     (/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/306b791f283049c38102ca826877d9f4.php:155)
  at require('/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/306b791f283049c38102ca826877d9f4.php')
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:123)
  at Illuminate\Filesystem\Filesystem::{closure:Illuminate\Filesystem\Filesystem::getRequire():120}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:124)
  at Illuminate\Filesystem\Filesystem->getRequire()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:57)
  at Illuminate\View\Engines\PhpEngine->evaluatePath()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:76)
  at Illuminate\View\Engines\CompilerEngine->get()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:208)
  at Illuminate\View\View->getContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:191)
  at Illuminate\View\View->renderContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:160)
  at Illuminate\View\View->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Renderer/Renderer.php:100)
  at Illuminate\Foundation\Exceptions\Renderer\Renderer->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:879)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionContent()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:860)
  at Illuminate\Foundation\Exceptions\Handler->convertExceptionToResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:839)
  at Illuminate\Foundation\Exceptions\Handler->prepareResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:738)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:626)
  at Illuminate\Foundation\Exceptions\Handler->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:51)
  at Illuminate\Routing\Pipeline->handleException()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:224)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:36)
  at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:74)
  at Illuminate\Cookie\Middleware\EncryptCookies->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:137)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:821)
  at Illuminate\Routing\Router->runRouteWithinStack()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:800)
  at Illuminate\Routing\Router->runRoute()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:764)
  at Illuminate\Routing\Router->dispatchToRoute()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:753)
  at Illuminate\Routing\Router->dispatch()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:200)
  at Illuminate\Foundation\Http\Kernel->{closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():197}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->{closure:Illuminate\Pipeline\Pipeline::prepareDestination():178}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31)
  at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:51)
  at Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Http\Middleware\ValidatePostSize->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:109)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:48)
  at Illuminate\Http\Middleware\HandleCors->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:58)
  at Illuminate\Http\Middleware\TrustProxies->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/InvokeDeferredCallbacks.php:22)
  at Illuminate\Foundation\Http\Middleware\InvokeDeferredCallbacks->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePathEncoding.php:26)
  at Illuminate\Http\Middleware\ValidatePathEncoding->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/app/Http/Middleware/NormalizeRequestPath.php:50)
  at App\Http\Middleware\NormalizeRequestPath->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:137)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144)
  at Illuminate\Foundation\Http\Kernel->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1220)
  at Illuminate\Foundation\Application->handleRequest()
     (/home/srv83227/domains/asted.cloud/public_html/index.php:18)                
[1/4] ParseError
ParseError:
syntax error, unexpected end of file

  at /home/srv83227/domains/asted.cloud/public_html/storage/framework/views/4152b4a132c5d138c0a225cc8dfb49be.php:74
  at Illuminate\Filesystem\Filesystem::{closure:Illuminate\Filesystem\Filesystem::getRequire():120}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:124)
  at Illuminate\Filesystem\Filesystem->getRequire()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:57)
  at Illuminate\View\Engines\PhpEngine->evaluatePath()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:76)
  at Illuminate\View\Engines\CompilerEngine->get()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:208)
  at Illuminate\View\View->getContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:191)
  at Illuminate\View\View->renderContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:160)
  at Illuminate\View\View->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesComponents.php:103)
  at Illuminate\View\Factory->renderComponent()
     (/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/1a497e07c116e84df11422423e60d9ae.php:71)
  at require('/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/1a497e07c116e84df11422423e60d9ae.php')
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:123)
  at Illuminate\Filesystem\Filesystem::{closure:Illuminate\Filesystem\Filesystem::getRequire():120}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:124)
  at Illuminate\Filesystem\Filesystem->getRequire()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:57)
  at Illuminate\View\Engines\PhpEngine->evaluatePath()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:76)
  at Illuminate\View\Engines\CompilerEngine->get()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:208)
  at Illuminate\View\View->getContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:191)
  at Illuminate\View\View->renderContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:160)
  at Illuminate\View\View->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesComponents.php:103)
  at Illuminate\View\Factory->renderComponent()
     (/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/306b791f283049c38102ca826877d9f4.php:155)
  at require('/home/srv83227/domains/asted.cloud/public_html/storage/framework/views/306b791f283049c38102ca826877d9f4.php')
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:123)
  at Illuminate\Filesystem\Filesystem::{closure:Illuminate\Filesystem\Filesystem::getRequire():120}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:124)
  at Illuminate\Filesystem\Filesystem->getRequire()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:57)
  at Illuminate\View\Engines\PhpEngine->evaluatePath()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:76)
  at Illuminate\View\Engines\CompilerEngine->get()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:208)
  at Illuminate\View\View->getContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:191)
  at Illuminate\View\View->renderContents()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/View/View.php:160)
  at Illuminate\View\View->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Renderer/Renderer.php:100)
  at Illuminate\Foundation\Exceptions\Renderer\Renderer->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:879)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionContent()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:860)
  at Illuminate\Foundation\Exceptions\Handler->convertExceptionToResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:839)
  at Illuminate\Foundation\Exceptions\Handler->prepareResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:738)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionResponse()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:626)
  at Illuminate\Foundation\Exceptions\Handler->render()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:51)
  at Illuminate\Routing\Pipeline->handleException()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:224)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:36)
  at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:74)
  at Illuminate\Cookie\Middleware\EncryptCookies->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:137)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:821)
  at Illuminate\Routing\Router->runRouteWithinStack()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:800)
  at Illuminate\Routing\Router->runRoute()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:764)
  at Illuminate\Routing\Router->dispatchToRoute()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:753)
  at Illuminate\Routing\Router->dispatch()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:200)
  at Illuminate\Foundation\Http\Kernel->{closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():197}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->{closure:Illuminate\Pipeline\Pipeline::prepareDestination():178}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31)
  at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:51)
  at Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Http\Middleware\ValidatePostSize->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:109)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:48)
  at Illuminate\Http\Middleware\HandleCors->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:58)
  at Illuminate\Http\Middleware\TrustProxies->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/InvokeDeferredCallbacks.php:22)
  at Illuminate\Foundation\Http\Middleware\InvokeDeferredCallbacks->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePathEncoding.php:26)
  at Illuminate\Http\Middleware\ValidatePathEncoding->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/app/Http/Middleware/NormalizeRequestPath.php:50)
  at App\Http\Middleware\NormalizeRequestPath->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:219)
  at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():194}:195}()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:137)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144)
  at Illuminate\Foundation\Http\Kernel->handle()
     (/home/srv83227/domains/asted.cloud/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1220)
  at Illuminate\Foundation\Application->handleRequest()
     (/home/srv83227/domains/asted.cloud/public_html/index.php:18)