Big update for category controller - for admin panel
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user