Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

ploi-deploy/roadmap

527 stars
2 code files
View ploi-deploy/roadmap on GitHub

app/Models/Project.php

Open in GitHub
use Illuminate\Database\Eloquent\Model;
 
class Project extends Model
{
//
public function items()
{
return $this->hasManyThrough(Item::class, Board::class);
}
}

app/Http/Controllers/ItemController.php

Open in GitHub
use App\Models\Item;
use App\Models\Project;
 
class ItemController extends Controller
{
public function show($projectId, $itemId = null)
{
$project = null;
 
if (!$itemId) {
$item = Item::query()->where('slug', $projectId)->firstOrFail();
} else {
$project = Project::query()->where('slug', $projectId)->firstOrFail();
 
$item = $project->items()->where('items.slug', $itemId)->firstOrFail();
}
 
return view('item', [
'project' => $project,
'board' => $item->board,
'item' => $item,
'user' => $item->user,
'comments' => $item->comments()->with('user:id,name,email')->oldest()->get(),
'activities' => $item->activities()->with('causer')->latest()->limit(10)->get()
]);
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.