Beispiel #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $patches = Patch::all();
     foreach ($patches as $patch) {
         $this->generateTags($patch);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $patches = Patch::all();
     foreach ($patches as $patch) {
         $this->generateSamples($patch, 'youtube');
         $this->generateSamples($patch, 'soundcloud');
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $categoryLeaves = Category::where("real_depth", '=', 2)->get()->toArray();
     $faker = new Faker\Generator();
     $faker->addProvider(new Faker\Provider\Lorem($faker));
     $users = User::all();
     foreach ($users as $user) {
         for ($i = 0; $i < $this->numPatches(); $i++) {
             $category = $categoryLeaves[array_rand($categoryLeaves)];
             $patch = Patch::create(["name" => $faker->sentence(6, true), "user_id" => $user->id, "description" => $faker->paragraph(3, true), "category_id" => $category["id"]]);
             $this->generateDownloads($users, $patch);
             $this->generateVotes($users, $patch);
         }
     }
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return Patch::embedded()->find($id)->toJson();
 }