database/factories/CategoryFactory.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()
    {
        $name = $this->faker->unique()->words(5, true);
        $prefix = static::generatePrefix($name);
        return [
            'category_name' => ucfirst($name),
            'category_prefix' => strtoupper($prefix),
        ];
    }
public function definition ( ) { $ name = $ this -> faker -> unique ( ) -> words ( 5 , true ) ; $ prefix = static :: generatePrefix ( $ name ) ; return [ 'category_name' => ucfirst ( $ name ) , 'category_prefix' => strtoupper ( $ prefix ) , ] ; }
Define the model's default state.
Define the model ' s default state .