/** * Run the database seeds. * * @return void */ public function run() { $faker = Faker\Factory::create(); for ($i = 1; $i <= 5; $i++) { Article::create(['title' => $faker->text(rand(67, 77)), 'content' => $faker->text(rand(167, 177))]); } }
/** * Author page */ public function authorIndex($id) { $articles_user = Article::where('user_id', $id)->simplePaginate(5); $author = User::find($id); return view('front-end.pages.author', compact('articles_user', 'author')); }