/** * @param Post $post */ public function creating(Post $post) { if (!$post->user_id) { $post->user()->associate($this->auth->user()); } }