diff --git a/.travis.yml b/.travis.yml index 16d36cf..0664699 100755 --- a/.travis.yml +++ b/.travis.yml @@ -27,4 +27,4 @@ install: - if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi - if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi -script: vendor/bin/phpunit \ No newline at end of file +script: vendor/bin/phpunit diff --git a/README.md b/README.md index f0dc15a..7aae9ff 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ [![Software License][ico-license]](LICENSE.md) [![Build Status](https://travis-ci.com/adminarchitect/core.svg?branch=master)](https://travis-ci.com/adminarchitect/core) - Missing Laravel Administration Framework. It's like ActiveAdmin for Laravel. ### Docs diff --git a/src/Traits/LoopsOverRelations.php b/src/Traits/LoopsOverRelations.php index c32a96c..9ede5ea 100755 --- a/src/Traits/LoopsOverRelations.php +++ b/src/Traits/LoopsOverRelations.php @@ -35,10 +35,13 @@ protected function fetchRelationValue($eloquent, $name, array $relations = [], $ // Treat BelongsToMany form relation as array of values. if ($object instanceof BelongsToMany) { - return \DB::table($object->getTable()) - ->where($this->getQualifiedForeignKeyName($object), $orig->getKey()) - ->pluck($this->getQualifiedRelatedKeyName($object)) - ->toArray(); + return array_map( + 'intval', + \DB::table($object->getTable()) + ->where($this->getQualifiedForeignKeyName($object), $orig->getKey()) + ->pluck($this->getQualifiedRelatedKeyName($object)) + ->toArray() + ); } $object = $object->getResults(); diff --git a/tests/Controllers/AuthControllerTest.php b/tests/Controllers/AuthControllerTest.php index 2a2a8f1..efb20ca 100644 --- a/tests/Controllers/AuthControllerTest.php +++ b/tests/Controllers/AuthControllerTest.php @@ -38,8 +38,7 @@ public function setUp() ->setMethods(['attempt', 'logout']) ->getMock(); - $this->controller->method('guard') - ->willReturn($this->guard); + $this->controller->method('guard')->willReturn($this->guard); parent::setUp(); } @@ -52,11 +51,10 @@ public function it_shows_the_login_form() ->method('auth') ->with('login') ->willReturn('login.view'); + app()->instance('scaffold.template', $template); View::shouldReceive('make')->once()->with('login.view'); - app()->instance('scaffold.template', $template); - $this->controller->getLogin(); }