/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     $products = c2a(Product::lists('id'));
     $users = c2a(User::lists('id'));
     foreach (range(1, 20) as $index) {
         Topic::create(['title' => $faker->sentence(6), 'slug' => $faker->name, 'product_id' => $faker->randomElement($products), 'user_id' => $faker->randomElement($users), 'keywords' => $faker->sentence, 'description' => $faker->sentence(10), 'content' => $faker->sentence(100), 'page_view_count' => rand(10, 3059), 'vote_count' => rand(0, 199), 'reply_count' => rand(0, 100)]);
     }
 }
 public function show($id)
 {
     $data = ['order' => Order::findOrFail($id), 'products' => Product::lists('name', 'id')];
     return view('order.edit', $data);
 }
 public function edit($id)
 {
     $productionRegister = ProductionRegister::with('product')->findOrFail($id);
     $products = Product::lists('title', 'id');
     return view('productionRegisters.edit', compact('productionRegister', 'products'));
 }
 /**
  * Show the form for editing the specified Tracking.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function edit($id)
 {
     $tracking = $this->trackingRepository->findWithoutFail($id);
     $facings = Facing::lists('name', 'id');
     $products = Product::lists('name', 'id');
     $brands = Brand::lists('name', 'id');
     $users = User::lists('name', 'id');
     if (empty($tracking)) {
         Flash::error('Tracking not found');
         return redirect(route('trackings.index'));
     }
     return view('trackings.edit')->with('tracking', $tracking)->with('facings', $facings)->with('products', $products)->with('brands', $brands)->with('users', $users);
 }
 private function composeLessonForm()
 {
     view()->composer('site.lessons.fields', function ($view) {
         $view->with('products', \App\Models\Product::lists('name', 'id'))->with('links', \App\Models\Link::lists('name', 'id'));
     });
 }