October 23, 2019

GitHub ActionsでLaravelのテストを実行

はじめに GitHub Actionsはまだベータなのでこれからいくらでも変更される。あくまで執筆時点での情報。 ベータは申し込めば数日後には使える。 準備 G ... Read more

September 4, 2019

Laravel6.0へアップグレード

6.0 バージョニング規約が普通のsemverに変わっただけなのでバージョンアップの手間は5.x時代の0.1と同じ。 5.8までのバージョンは「パラ ... Read more

July 23, 2019

AWS/EFS リージョン間データ転送

DataSync使えば転送できるけどわざわざ手動で設定する必要はない。 https://docs.aws.amazon.com/ja_jp/datasync/latest/userguide/what-is-datasync.html AWSが用意してるツール使ったほうが簡単・確実。実体はCloudFo ... Read more

May 31, 2019

Laravelのコーディング規約

基本的にはPSR-2 + PHPDoc部分の独自規約程度だけど https://readouble.com/laravel/5.8/ja/contributions.html#coding-style https://laravel.com/docs/5.8/contributions#coding-style 実際は他にも色々。クラスのインポートは長さ順とか。 use Illuminate\Foundation\Mix; use Illuminate\Support\HtmlString; use Illuminate\Container\Container; use Illuminate\Support\Facades\Date; ... use Illuminate\Contracts\Validation\Factory as ValidationFactory; use ... Read more

May 28, 2019

Laravel Server Push Middleware

他人のcomposerパッケージを少し修正して使いたい場合、GitHubでフォークしてcomposer.jsonで設定すれば使える。 https://getcomposer.org/doc/05-repositories.md#vcs 一時的 ... Read more

May 17, 2019

どこまでLaravelに依存するか

よく迷うのはコントローラーから別のクラスに処理をぶん投げる時に$requestを渡すかどうか。 public function __invoke(Request $request, PostService $service) { $post = $service->store($request); return $post; } 渡した先では$req ... Read more

May 13, 2019

テストしにくいコード

対象 LaravelとPHP new よく言われている分かりやすい目印。new使ってるだけでやばいなと分かる。 $foo = new Foo(); LaravelならDIかapp( ... Read more

© kawax