dashboard gereparerd
linter / quality (push) Failing after 1m5s
tests / ci (8.3) (push) Failing after 51s
tests / ci (8.4) (push) Failing after 1m6s
tests / ci (8.5) (push) Failing after 1m7s

This commit is contained in:
Daan Meijer
2026-07-06 15:53:30 +02:00
parent ccb3598da0
commit b2a7e2557e
4 changed files with 78 additions and 11 deletions
+2 -2
View File
@@ -11,10 +11,10 @@ class DashboardController extends Controller
public function index(Request $request, ActivityService $activityService)
{
$user = $request->user();
$unreadEntities = $activityService->getUnreadEntitiesGrouped($user);
$unreadDynamics = $activityService->getUnreadEntitiesGrouped($user);
return Inertia::render('Dashboard', [
'unreadEntities' => $unreadEntities,
'unreadDynamics' => $unreadDynamics,
]);
}
}
+67
View File
@@ -0,0 +1,67 @@
<?php
namespace App\Policies;
use App\Models\Chat;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class ChatPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return false;
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Chat $chat): bool
{
$chatable = $chat->chatable;
return $user->can('view', $chatable);
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Chat $chat): bool
{
return $this->view($user, $chat);
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Chat $chat): bool
{
return false;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Chat $chat): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Chat $chat): bool
{
return false;
}
}