title: How can I store data into database? (One to One Relationship Laravel)
body: <p>I have two model 
  Company:</p>
  
  <pre><code>public function slug(){
      return $this-&gt;hasOne(Slug::class);
  }
  </code></pre>
  
  <p>and Slug:</p>
  
  <pre><code>public function company(){
      return $this-&gt;belongsTo(Company::class);
  }
  </code></pre>
  
  <p>Slug table :</p>
  
  <pre><code>Schema::create('slugs', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;integer('company_id')-&gt;unsigned()-&gt;index()-&gt;nullable();
          $table-&gt;foreign('company_id')-&gt;references('id')-&gt;on('companies');
          $table-&gt;string('slug');
      });
  </code></pre>
  
  <p>How can I store data into Slug table ?
  I want store company id into company_id column and str_slug() of company name into slug column</p>