Got relationships working with databse. Changed pivot table names to laravel convention.