BelongsToMany有很多Laravel SQLSTATE [42S22]

im trying to make warehouse(very simple of course). I have 3 tables as it is:

Stores table

class CreateStoresTable extends Migration
{

public function up()
{
    Schema::create('stores', function (Blueprint $table) {
        $table->increments('id');
        $table->string('name');
        $table->integer('user_id');
        $table->timestamps();
    });
}      

Groups table:

 public function up()
{
    Schema::create('groups', function (Blueprint $table) {
        $table->increments('id');
        $table->string('name');
        $table->string('visible');
        $table->timestamps();
    });
}

And a pivot table group_store:

public function up()
{
    Schema::create('group_store', function(Blueprint $table) {
        $table->integer('group_id')->unsigned()->index();
        $table->foreign('group_id')->references('id')->on('groups')->onDelete('cascade');
        $table->integer('store_id')->unsigned()->index();
        $table->foreign('store_id')->references('id')->on('stores')->onDelete('cascade');
    });
}

Store Model -:

class Store extends Model
{
protected $table='stores';
protected $fillable = array('name','user_id');

public function group(){
    return $this->hasMany('App\Group');
}
}

Group Model

class Group extends Model
{
protected $table='groups';
protected $fillable = array('name','visible');

public function store(){
    return $this->belongsToMany('App\Store');
}
}

when i use this in tinker

$group=App\Group::find(4)
$group->store()->get() // and is working as it should

but when i try the reverse

$store=App\Store::first()
$store->group()->get() //i get this error message

Illuminate\Database\QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'groups.store_id' in 'where clause' (SQL: select * from groups where groups.store_id = 3 and groups.store_id is not null)'

Iam trying to understand why eloquent is searching for store_id in groups table...

Using a pivot table implies your relationship is many to many. As per the Laravel documentation, your relationships in your models should both be defined as belongsToMany.

class Store extends Model
{
    protected $table='stores';
    protected $fillable = array('name','user_id');

    public function group(){
        return $this->belongsToMany('App\Group');
    }
}

If you do not intend a many to many relationship, then your groups should only have one store, and your stores can have many groups. This would then mean that you just need a store_id column on your groups table. That is what Eloquent is looking for right now.