Upgrade framework
This commit is contained in:
23
vendor/spatie/laravel-ignition/src/Exceptions/CannotExecuteSolutionForNonLocalIp.php
vendored
Normal file
23
vendor/spatie/laravel-ignition/src/Exceptions/CannotExecuteSolutionForNonLocalIp.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\LaravelIgnition\Exceptions;
|
||||
|
||||
use Spatie\Ignition\Contracts\BaseSolution;
|
||||
use Spatie\Ignition\Contracts\ProvidesSolution;
|
||||
use Spatie\Ignition\Contracts\Solution;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
||||
class CannotExecuteSolutionForNonLocalIp extends HttpException implements ProvidesSolution
|
||||
{
|
||||
public static function make(): self
|
||||
{
|
||||
return new self(403, 'Solutions cannot be run from your current IP address.');
|
||||
}
|
||||
|
||||
public function getSolution(): Solution
|
||||
{
|
||||
return BaseSolution::create()
|
||||
->setSolutionTitle('Checking your environment settings')
|
||||
->setSolutionDescription("Solutions can only be executed by requests from a local IP address. Keep in mind that `APP_DEBUG` should set to false on any production environment.");
|
||||
}
|
||||
}
|
||||
31
vendor/spatie/laravel-ignition/src/Exceptions/InvalidConfig.php
vendored
Normal file
31
vendor/spatie/laravel-ignition/src/Exceptions/InvalidConfig.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\LaravelIgnition\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Monolog\Logger;
|
||||
use Spatie\Ignition\Contracts\BaseSolution;
|
||||
use Spatie\Ignition\Contracts\ProvidesSolution;
|
||||
use Spatie\Ignition\Contracts\Solution;
|
||||
|
||||
class InvalidConfig extends Exception implements ProvidesSolution
|
||||
{
|
||||
public static function invalidLogLevel(string $logLevel): self
|
||||
{
|
||||
return new self("Invalid log level `{$logLevel}` specified.");
|
||||
}
|
||||
|
||||
public function getSolution(): Solution
|
||||
{
|
||||
$validLogLevels = array_map(
|
||||
fn (string $level) => strtolower($level),
|
||||
array_keys(Logger::getLevels())
|
||||
);
|
||||
|
||||
$validLogLevelsString = implode(',', $validLogLevels);
|
||||
|
||||
return BaseSolution::create()
|
||||
->setSolutionTitle('You provided an invalid log level')
|
||||
->setSolutionDescription("Please change the log level in your `config/logging.php` file. Valid log levels are {$validLogLevelsString}.");
|
||||
}
|
||||
}
|
||||
55
vendor/spatie/laravel-ignition/src/Exceptions/ViewException.php
vendored
Normal file
55
vendor/spatie/laravel-ignition/src/Exceptions/ViewException.php
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\LaravelIgnition\Exceptions;
|
||||
|
||||
use ErrorException;
|
||||
use Spatie\FlareClient\Contracts\ProvidesFlareContext;
|
||||
use Spatie\LaravelIgnition\Recorders\DumpRecorder\HtmlDumper;
|
||||
|
||||
class ViewException extends ErrorException implements ProvidesFlareContext
|
||||
{
|
||||
/** @var array<string, mixed> */
|
||||
protected array $viewData = [];
|
||||
|
||||
protected string $view = '';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setViewData(array $data): void
|
||||
{
|
||||
$this->viewData = $data;
|
||||
}
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
public function getViewData(): array
|
||||
{
|
||||
return $this->viewData;
|
||||
}
|
||||
|
||||
public function setView(string $path): void
|
||||
{
|
||||
$this->view = $path;
|
||||
}
|
||||
|
||||
protected function dumpViewData(mixed $variable): string
|
||||
{
|
||||
return (new HtmlDumper())->dumpVariable($variable);
|
||||
}
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
public function context(): array
|
||||
{
|
||||
$context = [
|
||||
'view' => [
|
||||
'view' => $this->view,
|
||||
],
|
||||
];
|
||||
|
||||
$context['view']['data'] = array_map([$this, 'dumpViewData'], $this->viewData);
|
||||
|
||||
return $context;
|
||||
}
|
||||
}
|
||||
21
vendor/spatie/laravel-ignition/src/Exceptions/ViewExceptionWithSolution.php
vendored
Normal file
21
vendor/spatie/laravel-ignition/src/Exceptions/ViewExceptionWithSolution.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\LaravelIgnition\Exceptions;
|
||||
|
||||
use Spatie\Ignition\Contracts\ProvidesSolution;
|
||||
use Spatie\Ignition\Contracts\Solution;
|
||||
|
||||
class ViewExceptionWithSolution extends ViewException implements ProvidesSolution
|
||||
{
|
||||
protected Solution $solution;
|
||||
|
||||
public function setSolution(Solution $solution): void
|
||||
{
|
||||
$this->solution = $solution;
|
||||
}
|
||||
|
||||
public function getSolution(): Solution
|
||||
{
|
||||
return $this->solution;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user