title: How to set the primary key itself as a foreign key in laravel?
body: <p>This sounds nooby but I wanted to know if I can make the primary key work as a foreign key in Laravel, and I'am new to Laravel.</p>
  <p>So, I have two migrations 'User' and 'Student' as Shown below:
  <strong>User</strong> :</p>
  <pre><code> Schema::create('users', function (Blueprint $table) {
              $table-&gt;string('uniqueId', 30)-&gt;primary();
              $table-&gt;text('password');
              $table-&gt;string('userType');
              $table-&gt;timestamps();
          });
  </code></pre>
  <p>and <strong>Student</strong> :</p>
  <pre><code>Schema::create('students', function (Blueprint $table) {
              $table-&gt;string('uniqueId', 30)-&gt;primary();
              $table-&gt;text('name');
              $table-&gt;text('fName');
              $table-&gt;text('mName');
              $table-&gt;text('addr');
              $table-&gt;string('image');
              $table-&gt;integer('class');
              $table-&gt;integer('roll');
              $table-&gt;string('year');
              $table-&gt;timestamps();
          });
  </code></pre>
  <p>So, all I wanted was that the primary key  in <strong>Student</strong> (uniqueId) also work as a foreign key that references the 'uniqueId' column from the <strong>User</strong> table.</p>
  <p>Thanks in advance.</p>