Skip to content

[BUG][5.6] undefined relationship [pivot] on model [App\Models\User] when broadcasting - sync queue #23068

Closed
@LCD344

Description

@LCD344
  • Laravel Version: 5.6.0
  • PHP Version: 7.2.2
  • Database Driver & Version: Mysql 5.7.2

Description:

I just updated my Laravel version to 5.6 and updated the files from github.
Then running my tests I started getting the mentioned error on all the tests that broadcast. So I'm holding up on updating my production code.

Stack trace:

Illuminate\Database\Eloquent\RelationNotFoundException : Call to undefined relationship [pivot] on model [App\Models\User].
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Database\Eloquent\RelationNotFoundException.php:34
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php:546
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Relations\Relation.php:89
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php:548
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php:516
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php:496
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php:392
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Queue\SerializesAndRestoresModelIdentifiers.php:85
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Queue\SerializesAndRestoresModelIdentifiers.php:55
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Queue\SerializesModels.php:45
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php:146
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Queue\Jobs\Job.php:172
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Queue\FailingJob.php:33
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Queue\SyncQueue.php:119
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Queue\SyncQueue.php:46
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Queue\Queue.php:44
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Broadcasting\BroadcastManager.php:125
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php:271
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php:194
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Notifications\Channels\BroadcastChannel.php:51
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Notifications\NotificationSender.php:113
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Notifications\NotificationSender.php:89
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Notifications\NotificationSender.php:64
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Notifications\ChannelManager.php:35
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Notifications\RoutesNotifications.php:18
C:\wamp64\www\barrioBall\app\Listeners\User\GetMessage.php:30
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php:369
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php:200
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php:465
C:\wamp64\www\barrioBall\app\Http\Requests\User\SendMessageRequest.php:34
C:\wamp64\www\barrioBall\app\Http\Controllers\User\ConversationController.php:59
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Controller.php:54
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php:45
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Route.php:212
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Route.php:169
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Router.php:659
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:30
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Auth\Middleware\Authorize.php:57
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\app\Http\Middleware\Language.php:28
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Middleware\SubstituteBindings.php:41
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Auth\Middleware\Authenticate.php:43
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken.php:67
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php:49
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php:63
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php:37
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php:59
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:102
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Router.php:661
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Router.php:636
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Router.php:602
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Router.php:591
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:176
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:30
C:\wamp64\www\barrioBall\vendor\fideloper\proxy\src\TrustProxies.php:57
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php:30
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php:30
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php:27
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php:46
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:149
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:53
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:102
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:151
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:116
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\MakesHttpRequests.php:345
C:\wamp64\www\barrioBall\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\MakesHttpRequests.php:195
C:\wamp64\www\barrioBall\tests\Feature\Conversation\ConversationTest.php:112

Steps To Reproduce:

  1. Clone laravel5.6 https://github.com/el-coop/barrioBall
  2. Composer install
  3. Run phpunit tests

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions