Upgrade to Pro — share decks privately, control downloads, hide ads and more …

電撃:Laravelクイズ / DENGEKI:LaravelQuiz

Y-KANOH
February 16, 2019

電撃:Laravelクイズ / DENGEKI:LaravelQuiz

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

Y-KANOH

February 16, 2019
Tweet

More Decks by Y-KANOH

Other Decks in Programming

Transcript

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

    ], 1 => [ "name" => "img20.png", ], 0 => [ "name" => "img3.png", ], ] collect([ ['name' => 'img3.png'], ['name' => 'img20.png'], ['name' => 'img01.png'], ]);
  2. 第二問 コレクション [ 2 => [ "name" => "img01.png", ],

    0 => [ "name" => "img3.png", ], 1 => [ "name" => "img20.png", ], ]
  3. 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);
  4. 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. 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", ], ]
  6. 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", ], ]