...
"require": {
"vendor/package": "1.3.2", // exactly 1.3.2 (exact)
// >, <, >=, <= | specify upper / lower bounds
"vendor/package": ">=1.3.2", // anything above or equal to 1.3.2
"vendor/package": "<1.3.2", // anything below 1.3.2
// * | wildcard
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
| <script data-turbo-eval="false"> | |
| document.addEventListener('turbo:before-render', () => { | |
| let permanents = document.querySelectorAll('[data-turbo-permanent]') | |
| let undos = Array.from(permanents).map(el => { | |
| el._x_ignore = true | |
| return () => { | |
| delete el._x_ignore | |
| } |
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 | |
| /** | |
| * Automatically alias Laravel Model's to their base classname. | |
| * Ex: "App\Models\User" now can just be accessed by "User" | |
| */ | |
| if (! function_exists('aliasModels')) { | |
| function aliasModels() { | |
| $finder = new \Symfony\Component\Finder\Finder(); | |
| $finder->files()->name('*.php')->in(base_path().'/app'); |
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
| import { reactive } from '@vue/reactivity' | |
| function switchboard(value) { | |
| let lookup = {} | |
| let current | |
| let get = () => current | |
| let set = (newValue) => { |
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 | |
| // Register these inside a service provider: | |
| Blade::directive('route', function ($expression) { | |
| return "<?php echo route({$expression}) ?>"; | |
| }); | |
| Blade::directive('routeIs', function ($expression) { | |
| return "<?php if (request()->routeIs({$expression})) : ?>"; |
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 | |
| Artisan::command('db:open {connection?}', function ($connection = null) { | |
| if (! file_exists('/Applications/TablePlus.app')) { | |
| $this->warn('This command uses TablePlus, are you sure it\'s installed?'); | |
| $this->line("Install here: https://tableplus.com/\n"); | |
| } | |
| $driver = $connection ?: config('database.default'); | |
| $host = config("database.connections.{$driver}.host"); |
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\Abilities; | |
| use Illuminate\Support\Str; | |
| use ReflectionClass; | |
| /** | |
| * Note: This is a preview of an upcoming package from Tighten. | |
| **/ |
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 | |
| // Example usage in a model: | |
| class ExampleModel extends Model | |
| { | |
| use HasUuid; | |
| protected $primaryKey = 'uuid'; |
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
| export function detangle() { | |
| let blocked = false | |
| return callback => (...args) => { | |
| if (blocked) return | |
| blocked = true | |
| callback(...args) |
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 | |
| function memoize($target) { | |
| static $memo = new WeakMap; | |
| return new class ($target, $memo) { | |
| function __construct( | |
| protected $target, | |
| protected &$memo, | |
| ) {} |
NewerOlder