Support the ongoing development of Laravel.io →
posted 9 years ago
Eloquent
Last updated 2 years ago.
0

why BelongsToMany? Is that not used with pivot table?

0

also is $ticket = TicketIssue::all();

or $ticket = TicketIssue::with('status')->get();

??

i would remove the belongsToMany relationship completly and try:

$ticket = TicketIssue::with('status')->get();

Last updated 9 years ago.
0
$tickets = \Auth::user()->tickets;

On User Model

public function tickets()
    {
        return $this->hasMany('app\TicketIssues');
    }
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

scsddeputy scsddeputy Joined 27 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.