Skip to content

Instantly share code, notes, and snippets.

View inxilpro's full-sized avatar

Chris Morrell inxilpro

View GitHub Profile
@inxilpro
inxilpro / JsString.php
Created September 30, 2021 19:15
Javascript string implementation for Laravel
<?php
namespace App\Support;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Support\Str;
class JsString implements Htmlable
// This is a definition for the Monarch tokenizer (used by Monaco) to syntax
// highlight Symfony Expression Language.
//
// See these links for more details:
// https://microsoft.github.io/monaco-editor/monarch.html
// https://symfony.com/doc/current/components/expression_language/syntax.html
export default {
defaultToken: 'invalid',
<?php
namespace App\Console\Commands\Utilities;
use Closure;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Foundation\Application;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Http\Client\RequestException;
Deck
4 Aegar, the Freezing Flame (KHM) 200
4 Bonecrusher Giant (ELD) 115
4 Calamity Bearer (KHM) 125
4 Squash (KHM) 152
3 Quakebringer (KHM) 145
4 Berg Strider (KHM) 47
4 Glimpse the Cosmos (KHM) 60
4 Demon Bolt (KHM) 129
2 Shatterskull Smashing (ZNR) 161
<?php
namespace App\View\Components;
use Illuminate\View\Component;
class LanguageInput extends Component
{
public function __construct(
?bool $ariaHidden = null,
<?php
class IdeaDemo extends Component
{
function withAttributes($attributes) {
$attributes = collect($attributes)
->reject(function($value, $key) {
return this->handlesAttributeSpecially($key, $value);
})
->all();
<?php
use Illuminate\Broadcasting\PrivateChannel;
use Livewire\Component;
class ChatStream extends Component
{
public Room $room;
public $messages;
/* Input */
.my-component {
@apply lg:p-12 p-8 md:p-10;
padding-top: 1rem;
}
/* Expected Output */
.my-component { padding: 2rem; }
<?php
namespace App\Support\Database\Relations;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\HasMany;
class HasDuplicateShipmentItems extends HasMany
{
({ addVariant, e }) => {
addVariant('input-checked', ({ modifySelectors, separator }) => {
return modifySelectors(({ className }) => {
const modified = e(`input-checked${ separator }${ className }`);
return `input:checked + .${ modified }, input:checked + * .${ modified }`;
});
});
};