Issues (404)

Branch: dev

database/seeds/CommentSeeder.php (1 issue)

Labels
Severity
1
<?php
2
3
use App\Models\Comment;
4
use App\Models\JobPoster;
5
use App\Models\User;
6
use Illuminate\Database\Seeder;
7
8
class CommentSeeder extends Seeder // phpcs:ignore
9
{
10
    /**
11
     * Run the database seeds.
12
     *
13
     * @return void
14
     */
15
    public function run(): void
16
    {
17
        $job_posters = JobPoster::all();
18
19
        foreach ($job_posters as $job_poster) {
20
            $job_poster->comments()->saveMany(factory(Comment::class, 3)->make([
0 ignored issues
show
The function factory was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
            $job_poster->comments()->saveMany(/** @scrutinizer ignore-call */ factory(Comment::class, 3)->make([
Loading history...
21
                'job_poster_id' => $job_poster->id,
22
                'user_id' => $job_poster->manager->user_id,
23
            ]));
24
        }
25
    }
26
}
27