- wip dashboard

This commit is contained in:
2023-07-28 00:47:36 +02:00
parent 992326ebf0
commit f5977c1b5d
8 changed files with 291 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ use App\Http\Controllers\Controller;
use App\Repository\Interfaces\CategoryRepository;
use App\Repository\Interfaces\ProjectRepository;
use Illuminate\Http\Request;
use Illuminate\View\View;
use Inertia\Response as InertiaResponse;
class AdminPanelController extends Controller
{
@@ -18,12 +18,12 @@ class AdminPanelController extends Controller
$this->categoryRepository->auth = true;
}
public function __invoke(Request $request): View
public function __invoke(Request $request): InertiaResponse
{
$categories = $this->categoryRepository->all();
$projects = $this->projectRepository->all();
return view('dashboard.home', compact('categories', 'projects'));
return inertia('Dashboard/Index', compact('categories', 'projects'));
}
}

View File

@@ -5,9 +5,9 @@ namespace App\Http\Controllers\Dashboard;
use App\Http\Requests\ProjectRequest;
use App\Models\Project;
use App\Repository\Interfaces\ProjectRepository;
use Carbon\Carbon;
use Illuminate\Http\RedirectResponse;
use Illuminate\View\View;
use Inertia\Response as InertiaResponse;
class ProjectController
{
@@ -33,9 +33,9 @@ class ProjectController
return back()->withError(['message_error', 'Wystąpił błąd podczas aktualizacji!']);
}
public function create(): View
public function create(): InertiaResponse
{
return view('dashboard.projects.create');
return inertia('Projects/Create');
}
public function store(ProjectRequest $request): RedirectResponse