title: Laravel getting data from another table with Auth::user()
body: <p>I am relatively new to Laravel.</p>
  <p>I have 2 different tables. <code>roles</code> and <code>users</code>.</p>
  <p>I want to be able to do <code>Auth::user()-&gt;role-&gt;perms</code> to get the permissions for the user role.</p>
  <p>In my <code>User.php</code> I have the following</p>
  <pre class="lang-php prettyprint-override"><code>public function role(){
          return $this-&gt;belongsTo(Role::class, 'role');
      }
  </code></pre>
  <p>In my <code>Role.php</code> I have the following</p>
  <pre class="lang-php prettyprint-override"><code>public function users() {
          return $this-&gt;HasMany(User::class);
      }
  </code></pre>
  <p>Here is my <code>create_users_table.php</code></p>
  <pre class="lang-php prettyprint-override"><code>Schema::connection('panel')-&gt;create('users', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('steam64');
              $table-&gt;string('steamName');
              $table-&gt;string('name');
              $table-&gt;string('role')-&gt;default('user');
              $table-&gt;rememberToken();
          });
  </code></pre>
  <p>Here is my <code>create_roles_table.php</code></p>
  <pre class="lang-php prettyprint-override"><code>Schema::connection('panel')-&gt;create('roles', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('role');
              $table-&gt;json('perms')-&gt;default('{&quot;full_perms&quot;:0, &quot;some_other_perms&quot;:0}');
              $table-&gt;integer('immunity')-&gt;default(10);
          });
  </code></pre>
  <p>When I use <code>{{Auth::user()-&gt;role-&gt;perms}}</code>, I get the following error <code>Trying to get property 'perms' of non-object</code>.</p>
  <p>Hope this is enough information. If not, I can provide additional information.</p>