メソッドチェーン SQLの組み立て。 https://medium.com/swlh/laravel-the-hidden-pipeline-part-1-a4ae91fc55a4 https://darkghosthunter.medium.com/laravel-the-hidden-pipeline-part-2-2c837e17a41e ルートモデルバインディングってどうやって解決しているのか気になったのでコードの奥地にでかけてみた https://qiita.com/wim/items/764a7d7405d32dcb26c8 Laravel
0001-01-01
1 min read
ReflectionClass::newInstanceArgs $members = array('YJSNPI', 'MUR', 'KMR'); $reflection = new ReflectionClass('KarateTeam'); $team = $reflection->newInstanceArgs($members); $team->display(); // YJSNPI, MUR, KMR https://www.php.net/manual/ja/book.reflection.php PHPでリフレクション https://blog.asial.co.jp/751 PHPでアノテーション http://koriym.github.io/2012/02/php-annotation/ <?php namespace animal; require_once 'Cat.php'; require_once 'Dog.php'; $classes = [ 'animal\Cat', 'animal\Dog' ]; foreach ($classes as $class) { $reflClass = new \ReflectionClass($class); $animal = $reflClass->newInstance(); $animal->bark() ; echo "\n"; }
0001-01-01
1 min read