DEV Community

Danilo Patanè
Danilo Patanè

Posted on

Getting data from a foreing key Laravel

Getting data from a foreing key Laravel

0

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)