27 lines
724 B
PHP
27 lines
724 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\User;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\TranscriptionProject;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\View\View;
|
|
|
|
class DashboardController extends Controller
|
|
{
|
|
public function index(): View
|
|
{
|
|
$user = Auth::user();
|
|
|
|
$ownedProjects = TranscriptionProject::where('owner_user_id', $user->id)
|
|
->orderByDesc('created_at')
|
|
->paginate(10, ['*'], 'owned');
|
|
|
|
$sharedProjects = $user->collaboratingProjects()
|
|
->orderByDesc('transcription_projects.created_at')
|
|
->paginate(10, ['*'], 'shared');
|
|
|
|
return view('user.dashboard', compact('ownedProjects', 'sharedProjects'));
|
|
}
|
|
}
|