Skip to content

3.1.0

Choose a tag to compare

@binaryk binaryk released this 19 May 21:31
· 200 commits to 3.x since this release
a3118f4

Added

  • Attach related models to a model (check tests)
  • Attach multiple related model to a model
  • Attach extra information to the pivot
 $response = $this->postJson('restify-api/companies/' . $company->id . '/attach/users', [
            'users' => [1, 2],
            'is_admin' => true,
        ])
            ->assertStatus(201);

        $response->assertJsonFragment([
            'company_id' => '1',
            'user_id' => $user->id,
            'is_admin' => true,
        ]);