I don't know how to get the data from this foreign key. I have followed all steps from the documentation, but I still don't know what needs to be done.
This is my product model:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
public function sector(){
return $this->hasOne('App\Sector');
…
Top comments (0)