Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Cannonb4ll committed Nov 22, 2023
1 parent dff1bf0 commit de42a06
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 148 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function show($projectId, $itemId = null)
} else {
$project = Project::query()->visibleForCurrentUser()->where('slug', $projectId)->firstOrFail();

$item = $project->items()->visibleForCurrentUser()->where('items.slug', $itemId)->firstOrFail();
$item = $project->items()->visibleForCurrentUser()->where('slug', $itemId)->firstOrFail();
}

$showGitHubLink = app(GeneralSettings::class)->show_github_link;
Expand Down
6 changes: 4 additions & 2 deletions app/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;

class Project extends Model
{
Expand Down Expand Up @@ -40,9 +42,9 @@ public function members(): BelongsToMany
return $this->belongsToMany(User::class, 'project_member')->using(ProjectMember::class);
}

public function items()
public function items(): HasMany
{
return $this->hasManyThrough(Item::class, Board::class);
return $this->hasMany(Item::class);
}

public function scopeVisibleForCurrentUser($query)
Expand Down
Loading

0 comments on commit de42a06

Please sign in to comment.