電撃:Laravelクイズ / DENGEKI:LaravelQuiz

B3a78cfbf06ca9ee860536c6d1de5e7f?s=47 Y-KANOH
February 16, 2019

電撃:Laravelクイズ / DENGEKI:LaravelQuiz

「Laravel は便利」「Laravel で開発速度が上がる」とは、よく聞くセリフですが、我々はどこまで Laravel を使いこなせているのでしょうか。
Laravel ビギナーがドキュメントを読み漁って掘り当てた、Laravel のニッチな便利機能/便利関数をクイズ形式で紹介します。目指せ!全問正解!!

B3a78cfbf06ca9ee860536c6d1de5e7f?s=128

Y-KANOH

February 16, 2019
Tweet

Transcript

  1. 1.
  2. 13.

    第二問 コレクション ソート [ 2 => [ "name" => "img01.png",

    ], 1 => [ "name" => "img20.png", ], 0 => [ "name" => "img3.png", ], ] collect([ ['name' => 'img3.png'], ['name' => 'img20.png'], ['name' => 'img01.png'], ]);
  3. 14.

    第二問 コレクション [ 2 => [ "name" => "img01.png", ],

    0 => [ "name" => "img3.png", ], 1 => [ "name" => "img20.png", ], ]
  4. 15.

    Q2. 大きさ順になるものは? A B C $collection = collect([ ['name' =>

    'img3.png' ], ['name' => 'img20.png'], ['name' => 'img01.png'], ]); $collection->sortBy('name', SORT_NATURAL); $collection->sort(SORT_NATURAL); $collection->sort('name', SORT_NATURAL);
  5. 16.

    Q2. 大きさ順になるものは? A B C $collection = collect([ ['name' =>

    'img3.png' ], ['name' => 'img20.png'], ['name' => 'img01.png'], ]); $collection->sortBy('name', SORT_NATURAL); $collection->sort(SORT_NATURAL); $collection->sort('name', SORT_NATURAL);
  6. 19.

    Q3. $ret の値はどれ? A B C $array = [ "keyA"

    => "AAA" ]; $ret = array_add( $array, "keyB1.keyB2", "BBB1.BBB2" ); [ "keyA" => "AAA", "keyB1.keyB2" => "BBB1.BBB2", ] [ "keyA" => "AAA", "keyB1" => "BBB1", "keyB2" => "BBB2" ] [ "keyA" => "AAA", "keyB1" => [ "keyB2" => "BBB1.BBB2", ], ]
  7. 20.

    Q3. $ret の値はどれ? A B C $array = [ "keyA"

    => "AAA" ]; $ret = array_add( $array, "keyB1.keyB2", "BBB1.BBB2" ); [ "keyA" => "AAA", "keyB1.keyB2" => "BBB1.BBB2", ] [ "keyA" => "AAA", "keyB1" => "BBB1", "keyB2" => "BBB2" ] [ "keyA" => "AAA", "keyB1" => [ "keyB2" => "BBB1.BBB2", ], ]