title: Creating a structure with Jobs, Events, Listeners, Queues in Laravel 8
body: <p>I have a flow about that. I can solve the problem on paper. As a system admin, we have the following models: Clients, Departments, Users, Visitors, Calls, and Meetings.</p>
  <ul>
  <li><strong>Clients</strong> are our customers.</li>
  <li><strong>Departments</strong> are customers' departments.</li>
  <li><strong>Users</strong> have many roles, but we inspect the &quot;Agent&quot; role to define the
  agent as a call center worker.</li>
  <li><strong>Visitors</strong> are those who want to meet
  with an active agent by selecting a client and department.</li>
  <li><strong>Calls</strong> are a log table. If visitors can find the agent and send data to the
  agent, I store data in the call table.</li>
  <li><strong>Meetings</strong> If the agent accepts the call, I store it in the meeting table and notify the
  agent and visitor.</li>
  </ul>
  <p><strong>Client.php (Model)</strong></p>
  <pre><code>public function users(){
     return $this-&gt;hasMany(User::class);
  }
  public function departments(){
     return $this-&gt;hasMany(Department::class);
  }
  </code></pre>
  <p><strong>Department.php (Model)</strong></p>
  <pre><code>public function department_users(){
      return $this-&gt;belongsToMany(User::class, 'department_user');
  }
  public function client(){
      return $this-&gt;belongsToMany(Client::class, 'client_id');
  }
  
  </code></pre>
  <p><strong>User.php (Model)</strong></p>
  <pre><code>public function departments(){
    return $this-&gt;belongsToMany(Department::class, 'department_user');
  }
  </code></pre>
  <p><strong>Visitor.php (Model)</strong></p>
  <pre><code>public function department(){
    return $this-&gt;belongsTo(Department::class);
  }
  </code></pre>
  <p>So as you can see, we define the relationships, and we want to do something like that:</p>
  <p>Here is the flow...</p>
  <p><a href="https://i.stack.imgur.com/0LWqb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0LWqb.png" alt="1" /></a></p>
  <p>The question is, how can I do that in Laravel 8?</p>