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,
            'created_by' => User::factory(),
            'category_id' => Category::factory(),
        ];
    }
public function definition ( ) { return [ 'title' => $ this -> faker -> sentence , 'created_by' => User :: factory ( ) , 'category_id' => Category :: factory ( ) , ] ; }
Define the model's default state.
Define the model ' s default state .