Issues (264)

app/Observers/ExperienceObserver.php (1 issue)

Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Xetaravel\Observers;
6
7
use Illuminate\Support\Facades\Auth;
8
use Xetaravel\Models\Experience;
9
10
class ExperienceObserver
11
{
12
    /**
13
     * Handle the "creating" event.
14
     */
15
    public function creating(Experience $experience): void
16
    {
17
        if (is_null($experience->user_id)) {
0 ignored issues
show
The condition is_null($experience->user_id) is always false.
Loading history...
18
            $experience->user_id = Auth::id();
19
        }
20
    }
21
}
22