```
namespace App;

use App\Model\Service\Area;
use App\Model\Bid\Service;
use Illuminate\Database\Eloquent\Model;

class Bid extends Model
{
    protected $table = "bid";

    protected $primaryKey = 'bid_id';

    protected $guarded = [];

    protected $with = ['services'];

    public function services() {
        return $this->hasMany(Service::class, 'bid_id');
    }

    public function area() {
        return $this->belongsTo(Area::class, 'area_id', 'area_id');
    }
}

```

```
namespace App\Model\Service;

use Illuminate\Database\Eloquent\Model;

class Area extends Model
{
    protected $table = "location_area";

    protected $primaryKey = 'area_id';

    protected $guarded = [];

    public function city()
    {
        return $this->belongsTo(City::class, 'city_id');
    }
}

```

> 
> [Area table Migration and data](https://i.stack.imgur.com/7TIEE.png)
> 
> 
> [Bid table Migration and data](https://i.stack.imgur.com/d2VH6.png)
> 
> 
> 

**When I am trying to access**

```
Bid::with('area')->find(BID_ID);

```

**It is returning Null**
Query is firing wrong:

```
"select * from `location_area` where `location_area`.`area_id` in (0)"

```

But if I am doing like:

```
$bid = Bid::find(BID_ID);
dd($bid->area);

```

> 
> It returns Area table values. What is going wrong? Please Help me. I
> am having this problem for a long time. Thank You in advance :)
> 
> 
>