check if hasone is null that is within a function larvel code example Example: laravel check if model relation exists $model->relation()->exists()