<?php

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

use App\Book;
use Faker\Generator as Faker;

$factory->define(Book::class, function (Faker $faker) {
    $title = $faker->name;
    return [
        'category_id' => $faker->randomElement(array('NOVEL','COMIC BOOK')),
        'author_id' => $faker->uuid,
        'title' => $title,
        'slug' => str_slug($title),
        'availability' => $faker->randomElement(array('YES','NO')),
        'price' => $faker->randomNumber(2),
        'rating' => $faker->randomDigit,
        'publisher' => $faker->company,
        'country_of_publisher' => $faker->country,
        'isbn-10' => $faker->isbn10,
        'audience' => $faker->randomFloat($nbMaxDecimals = NULL, $min = 0, $max = NULL),
        'format' => $faker->randomElement(array('PDF','DOC')),
        'language' => $faker->languageCode,
        'description' => $faker->paragraph,
        'book_upload' => $faker->name,
        'book_img' => $faker->imageUrl($width = 640, $height = 480),
        'status' => $faker->randomElement(array('DEACTIVE','ACTIVE')),
    ];
});
