I've created a one-to-many relationship between a Jobs Model and Permits model. I've recently discovered the awesome tool of Tinker so I've been using it to test my models. When I run Job::with('steps')->find(1);
I get this error
Illuminate\Database\QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'steps.job_id' in 'where clause' (SQL: select * from `steps` where `steps`.`job_id` in (1))'
Here's my Job Model
public function steps ()
{
return $this->hasMany('MyfirstApp\Step');
}
Here's my Step Model
public function Job ()
{
return $this->belongsTo('MyFirstApp\Job');
}
I've already set up the foregin key in the Jobs Table so I'm not sure what the error can be. Any ideas?
Table Structure for reference