Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monitoring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
monitoring
Commits
b3c09c62
Commit
b3c09c62
authored
1 year ago
by
Thibault Debatty
Browse files
Options
Downloads
Patches
Plain Diff
create controller for public dashboard
parent
75e46f16
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Http/Controllers/OrganizationDashboardController.php
+21
-0
21 additions, 0 deletions
app/Http/Controllers/OrganizationDashboardController.php
routes/web.php
+4
-8
4 additions, 8 deletions
routes/web.php
with
25 additions
and
8 deletions
app/Http/Controllers/OrganizationDashboardController.php
0 → 100644
+
21
−
0
View file @
b3c09c62
<?php
namespace
App\Http\Controllers
;
use
App\Organization
;
use
Illuminate\Http\Request
;
/**
* Public organization dashboard
*/
class
OrganizationDashboardController
extends
Controller
{
public
function
dashboard
(
Organization
$organization
,
string
$token
)
{
if
(
$organization
->
dashboard_token
!=
$token
)
{
abort
(
403
);
}
return
view
(
"organization.dashboard"
,
array
(
"organization"
=>
$organization
));
}
}
This diff is collapsed.
Click to expand it.
routes/web.php
+
4
−
8
View file @
b3c09c62
...
...
@@ -39,17 +39,13 @@ Route::get(
'app/organizations/{organization}/reset-token'
,
'OrganizationController@resetToken'
);
// public dashboard
Route
::
get
(
'app/organizations/{organization}/dashboard/{token}'
,
function
(
\App\Organization
$organization
,
string
$token
)
{
if
(
$organization
->
dashboard_token
!=
$token
)
{
abort
(
403
);
}
return
view
(
"organization.dashboard"
,
array
(
"organization"
=>
$organization
));
}
'OrganizationDashboardController@dashboard'
)
->
name
(
"organization.public.dashboard"
);
Route
::
resource
(
'app/organizations'
,
'OrganizationController'
);
Route
::
resource
(
"app/organizations.user"
,
"OrganizationUserController"
)
->
only
([
"create"
,
"store"
,
"destroy"
]);
Route
::
resource
(
'app/servers'
,
'ServerController'
)
->
except
([
"index"
]);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment