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\Providers; | |
| class FilesystemMockProvider extends ServiceProvider | |
| { | |
| public function boot() | |
| { | |
| if (App::isProduction()) { | |
| return; |
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\Observers; | |
| trait Mutable | |
| { | |
| public static function mute(string|array $events = null) | |
| { | |
| if (is_null($events)) { | |
| $events = ['*']; |
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
| $timezones = array_map(function ($timezone) { | |
| $date = new DateTime('now', $tz = new DateTimeZone($timezone)); | |
| return [ | |
| 'timezone' => $timezone, | |
| // Format: "(GMT -05:00) America/Toronto" | |
| 'label' => "({$date->format('\G\M\T P')}) {$tz->getName()}", | |
| ]; | |
| }, DateTimeZone::listIdentifiers()); |
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
| return [ | |
| 'Pacific/Midway' => 'Midway Island, Samoa', | |
| 'Pacific/Honolulu' => 'Hawaii', | |
| 'America/Anchorage' => 'Alaska', | |
| 'America/Tijuana' => | |
| 'Pacific Time (US and Canada); Tijuana, Baja California', | |
| 'America/Edmonton' => 'Mountain Time (US and Canada)', | |
| 'America/Chihuahua' => 'Chihuahua, La Paz, Mazatlan', | |
| 'America/Phoenix' => 'Arizona', | |
| 'America/Chicago' => 'Central Time (US and Canada)', |
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 | |
| Auth::provider('sanctum:token', function ($app, $config) { | |
| return new SanctumTokenUserProvider($app['hash'], $config['model']); | |
| }); |
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
| /** | |
| * Copy rich text content to clipboard. | |
| * | |
| * Must be initiated by a user click event. | |
| * | |
| * @param {string} content | |
| */ | |
| export default function (content) { | |
| const selection = window.getSelection(); |
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
| <template> | |
| <div :class="classes"> | |
| <table v-once :id="tableId" ref="table" :class="className" cellpadding="0"> | |
| <thead :class="theadClassName"> | |
| <tr> | |
| <th v-for="(field, i) in options.columns" :key="'head_' + i" :class="field.classHeaderName"> | |
| <slot :name="'HEAD_' + field.name" :field="field" :i="i"> | |
| <input | |
| v-if="field.name === '_select_checkbox'" | |
| type="checkbox" |
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
| name: fix-style | |
| on: | |
| push: | |
| pull_request: | |
| paths: | |
| - '**.php' | |
| jobs: | |
| php-cs-fixer: |
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 | |
| $finder = (new Symfony\Component\Finder\Finder) | |
| ->in([ | |
| __DIR__.'/src', | |
| __DIR__.'/tests', | |
| ]) | |
| ->name('*.php') | |
| ->ignoreVCS(true) | |
| ->ignoreDotFiles(true); |
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 | |
| /** | |
| * @return array An array of two elements containing roots in any order | |
| * @link https://www.testdome.com/questions/php/quadratic-equation/38497 | |
| */ | |
| function findRoots($a, $b, $c) | |
| { | |
| return [ | |
| (-$b + sqrt(pow($b, 2) - ((4 * $a) * $c))) / (2 * $a), | |
| (-$b - sqrt(pow($b, 2) - ((4 * $a) * $c))) / (2 * $a), |