2023-02-08 09:39:13 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories\Uploads;
|
|
|
|
|
|
|
|
use BookStack\Entities\Models\Page;
|
2023-05-17 12:56:55 -04:00
|
|
|
use BookStack\Users\Models\User;
|
2023-02-08 09:39:13 -05:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\BookStack\Uploads\Attachment>
|
|
|
|
*/
|
|
|
|
class AttachmentFactory extends Factory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $model = \BookStack\Uploads\Attachment::class;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array<string, mixed>
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name' => $this->faker->words(2, true),
|
|
|
|
'path' => $this->faker->url(),
|
|
|
|
'extension' => '',
|
|
|
|
'external' => true,
|
|
|
|
'uploaded_to' => Page::factory(),
|
|
|
|
'created_by' => User::factory(),
|
|
|
|
'updated_by' => User::factory(),
|
|
|
|
'order' => 0,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|