Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Syafa Milati Azka
layanan-diskominfo
Commits
2ee10c4d
Commit
2ee10c4d
authored
2 months ago
by
Syafa Milati Azka
Browse files
Options
Download
Email Patches
Plain Diff
Setup awal project
parent
3838f6f0
testing-ngemerge
PPID
PPID-Test
assessment-aut
assessment-auth
assessment-subdomain-auth
coba-merge
main
ppid-test2
sistem-keamanan-informasi
test-merge
No related merge requests found
Changes
211
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
backend/app/Http/Controllers/Auth/AuthenticatedSessionController.php
+6
-19
.../Http/Controllers/Auth/AuthenticatedSessionController.php
backend/app/Http/Controllers/Auth/EmailVerificationNotificationController.php
+4
-3
...trollers/Auth/EmailVerificationNotificationController.php
backend/app/Http/Controllers/Auth/NewPasswordController.php
+10
-26
backend/app/Http/Controllers/Auth/NewPasswordController.php
backend/app/Http/Controllers/Auth/PasswordResetLinkController.php
+15
-17
...app/Http/Controllers/Auth/PasswordResetLinkController.php
backend/app/Http/Controllers/Auth/RegisteredUserController.php
+6
-16
...nd/app/Http/Controllers/Auth/RegisteredUserController.php
backend/app/Http/Controllers/Auth/VerifyEmailController.php
+7
-5
backend/app/Http/Controllers/Auth/VerifyEmailController.php
backend/app/Http/Controllers/UserController.php
+20
-0
backend/app/Http/Controllers/UserController.php
backend/app/Http/Middleware/EnsureEmailIsVerified.php
+27
-0
backend/app/Http/Middleware/EnsureEmailIsVerified.php
backend/app/Http/Requests/Auth/LoginRequest.php
+2
-2
backend/app/Http/Requests/Auth/LoginRequest.php
backend/app/Providers/AppServiceProvider.php
+4
-1
backend/app/Providers/AppServiceProvider.php
backend/bootstrap/app.php
+9
-0
backend/bootstrap/app.php
backend/composer.json
+3
-1
backend/composer.json
backend/composer.lock
+126
-1
backend/composer.lock
backend/config/cors.php
+34
-0
backend/config/cors.php
backend/config/sanctum.php
+84
-0
backend/config/sanctum.php
backend/database/migrations/0001_01_01_000000_create_users_table.php
+24
-22
...abase/migrations/0001_01_01_000000_create_users_table.php
backend/database/migrations/2025_04_29_131135_create_superadmins_table.php
+1
-0
...migrations/2025_04_29_131135_create_superadmins_table.php
backend/database/migrations/2025_04_29_131443_create_jenis_subdomains_table.php
+0
-27
...tions/2025_04_29_131443_create_jenis_subdomains_table.php
backend/database/migrations/2025_04_29_132443_create_kategori_subdomains_table.php
+0
-27
...ns/2025_04_29_132443_create_kategori_subdomains_table.php
backend/database/migrations/2025_04_29_132525_create_jenis_layanans_table.php
+0
-27
...rations/2025_04_29_132525_create_jenis_layanans_table.php
with
382 additions
and
194 deletions
+382
-194
backend/app/Http/Controllers/Auth/AuthenticatedSessionController.php
View file @
2ee10c4d
...
...
@@ -4,48 +4,35 @@ namespace App\Http\Controllers\Auth;
use
App\Http\Controllers\Controller
;
use
App\Http\Requests\Auth\LoginRequest
;
use
Illuminate\Http\RedirectResponse
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Response
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Route
;
use
Inertia\Inertia
;
use
Inertia\Response
;
class
AuthenticatedSessionController
extends
Controller
{
/**
* Show the login page.
*/
public
function
create
(
Request
$request
):
Response
{
return
Inertia
::
render
(
'auth/Login'
,
[
'canResetPassword'
=>
Route
::
has
(
'password.request'
),
'status'
=>
$request
->
session
()
->
get
(
'status'
),
]);
}
/**
* Handle an incoming authentication request.
*/
public
function
store
(
LoginRequest
$request
):
Redirect
Response
public
function
store
(
LoginRequest
$request
):
Response
{
$request
->
authenticate
();
$request
->
session
()
->
regenerate
();
return
re
direct
()
->
intended
(
route
(
'dashboard'
,
absolute
:
false
)
);
return
re
sponse
()
->
noContent
(
);
}
/**
* Destroy an authenticated session.
*/
public
function
destroy
(
Request
$request
):
Redirect
Response
public
function
destroy
(
Request
$request
):
Response
{
Auth
::
guard
(
'web'
)
->
logout
();
$request
->
session
()
->
invalidate
();
$request
->
session
()
->
regenerateToken
();
return
re
direct
(
'/'
);
return
re
sponse
()
->
noContent
(
);
}
}
This diff is collapsed.
Click to expand it.
backend/app/Http/Controllers/Auth/EmailVerificationNotificationController.php
View file @
2ee10c4d
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Controllers\Auth
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\JsonResponse
;
use
Illuminate\Http\RedirectResponse
;
use
Illuminate\Http\Request
;
...
...
@@ -11,14 +12,14 @@ class EmailVerificationNotificationController extends Controller
/**
* Send a new email verification notification.
*/
public
function
store
(
Request
$request
):
RedirectResponse
public
function
store
(
Request
$request
):
JsonResponse
|
RedirectResponse
{
if
(
$request
->
user
()
->
hasVerifiedEmail
())
{
return
redirect
()
->
intended
(
route
(
'dashboard'
,
absolute
:
false
)
);
return
redirect
()
->
intended
(
'
/
dashboard'
);
}
$request
->
user
()
->
sendEmailVerificationNotification
();
return
back
()
->
with
(
'status'
,
'verification-link-sent'
);
return
response
()
->
json
([
'status'
=>
'verification-link-sent'
]
);
}
}
This diff is collapsed.
Click to expand it.
backend/app/Http/Controllers/Auth/NewPasswordController.php
View file @
2ee10c4d
...
...
@@ -4,39 +4,26 @@ namespace App\Http\Controllers\Auth;
use
App\Http\Controllers\Controller
;
use
Illuminate\Auth\Events\PasswordReset
;
use
Illuminate\Http\
Redirect
Response
;
use
Illuminate\Http\
Json
Response
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Hash
;
use
Illuminate\Support\Facades\Password
;
use
Illuminate\Support\Str
;
use
Illuminate\Validation\Rules
;
use
Illuminate\Validation\ValidationException
;
use
Inertia\Inertia
;
use
Inertia\Response
;
class
NewPasswordController
extends
Controller
{
/**
* Show the password reset page.
*/
public
function
create
(
Request
$request
):
Response
{
return
Inertia
::
render
(
'auth/ResetPassword'
,
[
'email'
=>
$request
->
email
,
'token'
=>
$request
->
route
(
'token'
),
]);
}
/**
* Handle an incoming new password request.
*
* @throws \Illuminate\Validation\ValidationException
*/
public
function
store
(
Request
$request
):
Redirect
Response
public
function
store
(
Request
$request
):
Json
Response
{
$request
->
validate
([
'token'
=>
'required'
,
'email'
=>
'required
|
email'
,
'token'
=>
[
'required'
]
,
'email'
=>
[
'required
'
,
'
email'
]
,
'password'
=>
[
'required'
,
'confirmed'
,
Rules\Password
::
defaults
()],
]);
...
...
@@ -47,7 +34,7 @@ class NewPasswordController extends Controller
$request
->
only
(
'email'
,
'password'
,
'password_confirmation'
,
'token'
),
function
(
$user
)
use
(
$request
)
{
$user
->
forceFill
([
'password'
=>
Hash
::
make
(
$request
->
password
),
'password'
=>
Hash
::
make
(
$request
->
string
(
'
password
'
)
),
'remember_token'
=>
Str
::
random
(
60
),
])
->
save
();
...
...
@@ -55,15 +42,12 @@ class NewPasswordController extends Controller
}
);
// If the password was successfully reset, we will redirect the user back to
// the application's home authenticated view. If there is an error we can
// redirect them back to where they came from with their error message.
if
(
$status
==
Password
::
PasswordReset
)
{
return
to_route
(
'login'
)
->
with
(
'status'
,
__
(
$status
));
if
(
$status
!=
Password
::
PASSWORD_RESET
)
{
throw
ValidationException
::
withMessages
([
'email'
=>
[
__
(
$status
)],
]);
}
throw
ValidationException
::
withMessages
([
'email'
=>
[
__
(
$status
)],
]);
return
response
()
->
json
([
'status'
=>
__
(
$status
)]);
}
}
This diff is collapsed.
Click to expand it.
backend/app/Http/Controllers/Auth/PasswordResetLinkController.php
View file @
2ee10c4d
...
...
@@ -3,39 +3,37 @@
namespace
App\Http\Controllers\Auth
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\
Redirect
Response
;
use
Illuminate\Http\
Json
Response
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Password
;
use
Inertia\Inertia
;
use
Inertia\Response
;
use
Illuminate\Validation\ValidationException
;
class
PasswordResetLinkController
extends
Controller
{
/**
* Show the password reset link request page.
*/
public
function
create
(
Request
$request
):
Response
{
return
Inertia
::
render
(
'auth/ForgotPassword'
,
[
'status'
=>
$request
->
session
()
->
get
(
'status'
),
]);
}
/**
* Handle an incoming password reset link request.
*
* @throws \Illuminate\Validation\ValidationException
*/
public
function
store
(
Request
$request
):
Redirect
Response
public
function
store
(
Request
$request
):
Json
Response
{
$request
->
validate
([
'email'
=>
'required
|
email'
,
'email'
=>
[
'required
'
,
'
email'
]
,
]);
Password
::
sendResetLink
(
// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$status
=
Password
::
sendResetLink
(
$request
->
only
(
'email'
)
);
return
back
()
->
with
(
'status'
,
__
(
'A reset link will be sent if the account exists.'
));
if
(
$status
!=
Password
::
RESET_LINK_SENT
)
{
throw
ValidationException
::
withMessages
([
'email'
=>
[
__
(
$status
)],
]);
}
return
response
()
->
json
([
'status'
=>
__
(
$status
)]);
}
}
This diff is collapsed.
Click to expand it.
backend/app/Http/Controllers/Auth/RegisteredUserController.php
View file @
2ee10c4d
...
...
@@ -5,47 +5,37 @@ namespace App\Http\Controllers\Auth;
use
App\Http\Controllers\Controller
;
use
App\Models\User
;
use
Illuminate\Auth\Events\Registered
;
use
Illuminate\Http\RedirectResponse
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Response
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Hash
;
use
Illuminate\Validation\Rules
;
use
Inertia\Inertia
;
use
Inertia\Response
;
class
RegisteredUserController
extends
Controller
{
/**
* Show the registration page.
*/
public
function
create
():
Response
{
return
Inertia
::
render
(
'auth/Register'
);
}
/**
* Handle an incoming registration request.
*
* @throws \Illuminate\Validation\ValidationException
*/
public
function
store
(
Request
$request
):
Redirect
Response
public
function
store
(
Request
$request
):
Response
{
$request
->
validate
([
'name'
=>
'required
|
string
|
max:255'
,
'email'
=>
'required
|
string
|
lowercase
|
email
|
max:255
|
unique:'
.
User
::
class
,
'name'
=>
[
'required
'
,
'
string
'
,
'
max:255'
]
,
'email'
=>
[
'required
'
,
'
string
'
,
'
lowercase
'
,
'
email
'
,
'
max:255
'
,
'
unique:'
.
User
::
class
]
,
'password'
=>
[
'required'
,
'confirmed'
,
Rules\Password
::
defaults
()],
]);
$user
=
User
::
create
([
'name'
=>
$request
->
name
,
'email'
=>
$request
->
email
,
'password'
=>
Hash
::
make
(
$request
->
password
),
'password'
=>
Hash
::
make
(
$request
->
string
(
'
password
'
)
),
]);
event
(
new
Registered
(
$user
));
Auth
::
login
(
$user
);
return
to_route
(
'dashboard'
);
return
response
()
->
noContent
(
);
}
}
This diff is collapsed.
Click to expand it.
backend/app/Http/Controllers/Auth/VerifyEmailController.php
View file @
2ee10c4d
...
...
@@ -15,15 +15,17 @@ class VerifyEmailController extends Controller
public
function
__invoke
(
EmailVerificationRequest
$request
):
RedirectResponse
{
if
(
$request
->
user
()
->
hasVerifiedEmail
())
{
return
redirect
()
->
intended
(
route
(
'dashboard'
,
absolute
:
false
)
.
'?verified=1'
);
return
redirect
()
->
intended
(
config
(
'app.frontend_url'
)
.
'/dashboard?verified=1'
);
}
if
(
$request
->
user
()
->
markEmailAsVerified
())
{
/** @var \Illuminate\Contracts\Auth\MustVerifyEmail $user */
$user
=
$request
->
user
();
event
(
new
Verified
(
$user
));
event
(
new
Verified
(
$request
->
user
()));
}
return
redirect
()
->
intended
(
route
(
'dashboard'
,
absolute
:
false
)
.
'?verified=1'
);
return
redirect
()
->
intended
(
config
(
'app.frontend_url'
)
.
'/dashboard?verified=1'
);
}
}
This diff is collapsed.
Click to expand it.
backend/app/Http/Controllers/UserController.php
0 → 100644
View file @
2ee10c4d
<?php
namespace
App\Http\Controllers
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
class
UserController
extends
Controller
{
public
function
index
()
{
return
response
()
->
json
([
'users'
=>
[
[
'id'
=>
1
,
'name'
=>
'Azka'
],
[
'id'
=>
2
,
'name'
=>
'Sekar'
]
]
]);
}
}
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
backend/app/Http/Middleware/EnsureEmailIsVerified.php
0 → 100644
View file @
2ee10c4d
<?php
namespace
App\Http\Middleware
;
use
Closure
;
use
Illuminate\Contracts\Auth\MustVerifyEmail
;
use
Illuminate\Http\Request
;
use
Symfony\Component\HttpFoundation\Response
;
class
EnsureEmailIsVerified
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public
function
handle
(
Request
$request
,
Closure
$next
):
Response
{
if
(
!
$request
->
user
()
||
(
$request
->
user
()
instanceof
MustVerifyEmail
&&
!
$request
->
user
()
->
hasVerifiedEmail
()))
{
return
response
()
->
json
([
'message'
=>
'Your email address is not verified.'
],
409
);
}
return
$next
(
$request
);
}
}
This diff is collapsed.
Click to expand it.
backend/app/Http/Requests/Auth/LoginRequest.php
View file @
2ee10c4d
...
...
@@ -45,7 +45,7 @@ class LoginRequest extends FormRequest
RateLimiter
::
hit
(
$this
->
throttleKey
());
throw
ValidationException
::
withMessages
([
'email'
=>
trans
(
'auth.failed'
),
'email'
=>
__
(
'auth.failed'
),
]);
}
...
...
@@ -80,6 +80,6 @@ class LoginRequest extends FormRequest
*/
public
function
throttleKey
():
string
{
return
Str
::
transliterate
(
Str
::
lower
(
$this
->
string
(
'email'
))
.
'|'
.
$this
->
ip
());
return
Str
::
transliterate
(
Str
::
lower
(
$this
->
input
(
'email'
))
.
'|'
.
$this
->
ip
());
}
}
This diff is collapsed.
Click to expand it.
backend/app/Providers/AppServiceProvider.php
View file @
2ee10c4d
...
...
@@ -2,6 +2,7 @@
namespace
App\Providers
;
use
Illuminate\Auth\Notifications\ResetPassword
;
use
Illuminate\Support\ServiceProvider
;
class
AppServiceProvider
extends
ServiceProvider
...
...
@@ -19,6 +20,8 @@ class AppServiceProvider extends ServiceProvider
*/
public
function
boot
():
void
{
//
ResetPassword
::
createUrlUsing
(
function
(
object
$notifiable
,
string
$token
)
{
return
config
(
'app.frontend_url'
)
.
"/password-reset/
$token
?email=
{
$notifiable
->
getEmailForPasswordReset
()
}
"
;
});
}
}
This diff is collapsed.
Click to expand it.
backend/bootstrap/app.php
View file @
2ee10c4d
...
...
@@ -10,10 +10,19 @@ use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
return
Application
::
configure
(
basePath
:
dirname
(
__DIR__
))
->
withRouting
(
web
:
__DIR__
.
'/../routes/web.php'
,
api
:
__DIR__
.
'/../routes/api.php'
,
commands
:
__DIR__
.
'/../routes/console.php'
,
health
:
'/up'
,
)
->
withMiddleware
(
function
(
Middleware
$middleware
)
{
$middleware
->
api
(
prepend
:
[
\
Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful
::
class
,
]);
$middleware
->
alias
([
'verified'
=>
\
App\Http\Middleware\EnsureEmailIsVerified
::
class
,
]);
$middleware
->
encryptCookies
(
except
:
[
'appearance'
,
'sidebar_state'
]);
$middleware
->
web
(
append
:
[
...
...
This diff is collapsed.
Click to expand it.
backend/composer.json
View file @
2ee10c4d
...
...
@@ -12,11 +12,13 @@
"php"
:
"^8.2"
,
"inertiajs/inertia-laravel"
:
"^2.0"
,
"laravel/framework"
:
"^12.0"
,
"laravel/sanctum"
:
"^4.0"
,
"laravel/tinker"
:
"^2.10.1"
,
"tightenco/ziggy"
:
"^2.4"
},
"require-dev"
:
{
"fakerphp/faker"
:
"^1.23"
,
"laravel/breeze"
:
"^2.3"
,
"laravel/pail"
:
"^1.2.2"
,
"laravel/pint"
:
"^1.18"
,
"laravel/sail"
:
"^1.41"
,
...
...
@@ -82,4 +84,4 @@
},
"minimum-stability"
:
"stable"
,
"prefer-stable"
:
true
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
backend/composer.lock
View file @
2ee10c4d
...
...
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "
238758776cef75e40b61f11e6f2e00e2
",
"content-hash": "
8f9c71b93082b3bf6fb33ac79e148416
",
"packages": [
{
"name": "brick/math",
...
...
@@ -1396,6 +1396,70 @@
},
"time": "2025-02-11T13:34:40+00:00"
},
{
"name": "laravel/sanctum",
"version": "v4.1.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/sanctum.git",
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/console": "^11.0|^12.0",
"illuminate/contracts": "^11.0|^12.0",
"illuminate/database": "^11.0|^12.0",
"illuminate/support": "^11.0|^12.0",
"php": "^8.2",
"symfony/console": "^7.0"
},
"require-dev": {
"mockery/mockery": "^1.6",
"orchestra/testbench": "^9.0|^10.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^11.3"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Laravel\\Sanctum\\SanctumServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Sanctum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.",
"keywords": [
"auth",
"laravel",
"sanctum"
],
"support": {
"issues": "https://github.com/laravel/sanctum/issues",
"source": "https://github.com/laravel/sanctum"
},
"time": "2025-04-23T13:03:38+00:00"
},
{
"name": "laravel/serializable-closure",
"version": "v2.0.4",
...
...
@@ -6110,6 +6174,67 @@
},
"time": "2020-07-09T08:09:16+00:00"
},
{
"name": "laravel/breeze",
"version": "v2.3.6",
"source": {
"type": "git",
"url": "https://github.com/laravel/breeze.git",
"reference": "390cbc433cb72fa6050965000b2d56c9ba6fd713"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/breeze/zipball/390cbc433cb72fa6050965000b2d56c9ba6fd713",
"reference": "390cbc433cb72fa6050965000b2d56c9ba6fd713",
"shasum": ""
},
"require": {
"illuminate/console": "^11.0|^12.0",
"illuminate/filesystem": "^11.0|^12.0",
"illuminate/support": "^11.0|^12.0",
"illuminate/validation": "^11.0|^12.0",
"php": "^8.2.0",
"symfony/console": "^7.0"
},
"require-dev": {
"laravel/framework": "^11.0|^12.0",
"orchestra/testbench-core": "^9.0|^10.0",
"phpstan/phpstan": "^2.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Laravel\\Breeze\\BreezeServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Breeze\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Minimal Laravel authentication scaffolding with Blade and Tailwind.",
"keywords": [
"auth",
"laravel"
],
"support": {
"issues": "https://github.com/laravel/breeze/issues",
"source": "https://github.com/laravel/breeze"
},
"time": "2025-03-06T14:02:32+00:00"
},
{
"name": "laravel/pail",
"version": "v1.2.2",
...
...
This diff is collapsed.
Click to expand it.
backend/config/cors.php
0 → 100644
View file @
2ee10c4d
<?php
return
[
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths'
=>
[
'api/*'
],
'allowed_origins'
=>
[
'http://localhost:5173'
],
'allowed_origins'
=>
[
env
(
'FRONTEND_URL'
,
'http://localhost:5173'
)],
'allowed_origins_patterns'
=>
[],
'allowed_headers'
=>
[
'*'
],
'exposed_headers'
=>
[],
'max_age'
=>
0
,
'supports_credentials'
=>
true
,
];
This diff is collapsed.
Click to expand it.
backend/config/sanctum.php
0 → 100644
View file @
2ee10c4d
<?php
use
Laravel\Sanctum\Sanctum
;
return
[
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful'
=>
explode
(
','
,
env
(
'SANCTUM_STATEFUL_DOMAINS'
,
sprintf
(
'%s%s%s'
,
'localhost,localhost:3000,127.0.0.1,127.0.0.1:3000,127.0.0.1:8000,::1'
,
Sanctum
::
currentApplicationUrlWithPort
(),
env
(
'FRONTEND_URL'
)
?
','
.
parse_url
(
env
(
'FRONTEND_URL'
),
PHP_URL_HOST
)
:
''
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard'
=>
[
'web'
],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. This will override any values set in the token's
| "expires_at" attribute, but first-party sessions are not affected.
|
*/
'expiration'
=>
null
,
/*
|--------------------------------------------------------------------------
| Token Prefix
|--------------------------------------------------------------------------
|
| Sanctum can prefix new tokens in order to take advantage of numerous
| security scanning initiatives maintained by open source platforms
| that notify developers if they commit tokens into repositories.
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
*/
'token_prefix'
=>
env
(
'SANCTUM_TOKEN_PREFIX'
,
''
),
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware'
=>
[
'authenticate_session'
=>
Laravel\Sanctum\Http\Middleware\AuthenticateSession
::
class
,
'encrypt_cookies'
=>
Illuminate\Cookie\Middleware\EncryptCookies
::
class
,
'validate_csrf_token'
=>
Illuminate\Foundation\Http\Middleware\ValidateCsrfToken
::
class
,
],
];
This diff is collapsed.
Click to expand it.
backend/database/migrations/0001_01_01_000000_create_users_table.php
View file @
2ee10c4d
...
...
@@ -12,29 +12,31 @@ return new class extends Migration
public
function
up
():
void
{
Schema
::
create
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
string
(
'name'
);
$table
->
string
(
'email'
)
->
unique
();
$table
->
timestamp
(
'email_verified_at'
)
->
nullable
();
$table
->
string
(
'password'
);
$table
->
rememberToken
();
$table
->
timestamps
();
});
Schema
::
create
(
'password_reset_tokens'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'email'
)
->
primary
();
$table
->
string
(
'token'
);
$table
->
id
(
'id_user'
);
// primary key, auto increment
$table
->
char
(
'nik'
,
16
)
->
unique
();
$table
->
string
(
'nama'
,
120
);
$table
->
string
(
'email'
,
120
)
->
unique
();
$table
->
string
(
'no_telp'
,
20
)
->
nullable
();
$table
->
text
(
'alamat'
)
->
nullable
();
$table
->
string
(
'pekerjaan'
,
120
)
->
nullable
();
$table
->
string
(
'ktp_file'
,
255
)
->
nullable
();
$table
->
timestamp
(
'created_at'
)
->
nullable
();
});
Schema
::
create
(
'sessions'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'id'
)
->
primary
();
$table
->
foreignId
(
'user_id'
)
->
nullable
()
->
index
();
$table
->
string
(
'ip_address'
,
45
)
->
nullable
();
$table
->
text
(
'user_agent'
)
->
nullable
();
$table
->
longText
(
'payload'
);
$table
->
integer
(
'last_activity'
)
->
index
();
});
// Schema::create('password_reset_tokens', function (Blueprint $table) {
// $table->string('email')->primary();
// $table->string('token');
// $table->timestamp('created_at')->nullable();
// });
// Schema::create('sessions', function (Blueprint $table) {
// $table->string('id')->primary();
// $table->foreignId('user_id')->nullable()->index();
// $table->string('ip_address', 45)->nullable();
// $table->text('user_agent')->nullable();
// $table->longText('payload');
// $table->integer('last_activity')->index();
// });
}
/**
...
...
@@ -43,7 +45,7 @@ return new class extends Migration
public
function
down
():
void
{
Schema
::
dropIfExists
(
'users'
);
Schema
::
dropIfExists
(
'password_reset_tokens'
);
Schema
::
dropIfExists
(
'sessions'
);
//
Schema::dropIfExists('password_reset_tokens');
//
Schema::dropIfExists('sessions');
}
};
This diff is collapsed.
Click to expand it.
backend/database/migrations/2025_04_29_131135_create_superadmins_table.php
View file @
2ee10c4d
...
...
@@ -13,6 +13,7 @@ return new class extends Migration
{
Schema
::
create
(
'superadmins'
,
function
(
Blueprint
$table
)
{
$table
->
id
(
'id_superadmin'
);
$table
->
string
(
'nip'
,
30
)
->
unique
();
$table
->
string
(
'nama'
,
100
);
$table
->
string
(
'email'
,
100
)
->
unique
();
$table
->
unsignedBigInteger
(
'id_bidang'
);
...
...
This diff is collapsed.
Click to expand it.
backend/database/migrations/2025_04_29_131443_create_jenis_subdomains_table.php
deleted
100644 → 0
View file @
3838f6f0
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*/
public
function
up
():
void
{
Schema
::
create
(
'jenis_subdomains'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*/
public
function
down
():
void
{
Schema
::
dropIfExists
(
'jenis_subdomains'
);
}
};
This diff is collapsed.
Click to expand it.
backend/database/migrations/2025_04_29_132443_create_kategori_subdomains_table.php
deleted
100644 → 0
View file @
3838f6f0
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*/
public
function
up
():
void
{
Schema
::
create
(
'kategori_subdomains'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*/
public
function
down
():
void
{
Schema
::
dropIfExists
(
'kategori_subdomains'
);
}
};
This diff is collapsed.
Click to expand it.
backend/database/migrations/2025_04_29_132525_create_jenis_layanans_table.php
deleted
100644 → 0
View file @
3838f6f0
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*/
public
function
up
():
void
{
Schema
::
create
(
'jenis_layanans'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*/
public
function
down
():
void
{
Schema
::
dropIfExists
(
'jenis_layanans'
);
}
};
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
…
11
Next
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
Menu
Projects
Groups
Snippets
Help