database/factories/PostFactory.php
/**
     * Define the model's default state.
     *
     * @return array
     */
Define the model's default state.
@return array
Define the model ' s default state . @return array
public function definition()
    {
        return [
            'title' => $this->faker->sentence(mt_rand(2,8)),
            'slug'  => $this->faker->slug(),
            'excerpt' => $this->faker->paragraph(),
            'body'  => '<p>' . implode('<p></p>',$this->faker->paragraphs(mt_rand(5,10))) . '</p>',
            'user_id' => 1,
            'category_id' => 1
        ];
    }
public function definition ( ) { return [ 'title' => $ this -> faker -> sentence ( mt_rand ( 2 , 8 ) ) , 'slug' => $ this -> faker -> slug ( ) , 'excerpt' => $ this -> faker -> paragraph ( ) , 'body' => '<p>' . implode ( '<p></p>' , $ this -> faker -> paragraphs ( mt_rand ( 5 , 10 ) ) ) . '</p>' , 'user_id' => 1 , 'category_id' => 1 ] ; }
Define the model's default state.
Define the model ' s default state .