This file contains hidden or 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 | |
| use Illuminate\Support\Facades\Validator; | |
| Validator::extend('encrypted', function ($attribute, $value, $parameters, $validator) { | |
| try { | |
| return decrypt($value); | |
| } catch (\Illuminate\Contracts\Encryption\DecryptException $exception) { | |
| return false; | |
| } |
This file contains hidden or 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\Traits; | |
| use Illuminate\Database\Eloquent\Model; | |
| trait isSoftDeleting | |
| { | |
| /** | |
| * Determine if the model implements soft deletes and does soft deleting. |
This file contains hidden or 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 | |
| use Illumniate\Support\Str; | |
| if (! Str::hasMacro('character')) { | |
| Str::macro('character', static function ($value, $positions, $glue = '') { | |
| if (! is_array($positions)) { | |
| $positions = [$positions]; | |
| } |
This file contains hidden or 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('random_float')) { | |
| /** | |
| * Generates random float number. | |
| * | |
| * @param int|float $min | |
| * @param int|float $max | |
| * @param int $digit | |
| * @return float|int |
This file contains hidden or 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\Concerns; | |
| use App\Casts\HashableKey; | |
| trait CanRouteKeyHashing | |
| { | |
| /** @var bool */ | |
| protected $hashedKey = false; |
This file contains hidden or 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\Packages; | |
| use Faker\Generator; | |
| /** | |
| * @method string randomBody($maxDepth = 4, $maxWidth = 4) | |
| */ | |
| class FakerGenerator extends Generator |
This file contains hidden or 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\Http\Middleware; | |
| use Closure; | |
| use Spatie\Permission\Middlewares\PermissionMiddleware as Middleware; | |
| use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | |
| class Permission404Middleware extends Middleware | |
| { |
This file contains hidden or 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\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Support\Facades\File; | |
| use Illuminate\Support\Str; | |
| class PreferredLanguage | |
| { |
This file contains hidden or 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 | |
| use Illuminate\Database\Migrations\Migration; | |
| use Illuminate\Database\Schema\Blueprint; | |
| use Illuminate\Support\Facades\Schema; | |
| class CreateAttachmentsTable extends Migration | |
| { | |
| /** | |
| * Run the migrations. |
This file contains hidden or 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\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Support\Facades\URL; | |
| use Illuminate\Support\Str; | |
| class RestrictFromReferer | |
| { |