This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests; | |
use Orchestra\Testbench\TestCase; | |
use Illuminate\Http\{Request, Response}; | |
use Illuminate\Routing\{Controller, ControllerDispatcher, Pipeline, Route, Router}; | |
/** | |
* Trait AnonymousResponse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AppServiceProvider | |
{ | |
... | |
/** | |
* @param string[] $rules | |
*/ | |
protected function loadCustomValidationRules(array $rules) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Validators\Rules; | |
use Illuminate\Support\Arr; | |
use Illuminate\Validation\Validator; | |
use Illuminate\Contracts\Validation\Rule; | |
use function Lti\{filter_var_multi, get_flag_names, str_putcsv}; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Using 'gree/jose', 'phpseclib\Crypt', and 'guzzlehttp/guzzle' | |
if (!function_exists('is_rsa')) { | |
/** | |
* @param string $publicKey | |
* @return bool | |
*/ | |
function is_rsa(string $publicKey) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use ReflectionException; | |
use Illuminate\Validation\Validator; | |
use App\Validators\Rules\CustomRule; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\Contracts\Validation\Rule; | |
use Lti\Overrides\Validation\Validator as ValidatorOverride; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Validators; | |
use stdClass; | |
use Illuminate\Support\Arr; | |
use Opis\JsonSchema\ISchema; | |
use Illuminate\Support\Fluent; | |
use Illuminate\Support\MessageBag; | |
use Illuminate\Support\Facades\File; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('function_binding')) { | |
/** | |
* @param callable $callback | |
* @return callable | |
*/ | |
function function_binding(callable $callback): callable | |
{ | |
$params = app(ReflectionFunction::class, ['name' => $callback])->getParameters(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Collection::macro('getDot', function ($index, $default = null) { | |
/** @var Collection $this */ | |
$indexes = preg_split('~(?<!\\\)\.~', $index); | |
$indexes = array_map(function ($index) { | |
return preg_replace('~\\\.~', '.', $index); | |
}, $indexes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests; | |
use Exception; | |
use DOMDocument; | |
use ErrorException; | |
use ReflectionClass; | |
use Illuminate\Support\Str; | |
use Illuminate\Http\Request; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests; | |
use Firebase\JWT\JWT; | |
use Laravel\Passport\Passport; | |
use Illuminate\Support\Facades\File; | |
/** | |
* Trait TokenHelpers |