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 | |
| class MonthlyPlan | |
| { | |
| public int $length = 1; | |
| public string $unit = 'month'; | |
| public function normalizeBillingPeriod(Subscription $subscription, Carbon $charge_at): array | |
| { | |
| // First, we'll naively compute the end of the billing period (assuming the timing is 100% accurate) |
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
| File 1: | |
| REMOVE: LegacyRecord::each(function($record) { | |
| ADD: LegacyRecord::with('new_record')->each(function($record) { | |
| $identity = ['legacy_id' => $record->id]; | |
| $values = $this->transformLegacyRecord($record); | |
| REMOVE: NewRecord::updateOrCreate($identity, $values); | |
| ADD: $new_record = $record->new_record ?? NewRecord::make($identity); | |
| ADD: $new_record->fill($this->transformLegacyRecord($record)); |
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\Support; | |
| use Closure; | |
| use Illuminate\Support\Facades\App; | |
| use Illuminate\Support\Str; | |
| use Illuminate\Testing\Assert; | |
| trait ShouldBeMocked |
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
| root = true | |
| [*] | |
| charset = utf-8 | |
| end_of_line = lf | |
| insert_final_newline = true | |
| indent_style = space | |
| indent_size = 4 | |
| trim_trailing_whitespace = 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 | |
| class ArticleController | |
| { | |
| public function show(Request $request, Article $article) | |
| { | |
| // Set up a response and add last modified and/or ETag data | |
| $response = response() | |
| ->setLastModified($article->updated_at) | |
| ->setEtag(md5($article->body), 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 | |
| $data = [ | |
| 'a2' => null, | |
| 'a3' => '', | |
| 'a4' => [], | |
| 'b2' => null, | |
| 'b3' => '', | |
| 'b4' => [], | |
| 'c2' => null, |
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 | |
| Str::macro('spellOutNumbers', static function($value, $locale = 'en_us') { | |
| $separatorFormatter = new \NumberFormatter($locale, \NumberFormatter::DECIMAL); | |
| $groupingSeparator = preg_quote($separatorFormatter->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL), '/'); | |
| $decimalSeparator = preg_quote($separatorFormatter->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL), '/'); | |
| $spellOutFormatter = new \NumberFormatter($locale, \NumberFormatter::SPELLOUT); | |
| return preg_replace_callback( |
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\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 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
| // 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', | |
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\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; |