first commit
Some checks failed
Build / run (push) Has been cancelled

This commit is contained in:
maher
2025-10-29 11:42:25 +01:00
commit 703f50a09d
4595 changed files with 385164 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace Common\Workspaces;
use Auth;
use Common\Core\BaseController;
class UserWorkspacesController extends BaseController
{
public function __construct()
{
$this->middleware('auth');
}
public function index()
{
$workspaces = Workspace::forUser(Auth::id())
->with(['members'])
->withCount(['members'])
->limit(20)
->get()
->map(function (Workspace $workspace) {
$workspace->setCurrentUserAndOwner();
return $workspace;
});
return $this->success([
'workspaces' => $workspaces,
]);
}
}