Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory failed when type is enum #59

Closed
berthojoris opened this issue Jan 29, 2020 · 0 comments · Fixed by #60
Closed

Factory failed when type is enum #59

berthojoris opened this issue Jan 29, 2020 · 0 comments · Fixed by #60

Comments

@berthojoris
Copy link

I create my .yaml file

models:
  Category:
    category_uuid: string:200
    name: string:200
    status: enum:ACTIVE,NONACTIVE
controllers:
  Category:
    index:
      query: all
      render: category.index with:categories
    create:
      render: category.create
    store:
      validate: category_uuid, name, status
      save: category
      flash: category
      redirect: category.index
    update:
      find: category
      redirect: category.index
    show:
      find: category
      render: category.show with:category
    edit:
      find: category
      render: category.edit with:category
    destroy:
      delete: category.id
      redirect: category.index

But when I run, factory file is fail

<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\Category;
use Faker\Generator as Faker;

$factory->define(Category::class, function (Faker $faker) {
    return [
        'category_uuid' => $faker->word,
        'name' => $faker->name,
        'status' => $faker->,
    ];
});

As you see, faker for enum is fail. Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant