Skip to content

Instantly share code, notes, and snippets.

View Gummibeer's full-sized avatar
🐼
beary busy

Tom Herrmann Gummibeer

🐼
beary busy
View GitHub Profile
<?php
class CreateTenantRequest extends Formrequest
{
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'settings' => ['required', 'array', 'contrains:timezone,currency'],
];
<?php
namespace App\Geotools\Data;
use App\Geotools\Casts\GeographyCast;
use App\Geotools\Contracts\GeoJsonable;
use App\Geotools\Contracts\WellKnownTextable;
use App\Geotools\GeoJson\GeoJson;
use App\Geotools\GeoJson\Point;
use App\Geotools\Value\WktString;
<?php
Repository::macro('swr', function (string $key, DateInterval|DateTimeInterface|int $tts, DateInterval|DateTimeInterface|int $ttl, Closure $callback): mixed {
/** @var Repository $this */
if ($this->getSeconds($tts) >= $this->getSeconds($ttl)) {
throw new UnexpectedValueException('The time-to-stale value must be less than the time-to-live value.');
}
$ttsKey = "{$key}:tts";
$revalidatingKey = "{$key}:revalidating";
<?php
namespace App\Nova;
use App\Nova\Fields\DateTime;
use Carbon\CarbonImmutable;
use Cron\CronExpression;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Text;
<?php
namespace Tests\Asserts;
use App\Enums\DeliveryStatus;
use App\Enums\DistributionRoundStatus;
use App\Enums\DistributionStopType;
use App\Enums\DistributionTaskStatus;
use App\Enums\PackingStationType;
use App\Enums\ProductStockEventReason;
<?php
namespace Hospitable\Avalara\Casts;
use Carbon\CarbonInterface;
use DateTimeZone;
use Spatie\LaravelData\Casts\DateTimeInterfaceCast;
use Spatie\LaravelData\Casts\Uncastable;
use Spatie\LaravelData\Exceptions\CannotCastDate;
use Spatie\LaravelData\Support\DataProperty;
<?php
namespace Hospitable\Avalara\DTOs;
use Carbon\CarbonInterface;
use Hospitable\Avalara\Collections\Collection;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Jsonable;
use JsonSerializable;
use ReflectionClass;
const YAML = require('yaml');
const fs = require('fs-extra');
const path = require('path');
const glob = require('glob');
const fetch = require('node-fetch');
const puppeteer = require('puppeteer');
const slugify = require('slugify');
const { exec } = require("child_process");
const nunjucks = require('nunjucks');
<?php
namespace App\View\Components;
use Astrotomic\Imgix\Facades\Imgix;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
<?php
namespace Astrotomic\FogTradeSdk\Attributes;
use Attribute;
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_PROPERTY)]
class CastToData
{
public function __construct(