This commit is contained in:
Torsten 2024-12-08 09:19:03 +01:00
parent a9e7afd13a
commit ba3de1ae99
31 changed files with 329 additions and 5 deletions

View file

@ -0,0 +1,35 @@
https://www.youtube.com/watch?v=-NIoOj-FtHE&list=PLT9miexWCpPW6Z_OXNv2d78cqCrZaPrVG&index=36
ProjectController.php
```php
public function listProjects()
{
$user_id = auth()->id();
$pm = new ProjectModel();
$projectData = $pm->where([
"user_id" => $user_id
])->findAll();
if (count($projectData)>0) {
$response = [
"status" => true,
"message" => "Project data",
"data" => $projectData
];
}else {
$response = [
"status" => false,
"message" => "No Project data found",
"data" => []
];
}
return $this->respondCreated($response);
}
```
Routes.php
```php
$routes->get("list-projects", "ProjectController::listProjects", ["filter" => "apiauth"]);
```