Big update for category controller - for admin panel

This commit is contained in:
2022-02-15 15:26:10 +01:00
parent 982438a26e
commit 38e5a8f485
19 changed files with 363 additions and 14 deletions

View File

@@ -3,6 +3,8 @@
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 Illuminate\View\View;
@@ -10,12 +12,18 @@ class AdminPanelController extends Controller
{
public function __construct(
) {}
private CategoryRepository $categoryRepository,
private ProjectRepository $projectRepository
) {
$this->categoryRepository->auth = true;
}
public function __invoke(Request $request): View
{
return view('dashboard.home');
$categories = $this->categoryRepository->all();
$projects = $this->projectRepository->all();
return view('dashboard.home', compact('categories', 'projects'));
}
}