如何在雄辩的关系中建立关系Laravel

I have Two Table

1- projects

User with id 5 has created 3 project - which means he will have 3 unique conversation with our different agent

----------------------------------------
|id | user_id |  title    | time       |
|1  |    5    |  Example  | 2018-06-30 |
|2  |    5    |  Example  | 2018-06-30 |
|3  |    5    |  Example  | 2018-06-30 |
----------------------------------------

2- conversation

-------------------------------------------
|id | project_id |  user_one | user_two   |
|1  |    1       |     5     |     3      |
|2  |    2       |     5     |     7      |
|3  |    3       |     5     |     10     |
-------------------------------------------

Whenever a project is created, a conversation is created with that project id, Now in Laravel i want to get that project detail using Eloquent Relationships.

User_one is the project creator and user_two is our agent assigned to that product.

This is What I've tried

class Chat extends Model {
 public function project()
    {
        return $this->belongsTo('App\ProjectModel');
    }
 }

class ProjectModel extends Model
{
   public $table = 'projects';
}

Here is the controller function

public function Progress($id){ // Id passed here is 2, so it should show detail of project number 2

    return \App\Chat::find($id)->project()->get();
}

After all this I'm getting an error - Call to a member function project() on null

You can try like this with creating 2 Models Project and Conversation

table

conversations(id, project_id, creator, agent)

Project Model

public function conversations(){
    return $this->hasMany('App\Conversation');
} 

Conversation Model

public function project(){
   return $this->belongsTo('App\Project', 'project_id');
} 


public function creatorUser(){
   return $this->belongsTo('App\User', 'creator');
} 

public function agentUser(){
   return $this->belongsTo('App\User', 'agent');
} 

Fetch Data

public function Progress($id){ // Id passed here is 2, so it should show detail of project number 2
     $chats = Conversation::with('project', 'creatorUser', 'agentUser')->where('project_id', 2)->get();
     foreach($chats as $chat){
        dd($chat->project); //it will always print same project because we have filter the conversation by project_id
        dd($chat->creatorUser);
        dd($chat->agentUser);

     }

}

you can create a relation Along with specifying foreign Key and owner key like:

class Chat extends Model {
 public function project()
    {
        return $this->belongsTo(App\ProjectModel::class, 'project_id', 'id');
    }
 }

and then you will be able to get:

\App\Chat::where('id', $id)->first()->project;