public function run()
 {
     $faker = Faker\Factory::create();
     foreach (range(1, 30) as $index) {
         Joke::create(['body' => $faker->paragraph($nbSentences = 3), 'user_id' => $faker->numberBetween($min = 1, $max = 5)]);
     }
 }
Exemple #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Joke::destroy($id);
 }
 public function destroy($id)
 {
     Joke::destroy($id);
     return response(['message' => 'Joke Deleted Succesfully']);
 }