Home Database Relationships in Laravel
 I have Author model that looks like this: hasOne('App\Role'); } }  And Role model that looks like: role->pareigos; return view('authors', ['role' => $role]); } }  But I get error like: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'roles.author_id' in 'where clause' (SQL: select * from roles where roles.author_id = 5 and roles.author_id is not null limit 1) Where does the author_id even come from? I have two tables in database, first one is authors that has id,firstname,lastname,role_id. Second one is roles that has two rows - id and pareigos. So I use this command: $role = Author::find(5)->role->pareigos;  To find Author by id (5) and check his role_id in roles table and return pareigos if the ID's matches. Don't know if I have described the problem clearly - if not, just let me know I eill add more details.