Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship Error with model_type do not have a default value type #10

Open
bensonarafat opened this issue Jun 18, 2023 · 0 comments
Open

Comments

@bensonarafat
Copy link

bensonarafat commented Jun 18, 2023

Error when I add a relationship to my model
Like this.
something like this

use DGvai\Review\Review;
use DGvai\Review\Reviewable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Bootcamp extends Model
{
    use Reviewable;
    use HasFactory;

    public function reviews(): HasMany
    {
        return $this->hasMany(Review::class, 'model_id')->with('user')->active();
    }

so if i remove the model class if works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant