示例#1
0
 /**
  * Search and Display seeds.
  *
  * @param $seedId
  *
  * @return Response
  *
  * @api               {get} /v1/seeds/search Search seeds
  * @apiVersion        1.0.0
  * @apiName           SearchSeeds
  * @apiGroup          Seeds
  * @apiPermission     User
  *
  * @apiParam {Number} [nbGamesMin=0]          Filter Seed with a minimum number of games.
  * @tmpapiParam {Number} [sort=approximatelyScore] Filter Seed with a minimum number of games.
  *
  * @apiUse SeedsSuccess
  *
  * @apiUse ApiLimitError
  */
 public function search(SearchSeedRequest $request)
 {
     //        approximatelyScore
     //        $nbGamesMin = $request->input('nbGamesMin', 0);
     $nbGamesMin = $request->input('nbGamesMin', 0);
     //        abs
     $seeds = Seed::has('games', '>=', $nbGamesMin)->get();
     return $this->response->collection($seeds, new SeedTransformer());
 }
示例#2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     for ($i = 0; $i > 20; $i++) {
         Seed::create(['id' => $i]);
     }
 }