/** * Run the database seeds. * * @return void */ public function run() { $faker = Faker\Factory::create(); for ($i = 0; $i < 100; $i++) { $news_article = NewsArticle::create(['title' => $faker->sentence, 'user_id' => $faker->randomNumber, 'title_slug' => $faker->slug, 'body' => $faker->paragraph, 'photo_url' => $faker->imageUrl, 'excerpt' => $faker->paragraph]); } }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { NewsArticle::find($id)->delete(); return redirect('newsarticles'); }