Skip to content

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

@bensonarafat

Description

@bensonarafat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions