| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Spatie\LaravelIgnition\Exceptions;
|
|
|
4 |
|
|
|
5 |
use Spatie\Ignition\Contracts\BaseSolution;
|
|
|
6 |
use Spatie\Ignition\Contracts\ProvidesSolution;
|
|
|
7 |
use Spatie\Ignition\Contracts\Solution;
|
|
|
8 |
use Symfony\Component\HttpKernel\Exception\HttpException;
|
|
|
9 |
|
|
|
10 |
class CannotExecuteSolutionForNonLocalIp extends HttpException implements ProvidesSolution
|
|
|
11 |
{
|
|
|
12 |
public static function make(): self
|
|
|
13 |
{
|
|
|
14 |
return new self(403, 'Solutions cannot be run from your current IP address.');
|
|
|
15 |
}
|
|
|
16 |
|
|
|
17 |
public function getSolution(): Solution
|
|
|
18 |
{
|
|
|
19 |
return BaseSolution::create()
|
|
|
20 |
->setSolutionTitle('Checking your environment settings')
|
|
|
21 |
->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.");
|
|
|
22 |
}
|
|
|
23 |
}
|