Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sports-mis
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rajdeep Dutta
sports-mis
Commits
8fce89f1
Commit
8fce89f1
authored
Jun 26, 2025
by
Rajdeep Dutta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new upload1
parent
e67aa64b
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
257 additions
and
515 deletions
+257
-515
app/Http/Controllers/HomeController.php
app/Http/Controllers/HomeController.php
+2
-1
app/Http/Controllers/UserManagementController.php
app/Http/Controllers/UserManagementController.php
+42
-0
app/Http/Middleware/RoleMiddleware.php
app/Http/Middleware/RoleMiddleware.php
+20
-0
app/Models/User.php
app/Models/User.php
+1
-0
database/migrations/2025_06_26_065443_add_role_to_users_table.php
.../migrations/2025_06_26_065443_add_role_to_users_table.php
+3
-3
public/dashboard_assets/image/bg-login.jpg
public/dashboard_assets/image/bg-login.jpg
+0
-0
resources/views/auth/register.blade.php
resources/views/auth/register.blade.php
+15
-0
resources/views/layouts/head.blade.php
resources/views/layouts/head.blade.php
+1
-1
resources/views/layouts/login.blade.php
resources/views/layouts/login.blade.php
+0
-0
resources/views/layouts/nav.blade.php
resources/views/layouts/nav.blade.php
+0
-173
resources/views/layouts/roles.blade.php
resources/views/layouts/roles.blade.php
+66
-0
resources/views/layouts/sidebar.blade.php
resources/views/layouts/sidebar.blade.php
+79
-334
resources/views/login.blade.php
resources/views/login.blade.php
+17
-2
routes/web.php
routes/web.php
+11
-1
No files found.
app/Http/Controllers/HomeController.php
View file @
8fce89f1
...
...
@@ -18,13 +18,14 @@ public function dashboard() {
}
public
function
showLoginForm
()
{
return
view
(
'login'
);
return
view
(
'login'
);
// or 'auth.login' depending on your folder
}
public
function
loginProcess
(
Request
$request
)
{
$request
->
validate
([
'email'
=>
'required|email'
,
'password'
=>
'required'
,
'role'
=>
'required'
,
]);
$credentials
=
$request
->
only
(
'email'
,
'password'
);
...
...
app/Http/Controllers/UserManagementController.php
0 → 100644
View file @
8fce89f1
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
App\Models\User
;
use
Illuminate\Support\Facades\Hash
;
class
UserManagementController
extends
Controller
{
public
function
roleAccess
()
{
return
view
(
'layouts.roles'
);
// View will be resources/views/user-management/roles.blade.php
}
public
function
assignRole
(
Request
$request
)
{
$request
->
validate
([
'email'
=>
'required|email'
,
'password'
=>
'required|string'
,
'role'
=>
'required|in:player,coach,manager'
,
]);
// Find user by email
$user
=
User
::
where
(
'email'
,
$request
->
email
)
->
first
();
if
(
!
$user
)
{
return
back
()
->
with
(
'error'
,
'User not found.'
);
}
if
(
!
Hash
::
check
(
$request
->
password
,
$user
->
password
))
{
return
back
()
->
with
(
'error'
,
'Incorrect password.'
);
}
// Assign the role
$user
->
role
=
$request
->
role
;
$user
->
save
();
return
back
()
->
with
(
'success'
,
'Role "'
.
$request
->
role
.
'" assigned to '
.
$user
->
email
);
}
}
app/Http/Middleware/RoleMiddleware.php
0 → 100644
View file @
8fce89f1
<?php
namespace
App\Http\Middleware
;
use
Closure
;
use
Illuminate\Http\Request
;
use
Symfony\Component\HttpFoundation\Response
;
class
RoleMiddleware
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public
function
handle
(
Request
$request
,
Closure
$next
)
:
Response
{
return
$next
(
$request
);
}
}
app/Models/User.php
View file @
8fce89f1
...
...
@@ -21,6 +21,7 @@ class User extends Authenticatable
'name'
,
'email'
,
'password'
,
'role'
,
];
/**
...
...
database/migrations/2025_06_2
4_111007
_add_role_to_users_table.php
→
database/migrations/2025_06_2
6_065443
_add_role_to_users_table.php
View file @
8fce89f1
...
...
@@ -12,10 +12,10 @@
public
function
up
()
:
void
{
Schema
::
table
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'role'
)
->
default
(
'fan'
);
});
$table
->
string
(
'role'
)
->
nullable
();
});
}
/**
* Reverse the migrations.
*/
...
...
public/dashboard_assets/image/bg-login.jpg
0 → 100644
View file @
8fce89f1
263 KB
resources/views/auth/register.blade.php
View file @
8fce89f1
...
...
@@ -14,6 +14,21 @@
<!-- AdminLTE CSS -->
<link
rel=
"stylesheet"
href=
"{{ asset('dashboard_assets/css/adminlte.min.css') }}"
>
</head>
<style>
body
.login-page
{
background-image
:
url('{{ asset('dashboard_assets/image/bg-login.jpg')
}
}'
);
background-size
:
cover
;
background-position
:
center
;
background-repeat
:
no-repeat
;
}
.login-box
{
background-color
:
rgba
(
255
,
255
,
255
,
0.95
);
border-radius
:
10px
;
padding
:
20px
;
box-shadow
:
0
0
20px
rgba
(
0
,
0
,
0
,
0.2
);
}
</style>
<body
class=
"hold-transition register-page"
>
<div
class=
"register-box"
>
...
...
resources/views/layouts/head.blade.php
View file @
8fce89f1
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<title>
AdminLTE v4 | Dashboard
</title>
<title>
Sports MIS
</title>
<!--begin::Primary Meta Tags-->
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"title"
content=
"AdminLTE v4 | Dashboard"
/>
...
...
resources/views/layouts/login.blade.php
deleted
100644 → 0
View file @
e67aa64b
resources/views/layouts/nav.blade.php
View file @
8fce89f1
...
...
@@ -27,178 +27,5 @@
<button
type=
"submit"
class=
"btn btn-outline-danger btn-large"
>
Logout
</button>
</form>
</li>
<!--end::Navbar Search-->
<!--begin::Messages Dropdown Menu-->
{{--
<li
class=
"nav-item dropdown"
>
<a
class=
"nav-link"
data-bs-toggle=
"dropdown"
href=
"#"
>
<i
class=
"bi bi-chat-text"
></i>
<span
class=
"navbar-badge badge text-bg-danger"
>
3
</span>
</a>
--}}
{{--
<div
class=
"dropdown-menu dropdown-menu-lg dropdown-menu-end"
>
<a
href=
"#"
class=
"dropdown-item"
>
<!--begin::Message-->
<div
class=
"d-flex"
>
<div
class=
"flex-shrink-0"
>
<img
src=
"../../dist/assets/img/user1-128x128.jpg"
alt=
"User Avatar"
class=
"img-size-50 rounded-circle me-3"
/>
</div>
<div
class=
"flex-grow-1"
>
<h3
class=
"dropdown-item-title"
>
Brad Diesel
<span
class=
"float-end fs-7 text-danger"
><i
class=
"bi bi-star-fill"
></i
></span>
</h3>
<p
class=
"fs-7"
>
Call me whenever you can...
</p>
<p
class=
"fs-7 text-secondary"
>
<i
class=
"bi bi-clock-fill me-1"
></i>
4 Hours Ago
</p>
</div>
</div>
<!--end::Message-->
</a>
<div
class=
"dropdown-divider"
></div>
<a
href=
"#"
class=
"dropdown-item"
>
<!--begin::Message-->
<div
class=
"d-flex"
>
<div
class=
"flex-shrink-0"
>
<img
src=
"../../dist/assets/img/user8-128x128.jpg"
alt=
"User Avatar"
class=
"img-size-50 rounded-circle me-3"
/>
</div>
<div
class=
"flex-grow-1"
>
<h3
class=
"dropdown-item-title"
>
John Pierce
<span
class=
"float-end fs-7 text-secondary"
>
<i
class=
"bi bi-star-fill"
></i>
</span>
</h3>
<p
class=
"fs-7"
>
I got your message bro
</p>
<p
class=
"fs-7 text-secondary"
>
<i
class=
"bi bi-clock-fill me-1"
></i>
4 Hours Ago
</p>
</div>
</div>
<!--end::Message-->
</a>
<div
class=
"dropdown-divider"
></div>
<a
href=
"#"
class=
"dropdown-item"
>
<!--begin::Message-->
<div
class=
"d-flex"
>
<div
class=
"flex-shrink-0"
>
<img
src=
"../../dist/assets/img/user3-128x128.jpg"
alt=
"User Avatar"
class=
"img-size-50 rounded-circle me-3"
/>
</div>
<div
class=
"flex-grow-1"
>
<h3
class=
"dropdown-item-title"
>
Nora Silvester
<span
class=
"float-end fs-7 text-warning"
>
<i
class=
"bi bi-star-fill"
></i>
</span>
</h3>
<p
class=
"fs-7"
>
The subject goes here
</p>
<p
class=
"fs-7 text-secondary"
>
<i
class=
"bi bi-clock-fill me-1"
></i>
4 Hours Ago
</p>
</div>
</div>
<!--end::Message-->
</a>
<div
class=
"dropdown-divider"
></div>
<a
href=
"#"
class=
"dropdown-item dropdown-footer"
>
See All Messages
</a>
</div>
--}}
{{--
</li>
--}}
<!--end::Messages Dropdown Menu-->
<!--begin::Notifications Dropdown Menu-->
{{--
<li
class=
"nav-item dropdown"
>
<a
class=
"nav-link"
data-bs-toggle=
"dropdown"
href=
"#"
>
<i
class=
"bi bi-bell-fill"
></i>
<span
class=
"navbar-badge badge text-bg-warning"
>
15
</span>
</a>
<div
class=
"dropdown-menu dropdown-menu-lg dropdown-menu-end"
>
<span
class=
"dropdown-item dropdown-header"
>
15 Notifications
</span>
<div
class=
"dropdown-divider"
></div>
<a
href=
"#"
class=
"dropdown-item"
>
<i
class=
"bi bi-envelope me-2"
></i>
4 new messages
<span
class=
"float-end text-secondary fs-7"
>
3 mins
</span>
</a>
<div
class=
"dropdown-divider"
></div>
<a
href=
"#"
class=
"dropdown-item"
>
<i
class=
"bi bi-people-fill me-2"
></i>
8 friend requests
<span
class=
"float-end text-secondary fs-7"
>
12 hours
</span>
</a>
<div
class=
"dropdown-divider"
></div>
<a
href=
"#"
class=
"dropdown-item"
>
<i
class=
"bi bi-file-earmark-fill me-2"
></i>
3 new reports
<span
class=
"float-end text-secondary fs-7"
>
2 days
</span>
</a>
<div
class=
"dropdown-divider"
></div>
<a
href=
"#"
class=
"dropdown-item dropdown-footer"
>
See All Notifications
</a>
</div>
</li>
--}}
<!--end::Notifications Dropdown Menu-->
<!--begin::Fullscreen Toggle-->
{{--
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
data-lte-toggle=
"fullscreen"
>
<i
data-lte-icon=
"maximize"
class=
"bi bi-arrows-fullscreen"
></i>
<i
data-lte-icon=
"minimize"
class=
"bi bi-fullscreen-exit"
style=
"display: none"
></i>
</a>
</li>
--}}
<!--end::Fullscreen Toggle-->
<!--begin::User Menu Dropdown-->
{{--
<li
class=
"nav-item dropdown user-menu"
>
<a
href=
"#"
class=
"nav-link dropdown-toggle"
data-bs-toggle=
"dropdown"
>
<img
src=
"../../dist/assets/img/user2-160x160.jpg"
class=
"user-image rounded-circle shadow"
alt=
"User Image"
/>
<span
class=
"d-none d-md-inline"
>
Alexander Pierce
</span>
</a>
<ul
class=
"dropdown-menu dropdown-menu-lg dropdown-menu-end"
>
<!--begin::User Image-->
<li
class=
"user-header text-bg-primary"
>
<img
src=
"../../dist/assets/img/user2-160x160.jpg"
class=
"rounded-circle shadow"
alt=
"User Image"
/>
<p>
Alexander Pierce - Web Developer
<small>
Member since Nov. 2023
</small>
</p>
</li>
<!--end::User Image-->
<!--begin::Menu Body-->
<li
class=
"user-body"
>
<!--begin::Row-->
<div
class=
"row"
>
<div
class=
"col-4 text-center"
><a
href=
"#"
>
Followers
</a></div>
<div
class=
"col-4 text-center"
><a
href=
"#"
>
Sales
</a></div>
<div
class=
"col-4 text-center"
><a
href=
"#"
>
Friends
</a></div>
</div>
<!--end::Row-->
</li>
<!--end::Menu Body-->
<!--begin::Menu Footer-->
<li
class=
"user-footer"
>
<a
href=
"#"
class=
"btn btn-default btn-flat"
>
Profile
</a>
<a
href=
"#"
class=
"btn btn-default btn-flat float-end"
>
Sign out
</a>
</li>
<!--end::Menu Footer-->
</ul>
</li>
--}}
<!--end::User Menu Dropdown-->
</ul>
<!--end::End Navbar Links-->
</div>
<!--end::Container-->
</nav>
\ No newline at end of file
resources/views/layouts/roles.blade.php
0 → 100644
View file @
8fce89f1
@
extends
(
'layouts.master'
)
@
section
(
'content'
)
<
div
class
=
"container mt-4"
>
<
h1
class
=
"mb-4"
>
Role
-
based
Access
</
h1
>
{{
--
Flash
message
--
}}
@
if
(
session
(
'success'
))
<
div
class
=
"alert alert-success"
>
{{
session
(
'success'
)
}}
</
div
>
@
endif
{{
--
Role
Assignment
Form
--
}}
<
div
class
=
"card mb-4"
>
<
div
class
=
"card-header"
><
b
>
Assign
Role
to
User
</
b
></
div
>
<
div
class
=
"card-body"
>
<
form
action
=
"{{ route('user.assignRole') }}"
method
=
"POST"
>
@
csrf
<
div
class
=
"mb-3"
>
<
label
for
=
"email"
class
=
"form-label"
>
User
Email
</
label
>
<
input
type
=
"email"
name
=
"email"
class
=
"form-control"
required
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"password"
class
=
"form-label"
>
User
Password
</
label
>
<
input
type
=
"password"
name
=
"password"
class
=
"form-control"
required
>
</
div
>
<
div
class
=
"mb-3"
>
<
label
for
=
"role"
class
=
"form-label"
>
Select
Role
</
label
>
<
select
name
=
"role"
class
=
"form-select"
required
>
<
option
value
=
""
>--
Select
Role
--</
option
>
<
option
value
=
"player"
>
Player
</
option
>
<
option
value
=
"coach"
>
Coach
</
option
>
<
option
value
=
"manager"
>
Manager
</
option
>
</
select
>
</
div
>
<
button
type
=
"submit"
class
=
"btn btn-primary"
>
Assign
Role
</
button
>
</
form
>
</
div
>
</
div
>
{{
--
Existing
Roles
Table
--
}}
<
h4
>
Existing
Role
Assignments
</
h4
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
>
User
</
th
>
<
th
>
Assigned
Role
</
th
>
</
tr
>
</
thead
>
<
tbody
>
{{
--
Example
static
content
;
replace
with
dynamic
roles
--
}}
<
tr
>
<
td
>
john
@
example
.
com
</
td
>
<
td
>
Coach
</
td
>
</
tr
>
<
tr
>
<
td
>
alice
@
example
.
com
</
td
>
<
td
>
Admin
</
td
>
</
tr
>
</
tbody
>
</
table
>
</
div
>
@
endsection
resources/views/layouts/sidebar.blade.php
View file @
8fce89f1
This diff is collapsed.
Click to expand it.
resources/views/login.blade.php
View file @
8fce89f1
...
...
@@ -10,18 +10,33 @@
<link
rel=
"stylesheet"
href=
"{{ asset('dashboard_assets/css/fontawesome-free/css/all.min.css') }}"
>
<link
rel=
"stylesheet"
href=
"{{ asset('dashboard_assets/css/adminlte.min.css') }}"
>
</head>
<style>
body
.login-page
{
background-image
:
url('{{ asset('dashboard_assets/image/bg-login.jpg')
}
}'
);
background-size
:
cover
;
background-position
:
center
;
background-repeat
:
no-repeat
;
}
.login-box
{
background-color
:
rgba
(
255
,
255
,
255
,
0.95
);
border-radius
:
10px
;
padding
:
20px
;
box-shadow
:
0
0
20px
rgba
(
0
,
0
,
0
,
0.2
);
}
</style>
<body
class=
"hold-transition login-page"
>
<div
class=
"login-box"
>
<div
class=
"card card-outline card-primary"
>
<div
class=
"card-header text-center"
>
<a
href=
"#"
class=
"h1"
><b>
Sports
</b>
Manager
</a>
<a
href=
"#"
class=
"h1"
><b>
Sports
</b>
Manager
</a>
</div>
<div
class=
"card-body"
>
<p
class=
"login-box-msg"
>
Sign in to start your session
</p>
<!-- FORM, but no action for now -->
<form
action=
"{{ route('login
.submit
') }}"
method=
"POST"
>
<form
action=
"{{ route('login') }}"
method=
"POST"
>
@csrf
<!-- Add name="email" -->
...
...
routes/web.php
View file @
8fce89f1
...
...
@@ -2,6 +2,7 @@
use
Illuminate\Support\Facades\Route
;
use
App\Http\Controllers\HomeController
;
use
App\Http\Controllers\UserManagementController
;
// Index route
Route
::
get
(
'/'
,
[
HomeController
::
class
,
'index'
])
->
name
(
'index'
);
...
...
@@ -18,9 +19,18 @@
// Dashboard route (protected)
// Route::get('/dashboard', [HomeController::class, 'dashboard'])->name('dashboard')->middleware('auth');
Route
::
get
(
'/dashboard'
,
[
HomeController
::
class
,
'dashboard'
])
->
middleware
(
'auth'
)
->
name
(
'dashboard'
);
Route
::
get
(
'dashboard'
,
[
HomeController
::
class
,
'dashboard'
])
->
middleware
(
'auth'
)
->
name
(
'dashboard'
);
// Logout route (optional)
Route
::
post
(
'/logout'
,
[
HomeController
::
class
,
'logout'
])
->
name
(
'logout'
);
//Users
Route
::
get
(
'/user-management/roles'
,
[
UserManagementController
::
class
,
'roleAccess'
])
->
name
(
'user.roles'
);
//Role
Route
::
post
(
'/user-management/assign-role'
,
[
UserManagementController
::
class
,
'assignRole'
])
->
name
(
'user.assignRole'
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment