Ejemplo n.º 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $threads = Thread::all();
     $users = User::all();
     foreach ($threads as $thread) {
         factory(App\Post::class, mt_rand(1, 15))->create(['thread_id' => $thread->id, 'user_id' => $users->random()->id]);
     }
 }
Ejemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $threads = Thread::all();
     return view('Forum.ForumIndex', compact('threads'));
 }