<?php

use App\Models\Auth\User;
use Faker\Generator;
use Illuminate\Support\Str;
use Ramsey\Uuid\Uuid;

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/

$factory->define(App\Models\ForumThread::class, function ($faker) {
    return [
        'user_id' => function () {
            return factory('App\Models\Auth\User')->create()->id;
        },
        'title' => $faker->sentence,
        'body'  => $faker->paragraph
    ];
});


$factory->define(App\Models\ForumReply::class, function ($faker) {
    return [
        'thread_id' => function () {
            return factory('App\Models\ForumThread')->create()->id;
        },
        'user_id' => function () {
            return factory('App\Models\Auth\User')->create()->id;
        },
        'body'  => $faker->paragraph
    ];
});

$factory->define(App\Models\ForumChannel::class, function ($faker) {
    $name = $faker->word;
    return [
        'name' => $name,
        'slug' => $name,
    ];
});
