<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class UserPost extends Model
{
    use HasFactory;
    protected $fillable = [
        'user_id','post_id'
    ];
    

    public function postdetail(){
        return $this->hasmany('App\Models\Post','id','post_id');
    }

    public function userdetail(){
        return $this->hasmany('App\Models\User','id','user_id');
    }
    
}

