1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-15 11:44:04 +00:00
tenancy/src/Exceptions/StatefulGuardRequiredException.php
lukinovec 3bf2c39e1a
[4.x] Make impersonation tokens require stateful guards (#935)
* Throw an exception on attempt to create impersonation token with a non-stateful guard

* Test that impersonation tokens can only be created with a stateful guard

* Fix code style (php-cs-fixer)

* Escape backslashes in the exception's message

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>

* Make the exception only about requiring a stateful guard

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-09-02 17:46:27 +02:00

15 lines
380 B
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Exceptions;
use Exception;
class StatefulGuardRequiredException extends Exception
{
public function __construct(string $guardName)
{
parent::__construct("Cannot use a non-stateful guard ('$guardName'). A guard implementing the Illuminate\\Contracts\\Auth\\StatefulGuard interface is required.");
}
}