<?php
namespace App\Exports;
use App\Models\Product;Translations: Korean (by Yongwoo Lee)
Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.
I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).
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 | |
| $diffIds = \Illuminate\Support\Str::of($inputStrIds = '1,2,5, ') | |
| ->trim()->trim(',')->trim() | |
| ->explode(',') | |
| ->filter(function ($value){ | |
| return filled($value); | |
| }) | |
| ->map(function ($item){ | |
| return trim($item); |
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 PriorityQueue | |
| { | |
| private $queue = []; | |
| public function enqueue($item, $priority) | |
| { | |
| $this->queue[] = [$item, $priority]; | |
| $this->sort(); |
This file is part of the guanguans/translator.
(c) $originalComment.match("Copyright \(c\) (\d+)", 1, "-", "$today.year")$today.year. guanguans <ityaozm@gmail.com>
This source file is subject to the MIT license that is bundled.find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f;#!/usr/local/bin/python
import datetime
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 | |
| if (! function_exists('memoization')) { | |
| /** | |
| * 记忆录 | |
| * | |
| * @param callable $callback | |
| * @param ...$parameter | |
| * | |
| * @return mixed |