title: Having different relationships in the same models in Laravel Eloquent
body: <p>I'm building a project where a user can create an event and joins many events, 
  and the event has one owner but can have many users joined</p>
  
  <p>Here are The methods in the Model Event.php</p>
  
  <pre><code>public function creator()
  {
     return $this-&gt;belongsTo(User::class);
  }
  
  public function users()
  {
     return $this-&gt;belongsToMany(User::class);
  }
  </code></pre>
  
  <p>Here are The methods in the Model User.php</p>
  
  <pre><code>public function createdEvents()
  {
     return $this-&gt;belongsTo(User::class);
  }
  
  public function joinedEvents()
  {
     return $this-&gt;belongsToMany(Event::class);
  }
  </code></pre>
  
  <p>And here is the pivot table migration file </p>
  
  <pre><code>class CreateEventUserTable extends Migration
  {
   /**
   * Run the migrations.
   *
   * @return void
   */
   public function up()
   {
     Schema::create('event_user', function (Blueprint $table) {
         $table-&gt;unsignedInteger('event_id');
         $table-&gt;unsignedInteger('user_id');
         $table-&gt;timestamps();
         $table-&gt;primary(['event_id', 'user_id']);    
  
         $table-&gt;foreign('event_id')
             -&gt;references('id')-&gt;on('events')
             -&gt;onDelete('cascade');
  
          $table-&gt;foreign('user_id')
             -&gt;references('id')-&gt;on('users')
             -&gt;onDelete('cascade');
     });
  }
  </code></pre>
  
  <p>And here is the events migration </p>
  
  <pre><code>public function up()
  {
     Schema::create('events', function (Blueprint $table) {
         $table-&gt;increments('id');
         $table-&gt;unsignedInteger('user_id');
         $table-&gt;text('content');
         $table-&gt;date('date');
         $table-&gt;time('time');
         $table-&gt;unsignedSmallInteger('min_attendance');
         $table-&gt;unsignedSmallInteger('max_attendance');
         $table-&gt;string('location');
         $table-&gt;unsignedInteger('category_id');
         $table-&gt;timestamps();
  
         $table-&gt;foreign('user_id')
          -&gt;references('id')-&gt;on('users')
             -&gt;onDelete('cascade');
     });
  }
  </code></pre>
  
  <p>I want to know where I did do wrong or if there s a problem in order to avoid future problems in retrieving data using Laravel Eloquent</p>