messages implemented
This commit is contained in:
32
database/factories/ArtworkCommentFactory.php
Normal file
32
database/factories/ArtworkCommentFactory.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Artwork;
|
||||
use App\Models\ArtworkComment;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class ArtworkCommentFactory extends Factory
|
||||
{
|
||||
protected $model = ArtworkComment::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
$raw = $this->faker->sentence(12);
|
||||
|
||||
return [
|
||||
'artwork_id' => Artwork::factory(),
|
||||
'user_id' => User::factory(),
|
||||
'content' => $raw,
|
||||
'raw_content' => $raw,
|
||||
'rendered_content' => '<p>' . e($raw) . '</p>',
|
||||
'is_approved' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function unapproved(): static
|
||||
{
|
||||
return $this->state(['is_approved' => false]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user