30 lines
778 B
PHP
30 lines
778 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Dashboard;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Repository\Interfaces\CategoryRepository;
|
|
use App\Repository\Interfaces\ProjectRepository;
|
|
use Illuminate\Http\Request;
|
|
use Inertia\Response as InertiaResponse;
|
|
|
|
class AdminPanelController extends Controller
|
|
{
|
|
|
|
public function __construct(
|
|
private CategoryRepository $categoryRepository,
|
|
private ProjectRepository $projectRepository
|
|
) {
|
|
$this->categoryRepository->auth = true;
|
|
}
|
|
|
|
public function __invoke(Request $request): InertiaResponse
|
|
{
|
|
$categories = $this->categoryRepository->all();
|
|
$projects = $this->projectRepository->all();
|
|
|
|
return inertia('Dashboard/Index', compact('categories', 'projects'));
|
|
}
|
|
|
|
}
|