feat: init laravel project

This commit is contained in:
Farul Ahmad Wananda 2024-06-13 14:04:30 +07:00
parent 69d7165121
commit f13acc3bea
3474 changed files with 99181 additions and 0 deletions

18
.editorconfig Normal file
View File

@ -0,0 +1,18 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
[docker-compose.yml]
indent_size = 4

59
.env.example Normal file
View File

@ -0,0 +1,59 @@
APP_NAME=APP_NAME="Carrer Development and Consultation (CDC)"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=kuisioner_cdc
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

11
.gitattributes vendored Normal file
View File

@ -0,0 +1,11 @@
* text=auto eol=lf
*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php
/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

132
.idea/blade.xml Normal file
View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BladeInjectionConfiguration" default="false">
<directives>
<data directive="@append" />
<data directive="@auth" injection="true" prefix="&lt;?php&#10;if(auth()-&gt;guard(" suffix=")-&gt;check()): ?&gt;" />
<data directive="@aware" injection="true" prefix="&lt;?php $attributes = $attributes-&gt;exceptProps(" suffix="); ?&gt;" />
<data directive="@break" injection="true" prefix="&lt;?php&#10;if(" suffix=") break; ?&gt;" />
<data directive="@can" injection="true" prefix="&lt;?php&#10;if (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;check(" suffix=")): ?&gt;" />
<data directive="@canany" injection="true" prefix="&lt;?php&#10;if (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;any(" suffix=")): ?&gt;" />
<data directive="@cannot" injection="true" prefix="&lt;?php&#10;if (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;denies(" suffix=")): ?&gt;" />
<data directive="@case" injection="true" prefix="&lt;?php&#10;case (" suffix="): ?&gt;" />
<data directive="@checked" injection="true" prefix="&lt;?php if(" suffix=") {echo 'checked';}?&gt;" />
<data directive="@choice" injection="true" prefix="&lt;?php&#10;echo app('translator')-&gt;choice(" suffix="); ?&gt;" />
<data directive="@class" injection="true" prefix="class=&quot;&lt;?php echo \Illuminate\Support\Arr::toCssClasses(" suffix=")?&gt;&quot;" />
<data directive="@component" injection="true" prefix="&lt;?php&#10;$__env-&gt;startComponent(" suffix="); ?&gt;" />
<data directive="@componentfirst" injection="true" prefix="&lt;?php&#10;$__env-&gt;startComponentFirst(" suffix="); ?&gt;" />
<data directive="@continue" injection="true" prefix="&lt;?php&#10;if(" suffix=") continue; ?&gt;" />
<data directive="@csrf" />
<data directive="@dd" injection="true" prefix="&lt;?php&#10;dd(" suffix="); ?&gt;" />
<data directive="@default" />
<data directive="@disabled" injection="true" prefix="&lt;?php if(" suffix=") {echo 'disabled';}?&gt;" />
<data directive="@dump" injection="true" prefix="&lt;?php&#10;dump(" suffix="); ?&gt;" />
<data directive="@each" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;renderEach(" suffix="); ?&gt;" />
<data directive="@else" />
<data directive="@elseauth" injection="true" prefix="&lt;?php&#10;elseif(auth()-&gt;guard(" suffix=")-&gt;check()): ?&gt;" />
<data directive="@elsecan" injection="true" prefix="&lt;?php&#10;elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;check(" suffix=")): ?&gt;" />
<data directive="@elsecanany" injection="true" prefix="&lt;?php&#10;elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;any(" suffix=")): ?&gt;" />
<data directive="@elsecannot" injection="true" prefix="&lt;?php&#10;elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;denies(" suffix=")): ?&gt;" />
<data directive="@elseguest" injection="true" prefix="&lt;?php&#10;elseif(auth()-&gt;guard(" suffix=")-&gt;guest()): ?&gt;" />
<data directive="@elseif" injection="true" prefix="&lt;?php&#10;elseif(" suffix="): ?&gt;" />
<data directive="@elserole" injection="true" prefix="&lt;?php elseif(\Spatie\Permission\PermissionServiceProvider::bladeMethodWrapper('hasRole', {" suffix="})): ?&gt;" />
<data directive="@empty" injection="true" prefix="&lt;?php&#10;if(empty(" suffix=")): ?&gt;" />
<data directive="@endauth" />
<data directive="@endcan" />
<data directive="@endcanany" />
<data directive="@endcannot" />
<data directive="@endcomponent" />
<data directive="@endcomponentClass" />
<data directive="@endcomponentfirst" />
<data directive="@endempty" />
<data directive="@endenv" />
<data directive="@enderror" />
<data directive="@endfor" />
<data directive="@endforeach" />
<data directive="@endforelse" />
<data directive="@endfragment" />
<data directive="@endguest" />
<data directive="@endhasallroles" />
<data directive="@endhasanyrole" />
<data directive="@endhasexactroles" />
<data directive="@endhasrole" />
<data directive="@endif" />
<data directive="@endisset" />
<data directive="@endlang" />
<data directive="@endonce" />
<data directive="@endphp" />
<data directive="@endprepend" />
<data directive="@endprependonce" />
<data directive="@endproduction" />
<data directive="@endpush" />
<data directive="@endpushif" />
<data directive="@endpushonce" />
<data directive="@endrole" />
<data directive="@endsection" />
<data directive="@endsession" />
<data directive="@endslot" />
<data directive="@endswitch" />
<data directive="@endunless" />
<data directive="@endunlessrole" />
<data directive="@endverbatim" />
<data directive="@endwhile" />
<data directive="@env" injection="true" prefix="&lt;?php&#10;if(app()-&gt;environment(" suffix=")): ?&gt;" />
<data directive="@error" injection="true" prefix="&lt;?php&#10;$__errorArgs = [" suffix="];&#10;$__bag = $errors-&gt;getBag($__errorArgs[1] ?? 'default');&#10;if ($__bag-&gt;has($__errorArgs[0])) :&#10;if (isset($message)) { $__messageOriginal = $message; }&#10;$message = $__bag-&gt;first($__errorArgs[0]); ?&gt;" />
<data directive="@extends" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;make(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))-&gt;render(); ?&gt;" />
<data directive="@extendsfirst" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;first(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))-&gt;render(); ?&gt;" />
<data directive="@for" injection="true" prefix="&lt;?php&#10;for(" suffix="): ?&gt;" />
<data directive="@foreach" injection="true" prefix="&lt;?php&#10;foreach(" suffix="): ?&gt;" />
<data directive="@forelse" injection="true" prefix="&lt;?php&#10;foreach(" suffix="): ?&gt;" />
<data directive="@fragment" injection="true" prefix="&lt;?php&#10;$__env-&gt;startFragment(" suffix="); ?&gt;" />
<data directive="@guest" injection="true" prefix="&lt;?php&#10;if(auth()-&gt;guard(" suffix=")-&gt;guest()): ?&gt;" />
<data directive="@hasSection" injection="true" prefix="&lt;?php&#10;if (! empty(trim($__env-&gt;yieldContent(" suffix=")))): ?&gt;" />
<data directive="@hasallroles" injection="true" prefix="&lt;?php if(\Spatie\Permission\PermissionServiceProvider::bladeMethodWrapper('hasAllRoles', {" suffix="})): ?&gt;" />
<data directive="@hasanyrole" injection="true" prefix="&lt;?php if(\Spatie\Permission\PermissionServiceProvider::bladeMethodWrapper('hasAnyRole', {" suffix="})): ?&gt;" />
<data directive="@hasexactroles" injection="true" prefix="&lt;?php if(\Spatie\Permission\PermissionServiceProvider::bladeMethodWrapper('hasExactRoles', {" suffix="})): ?&gt;" />
<data directive="@hasrole" injection="true" prefix="&lt;?php if(\Spatie\Permission\PermissionServiceProvider::bladeMethodWrapper('hasRole', {" suffix="})): ?&gt;" />
<data directive="@if" injection="true" prefix="&lt;?php&#10;if(" suffix="): ?&gt;" />
<data directive="@include" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;make(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))-&gt;render(); ?&gt;" />
<data directive="@includeFirst" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;first(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))-&gt;render(); ?&gt;" />
<data directive="@includeUnless" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;renderUnless(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?&gt;" />
<data directive="@includeWhen" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;renderWhen(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?&gt;" />
<data directive="@isset" injection="true" prefix="&lt;?php&#10;if(isset(" suffix=")): ?&gt;" />
<data directive="@js" injection="true" prefix="&lt;?php _bladeDirective(" suffix="); ?&gt;" />
<data directive="@json" injection="true" prefix="&lt;?php&#10;echo json_encode(" suffix=") ?&gt;" />
<data directive="@lang" injection="true" prefix="&lt;?php&#10;echo app('translator')-&gt;get(" suffix="); ?&gt;" />
<data directive="@method" injection="true" prefix="&lt;?php&#10;echo method_field(" suffix="); ?&gt;" />
<data directive="@once" />
<data directive="@overwrite" />
<data directive="@parent" />
<data directive="@php" injection="true" prefix="&lt;?php&#10;(" suffix="); ?&gt;" />
<data directive="@prepend" injection="true" prefix="&lt;?php&#10;$__env-&gt;startPrepend(" suffix="); ?&gt;" />
<data directive="@prependonce" injection="true" prefix="&lt;?php&#10;$___phpstorm_prepend_once_params = [" suffix="]; if (! $__env-&gt;hasRenderedOnce($___phpstorm_prepend_once_params[1])): $__env-&gt;markAsRenderedOnce($___phpstorm_prepend_once_params); $__env-&gt;startPrepend($___phpstorm_prepend_once_params[0]); ?&gt;" />
<data directive="@production" />
<data directive="@props" injection="true" prefix="&lt;?php $attributes = $attributes-&gt;exceptProps(" suffix="); ?&gt;" />
<data directive="@push" injection="true" prefix="&lt;?php&#10;$__env-&gt;startPush(" suffix="); ?&gt;" />
<data directive="@pushif" injection="true" prefix="&lt;?php&#10;$__pushif_args = explode(','," suffix=", 2); if({$__pushif_args[0]}): $__env-&gt;startPush({$__pushif_args[1]}); ?&gt;" />
<data directive="@pushonce" injection="true" prefix="&lt;?php&#10;$__php_storm_push_once_params = [" suffix="]; if (!$__env-&gt;hasRenderedOnce($__php_storm_push_once_params[1])): $__env-&gt;markAsRenderedOnce($__php_storm_push_once_params[1]); $__env-&gt;startPush($__php_storm_push_once_params[0]); ?&gt;" />
<data directive="@readonly" injection="true" prefix="&lt;?php&#10;if(" suffix="): echo 'readonly'; endif; ?&gt;" />
<data directive="@required" injection="true" prefix="&lt;?php&#10;if(" suffix="): echo 'required'; endif; ?&gt;" />
<data directive="@role" injection="true" prefix="&lt;?php if(\Spatie\Permission\PermissionServiceProvider::bladeMethodWrapper('hasRole', {" suffix="})): ?&gt;" />
<data directive="@section" injection="true" prefix="&lt;?php&#10;$__env-&gt;startSection(" suffix="); ?&gt;" />
<data directive="@sectionMissing" injection="true" prefix="&lt;?php&#10;if (empty(trim($__env-&gt;yieldContent(" suffix=")))): ?&gt;" />
<data directive="@selected" injection="true" prefix="&lt;?php if(" suffix=") {echo 'selected';}?&gt;" />
<data directive="@session" injection="true" prefix="&lt;?php $value = session()-&gt;get(" suffix=")?&gt;&quot;" />
<data directive="@show" />
<data directive="@slot" injection="true" prefix="&lt;?php&#10;$__env-&gt;slot(" suffix="); ?&gt;" />
<data directive="@stack" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;yieldPushContent(" suffix="); ?&gt;" />
<data directive="@stop" />
<data directive="@style" injection="true" prefix="class=&quot;&lt;?php echo \Illuminate\Support\Arr::toCssStyles(" suffix=")?&gt;&quot;" />
<data directive="@switch" injection="true" prefix="&lt;?php&#10;switch(" suffix="): ?&gt;" />
<data directive="@unless" injection="true" prefix="&lt;?php&#10;if (! (" suffix=")): ?&gt;" />
<data directive="@unlessrole" injection="true" prefix="&lt;?php if(! \Spatie\Permission\PermissionServiceProvider::bladeMethodWrapper('hasRole', {" suffix="})): ?&gt;" />
<data directive="@unset" injection="true" prefix="&lt;?php&#10;unset(" suffix="); ?&gt;" />
<data directive="@verbatim" />
<data directive="@vite" injection="true" prefix="&lt;?php echo vite_func(" suffix="); ?&gt;" />
<data directive="@viteReactRefresh" />
<data directive="@vitereactrefresh" />
<data directive="@while" injection="true" prefix="&lt;?php&#10;while(" suffix="): ?&gt;" />
<data directive="@yield" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;yieldContent(" suffix="); ?&gt;" />
</directives>
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="framework" type="frameworkType"/>
<xs:complexType name="commandType">
<xs:all>
<xs:element type="xs:string" name="name" minOccurs="1" maxOccurs="1"/>
<xs:element type="xs:string" name="params" minOccurs="0" maxOccurs="1"/>
<xs:element type="xs:string" name="help" minOccurs="0" maxOccurs="1"/>
<xs:element type="optionsBeforeType" name="optionsBefore" minOccurs="0" maxOccurs="1"/>
</xs:all>
</xs:complexType>
<xs:complexType name="frameworkType">
<xs:sequence>
<xs:element type="xs:string" name="extraData" minOccurs="0" maxOccurs="1"/>
<xs:element type="commandType" name="command" maxOccurs="unbounded" minOccurs="0"/>
<xs:element type="xs:string" name="help" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="required"/>
<xs:attribute type="xs:string" name="invoke" use="required"/>
<xs:attribute type="xs:string" name="alias" use="required"/>
<xs:attribute type="xs:boolean" name="enabled" use="required"/>
<xs:attribute type="xs:integer" name="version" use="required"/>
<xs:attribute type="xs:string" name="frameworkId" use="optional"/>
</xs:complexType>
<xs:complexType name="optionsBeforeType">
<xs:sequence>
<xs:element type="optionType" name="option" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="optionType">
<xs:sequence>
<xs:element type="xs:string" name="help" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="required"/>
<xs:attribute type="xs:string" name="shortcut" use="optional"/>
<xs:attribute name="pattern" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="space"/>
<xs:enumeration value="equals"/>
<xs:enumeration value="unknown"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:schema>

7
.idea/discord.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="ASK" />
<option name="description" value="" />
</component>
</project>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JSHintConfiguration" version="2.13.6" use-config-file="true" use-custom-config-file="true" custom-config-file-path="$PROJECT_DIR$/resources/template/demo11/src/plugins/bootstrap-session-timeout/.jshintrc">
<option bitwise="true" />
<option browser="true" />
<option curly="true" />
<option eqeqeq="true" />
<option forin="true" />
<option maxerr="50" />
<option noarg="true" />
<option noempty="true" />
<option nonew="true" />
<option strict="true" />
<option undef="true" />
</component>
</project>

151
.idea/kuisioner-cdc.iml Normal file
View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/tests/Feature" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests/Unit" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" />
<sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" />
<sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" />
<sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" />
<sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" />
<sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" />
<sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" />
<sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" />
<sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" />
<sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" />
<sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
<excludeFolder url="file://$MODULE_DIR$/vendor/barryvdh/laravel-debugbar" />
<excludeFolder url="file://$MODULE_DIR$/vendor/brick/math" />
<excludeFolder url="file://$MODULE_DIR$/vendor/carbonphp/carbon-doctrine-types" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dflydev/dot-access-data" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dragonmantank/cron-expression" />
<excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fakerphp/faker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fruitcake/php-cors" />
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/uri-template" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hamcrest/hamcrest-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/breeze" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/framework" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/pint" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/prompts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/sail" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/sanctum" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/serializable-closure" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/tinker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/commonmark" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/config" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem-local" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/mime-type-detection" />
<excludeFolder url="file://$MODULE_DIR$/vendor/maximebf/debugbar" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mockery/mockery" />
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nette/schema" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nette/utils" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/collision" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/termwind" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/clock" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psy/psysh" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/collection" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/uuid" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/type" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/backtrace" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/flare-client-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/ignition" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-ignition" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-permission" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/css-selector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/error-handler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-kernel" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mailer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php83" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-uuid" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/routing" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/uid" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-dumper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/yaml" />
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
<excludeFolder url="file://$MODULE_DIR$/vendor/voku/portable-ascii" />
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

19
.idea/laravel-idea.xml Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="LaravelIdeaMainSettings">
<option name="codeGeneration">
<LaravelCodeGeneration>
<option name="generationStringSettings">
<map>
<entry key="createEloquentScope:inModuleNamespace" value="Models\Scopes" />
<entry key="createEloquentScope:namespace" value="Models\Scopes" />
<entry key="createModel:inModuleNamespace" value="Models" />
<entry key="createModel:namespace" value="Models" />
</map>
</option>
</LaravelCodeGeneration>
</option>
<option name="frameworkFound" value="true" />
<option name="userClassName" value="\AppModels\User" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/kuisioner-cdc.iml" filepath="$PROJECT_DIR$/.idea/kuisioner-cdc.iml" />
</modules>
</component>
</project>

152
.idea/php.xml Normal file
View File

@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="LaravelPint">
<laravel_pint_settings>
<LaravelPintConfiguration tool_path="$PROJECT_DIR$/vendor/bin/pint" />
</laravel_pint_settings>
</component>
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/vendor/league/config" />
<path value="$PROJECT_DIR$/vendor/league/commonmark" />
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
<path value="$PROJECT_DIR$/vendor/league/mime-type-detection" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/league/flysystem" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/vendor/league/flysystem-local" />
<path value="$PROJECT_DIR$/vendor/symfony/routing" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php83" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" />
<path value="$PROJECT_DIR$/vendor/nunomaduro/termwind" />
<path value="$PROJECT_DIR$/vendor/symfony/css-selector" />
<path value="$PROJECT_DIR$/vendor/nunomaduro/collision" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
<path value="$PROJECT_DIR$/vendor/symfony/mailer" />
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/fakerphp/faker" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
<path value="$PROJECT_DIR$/vendor/symfony/error-handler" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/symfony/console" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/vendor/symfony/uid" />
<path value="$PROJECT_DIR$/vendor/symfony/http-kernel" />
<path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/service-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/string" />
<path value="$PROJECT_DIR$/vendor/symfony/yaml" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
<path value="$PROJECT_DIR$/vendor/maximebf/debugbar" />
<path value="$PROJECT_DIR$/vendor/symfony/process" />
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-uuid" />
<path value="$PROJECT_DIR$/vendor/ramsey/collection" />
<path value="$PROJECT_DIR$/vendor/ramsey/uuid" />
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/vendor/psr/clock" />
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/psr/http-client" />
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/dflydev/dot-access-data" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/vendor/barryvdh/laravel-debugbar" />
<path value="$PROJECT_DIR$/vendor/hamcrest/hamcrest-php" />
<path value="$PROJECT_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
<path value="$PROJECT_DIR$/vendor/dragonmantank/cron-expression" />
<path value="$PROJECT_DIR$/vendor/carbonphp/carbon-doctrine-types" />
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
<path value="$PROJECT_DIR$/vendor/filp/whoops" />
<path value="$PROJECT_DIR$/vendor/fruitcake/php-cors" />
<path value="$PROJECT_DIR$/vendor/brick/math" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/uri-template" />
<path value="$PROJECT_DIR$/vendor/graham-campbell/result-type" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/vendor/phpoption/phpoption" />
<path value="$PROJECT_DIR$/vendor/psy/psysh" />
<path value="$PROJECT_DIR$/vendor/mockery/mockery" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/sebastian/type" />
<path value="$PROJECT_DIR$/vendor/nette/schema" />
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/vendor/nette/utils" />
<path value="$PROJECT_DIR$/vendor/sebastian/lines-of-code" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit" />
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
<path value="$PROJECT_DIR$/vendor/sebastian/cli-parser" />
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/vendor/sebastian/complexity" />
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/vendor/voku/portable-ascii" />
<path value="$PROJECT_DIR$/vendor/laravel/breeze" />
<path value="$PROJECT_DIR$/vendor/laravel/prompts" />
<path value="$PROJECT_DIR$/vendor/laravel/framework" />
<path value="$PROJECT_DIR$/vendor/laravel/sanctum" />
<path value="$PROJECT_DIR$/vendor/laravel/tinker" />
<path value="$PROJECT_DIR$/vendor/laravel/serializable-closure" />
<path value="$PROJECT_DIR$/vendor/laravel/pint" />
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/vendor/laravel/sail" />
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
<path value="$PROJECT_DIR$/vendor/spatie/backtrace" />
<path value="$PROJECT_DIR$/vendor/spatie/ignition" />
<path value="$PROJECT_DIR$/vendor/spatie/flare-client-php" />
<path value="$PROJECT_DIR$/vendor/spatie/laravel-ignition" />
<path value="$PROJECT_DIR$/vendor/spatie/laravel-permission" />
<path value="$PROJECT_DIR$/vendor/opcodesio/log-viewer" />
<path value="$PROJECT_DIR$/vendor/opcodesio/mail-parser" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.1" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

11
.idea/phpunit.xml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PHPUnit">
<option name="directories">
<list>
<option value="$PROJECT_DIR$/tests/Unit" />
<option value="$PROJECT_DIR$/tests/Feature" />
</list>
</option>
</component>
</project>

7
.idea/vcs.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

27
app/Console/Kernel.php Normal file
View File

@ -0,0 +1,27 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* The list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*/
public function register(): void
{
$this->reportable(function (Throwable $e) {
//
});
}
}

View File

@ -0,0 +1,48 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\LoginRequest;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\View;
class AuthenticatedSessionController extends Controller
{
/**
* Display the login view.
*/
public function create(): View
{
return view('auth.pages.login');
}
/**
* Handle an incoming authentication request.
*/
public function store(LoginRequest $request): RedirectResponse
{
$request->authenticate();
$request->session()->regenerate();
return redirect()->intended(RouteServiceProvider::HOME);
}
/**
* Destroy an authenticated session.
*/
public function destroy(Request $request): RedirectResponse
{
Auth::guard('web')->logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return redirect('/');
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\ValidationException;
use Illuminate\View\View;
class ConfirmablePasswordController extends Controller
{
/**
* Show the confirm password view.
*/
public function show(): View
{
return view('auth.confirm-password');
}
/**
* Confirm the user's password.
*/
public function store(Request $request): RedirectResponse
{
if (! Auth::guard('web')->validate([
'email' => $request->user()->email,
'password' => $request->password,
])) {
throw ValidationException::withMessages([
'password' => __('auth.password'),
]);
}
$request->session()->put('auth.password_confirmed_at', time());
return redirect()->intended(RouteServiceProvider::HOME);
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
class EmailVerificationNotificationController extends Controller
{
/**
* Send a new email verification notification.
*/
public function store(Request $request): RedirectResponse
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended(RouteServiceProvider::HOME);
}
$request->user()->sendEmailVerificationNotification();
return back()->with('status', 'verification-link-sent');
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
class EmailVerificationPromptController extends Controller
{
/**
* Display the email verification prompt.
*/
public function __invoke(Request $request): RedirectResponse|View
{
return $request->user()->hasVerifiedEmail()
? redirect()->intended(RouteServiceProvider::HOME)
: view('auth.verify-email');
}
}

View File

@ -0,0 +1,61 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Str;
use Illuminate\Validation\Rules;
use Illuminate\View\View;
class NewPasswordController extends Controller
{
/**
* Display the password reset view.
*/
public function create(Request $request): View
{
return view('auth.pages.reset-password', ['request' => $request]);
}
/**
* Handle an incoming new password request.
*
* @throws \Illuminate\Validation\ValidationException
*/
public function store(Request $request): RedirectResponse
{
$request->validate([
'token' => ['required'],
'email' => ['required', 'email'],
'password' => ['required', 'confirmed', Rules\Password::defaults()],
]);
// Here we will attempt to reset the user's password. If it is successful we
// will update the password on an actual user model and persist it to the
// database. Otherwise we will parse the error and return the response.
$status = Password::reset(
$request->only('email', 'password', 'password_confirmation', 'token'),
function ($user) use ($request) {
$user->forceFill([
'password' => Hash::make($request->password),
'remember_token' => Str::random(60),
])->save();
event(new PasswordReset($user));
}
);
// 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.
return $status == Password::PASSWORD_RESET
? redirect()->route('login')->with('status', __($status))
: back()->withInput($request->only('email'))
->withErrors(['email' => __($status)]);
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rules\Password;
class PasswordController extends Controller
{
/**
* Update the user's password.
*/
public function update(Request $request): RedirectResponse
{
$validated = $request->validateWithBag('updatePassword', [
'current_password' => ['required', 'current_password'],
'password' => ['required', Password::defaults(), 'confirmed'],
]);
$request->user()->update([
'password' => Hash::make($validated['password']),
]);
return back()->with('status', 'password-updated');
}
}

View File

@ -0,0 +1,44 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Password;
use Illuminate\View\View;
class PasswordResetLinkController extends Controller
{
/**
* Display the password reset link request view.
*/
public function create(): View
{
return view('auth.pages.forgot-password');
}
/**
* Handle an incoming password reset link request.
*
* @throws \Illuminate\Validation\ValidationException
*/
public function store(Request $request): RedirectResponse
{
$request->validate([
'email' => ['required', 'email'],
]);
// 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 $status == Password::RESET_LINK_SENT
? back()->with('status', __($status))
: back()->withInput($request->only('email'))
->withErrors(['email' => __($status)]);
}
}

View File

@ -0,0 +1,79 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Models\Student;
use App\Models\User;
use App\Providers\RouteServiceProvider;
use Illuminate\Auth\Events\Registered;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rules;
use Illuminate\View\View;
class RegisteredUserController extends Controller
{
/**
* Display the registration view.
*/
public function create(): View
{
return view('auth.pages.register');
}
/**
* Handle an incoming registration request.
*
* @throws \Illuminate\Validation\ValidationException
*/
public function store(Request $request): RedirectResponse
{
$request->validate([
'first_name' => ['required', 'string', 'max:100'],
'last_name' => ['required', 'string', 'max:100'],
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:' . User::class],
'password' => ['required', 'confirmed', Rules\Password::defaults()],
'password_confirmation' => ['required']
], [
'first_name.required' => 'Nama depan harus diisi.',
'first_name.string' => 'Nama depan harus berupa teks.',
'first_name.max' => 'Nama depan maksimal 100 karakter.',
'last_name.required' => 'Nama belakang harus diisi.',
'last_name.string' => 'Nama belakang harus berupa teks.',
'last_name.max' => 'Nama belakang maksimal 100 karakter.',
'email.required' => 'Email harus diisi.',
'email.string' => 'Email harus berupa teks.',
'email.lowercase' => 'Email harus berupa huruf kecil.',
'email.email' => 'Email tidak valid.',
'email.max' => 'Email maksimal 255 karakter.',
'email.unique' => 'Email sudah terdaftar.',
'password.required' => 'Password harus diisi.',
'password.confirmed' => 'Konfirmasi password tidak sesuai.',
'password.min' => 'Password minimal 8 karakter.',
'password.max' => 'Password maksimal 255 karakter.',
'password.regex' => 'Password harus mengandung huruf besar, huruf kecil, angka, dan karakter khusus.',
'password_confirmation.required' => 'Konfirmasi password harus diisi.',
]);
$user = User::create([
'name' => $request->first_name . ' ' . $request->last_name,
'email' => $request->email,
'password' => Hash::make($request->password),
]);
Student::create([
'user_id' => $user->id,
]);
event(new Registered($user));
Auth::login($user);
return redirect(RouteServiceProvider::HOME);
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Auth\Events\Verified;
use Illuminate\Foundation\Auth\EmailVerificationRequest;
use Illuminate\Http\RedirectResponse;
class VerifyEmailController extends Controller
{
/**
* Mark the authenticated user's email address as verified.
*/
public function __invoke(EmailVerificationRequest $request): RedirectResponse
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
}
if ($request->user()->markEmailAsVerified()) {
event(new Verified($request->user()));
}
return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, ValidatesRequests;
}

View File

@ -0,0 +1,158 @@
<?php
namespace App\Http\Controllers\Employee;
use App\Models\Career;
use Illuminate\View\View;
use App\Models\Department;
use Illuminate\Support\Str;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Storage;
use App\Http\Requests\Employee\CareerRequest;
class CareerController extends Controller
{
public function index(): View
{
// * Get all careers ordered by career_code ascending
$careers = Career::orderBy('career_code', 'asc')->get();
return view('employee.pages.career.index', compact('careers'));
}
public function generateCareerCode(): string
{
// * Get the latest career ordered by career_code descending
$latestCareer = Career::orderBy('career_code', 'desc')->first();
// * If there is no career, the next career code will be C0001
// * If there is a career, the next career code will be the latest career code + 1
if (!$latestCareer) {
$nextCareerCode = 'C0001';
} else {
$latestCareerCode = $latestCareer->career_code;
$number = (int) substr($latestCareerCode, 1);
$nextNumber = $number + 1;
$nextCareerCode = 'C' . str_pad($nextNumber, 4, '0', STR_PAD_LEFT);
}
return $nextCareerCode;
}
public function create(): View
{
// * Generate the career code
$generateCareerCode = $this->generateCareerCode();
// * Get all departments ordered by department_name ascending
$departments = Department::orderBy('department_name', 'asc')->get();
return view('employee.pages.career.create', compact('generateCareerCode', 'departments'));
}
public function store(CareerRequest $request): RedirectResponse
{
// * Create the career
$career = Career::create([
'career_code' => $request->career_code,
'career_title' => $request->career_title,
'slug' => Str::slug($request->career_title),
'career_description' => $request->career_description,
'is_specific' => $request->is_specific
]);
if ($request->hasFile('image_url')) {
$filename = time() . '_' . uniqid() . '.' . $request->image_url->getClientOriginalExtension();
$path = $request->image_url->storeAs('public/illustrations', $filename);
$imageUrl = Storage::url($path);
$career->image_url = $filename;
$career->save();
}
// * Sync the career with the departments
$career->departments()->sync($request->departments);
// * Notification
$notification = [
'message' => 'Karier telah berhasil ditambahkan',
'alert-type' => 'info',
];
return redirect()->route('careers')->with($notification);
}
public function edit(Career $careers): View
{
// * Get all departments ordered by department_name ascending
$departments = Department::orderBy('department_name', 'asc')->get();
// * Get the selected department ids
$selectedDepartmentIds = $careers->departments()->pluck('departments.id')->toArray();
return view('employee.pages.career.edit', compact('careers', 'departments', 'selectedDepartmentIds'));
}
public function update(CareerRequest $request, Career $careers): RedirectResponse
{
// * Update the career
$careers->update([
'career_code' => $request->career_code,
'career_title' => $request->career_title,
'slug' => Str::slug($request->career_title),
'career_description' => $request->career_description,
'is_specific' => $request->is_specific
]);
if ($request->hasFile('image_url')) {
$filename = time() . '_' . uniqid() . '.' . $request->image_url->getClientOriginalExtension();
$path = $request->image_url->storeAs('public/illustrations', $filename);
$imageUrl = Storage::url($path);
$careers->image_url = $filename;
$careers->save();
}
// * Sync the career with the departments
$careers->departments()->sync($request->departments);
// * Notification
$notification = [
'message' => 'Karier telah berhasil diperbarui',
'alert-type' => 'info',
];
return redirect()->route('careers')->with($notification);
}
public function reorderPersonalityCode(): void
{
// * Get all careers ordered by career_code ascending
$careerCode = Career::orderBy('career_code', 'asc')->get();
// * Reorder the career code
foreach ($careerCode as $index => $career) {
$career->update([
'career_code' => 'C' . str_pad($index + 1, 4, '0', STR_PAD_LEFT),
]);
}
}
public function destroy(Career $careers): RedirectResponse
{
// * Delete the career
$careers->delete();
// * Reorder the career code
$this->reorderPersonalityCode();
// * Notification
$notification = [
'message' => 'Karier telah berhasil dihapus',
'alert-type' => 'info',
];
return redirect()->route('careers')->with($notification);
}
}

View File

@ -0,0 +1,51 @@
<?php
namespace App\Http\Controllers\Employee;
use App\Models\Rule;
use App\Models\User;
use App\Models\Career;
use App\Models\Result;
use App\Models\Statement;
use Illuminate\View\View;
use App\Models\Personality;
use App\Http\Controllers\Controller;
class DashboardController extends Controller
{
public function index(): View
{
$users = User::count();
$statements = Statement::count();
$personalities = Personality::count();
$rules = Rule::count();
$results = Result::with('personality')->orderBy('created_at', 'desc')->get();
return view('employee.pages.dashboard.statistic', compact('users', 'statements', 'personalities', 'rules', 'results'));
}
public function historyDetail(Result $result): View
{
//? Convert String to array
$personalityNames = unserialize($result->overall_personality);
$personalityValues = unserialize($result->overall_score);
//? Get top personality description
$result = Result::with('personality')->where('id', $result->id)->first();
if ($result) {
$topPersonalityId = $result->personality->pluck('id')->first();
}
$potentialCareers = Career::with(['personalities', 'departments'])
->whereHas('personalities', function ($query) use ($topPersonalityId) {
$query->where('personalities.id', $topPersonalityId);
})
->whereHas('departments', function ($query) use ($result) {
$query->where('departments.id', $result->user->student->department_id);
})
->get();
return view('employee.pages.dashboard.history', compact('personalityNames', 'personalityValues', 'result', 'potentialCareers'));
}
}

View File

@ -0,0 +1,120 @@
<?php
namespace App\Http\Controllers\Employee;
use Illuminate\View\View;
use App\Models\Department;
use App\Models\Personality;
use Illuminate\Support\Str;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use App\Http\Requests\Employee\DepartmentRequest;
use App\Http\Requests\Employee\PersonalityRequest;
class DepartmentController extends Controller
{
public function index(): View
{
// * Get all department ordered by department_code ascending
$departments = Department::orderBy('department_code', 'asc')->get();
return view('employee.pages.department.index', compact('departments'));
}
public function generateDepartmentCode(): string
{
// * Get the latest department ordered by department_code descending
$latestDepartment = Department::orderBy('department_code', 'desc')->first();
// * If there is no departmment, the next departmment code will be D0001
if (!$latestDepartment) {
$nextDepartmentCode = 'D0001';
// * If there is a department, the next department code will be the latest department code + 1
} else {
$latestDepartmentCode = $latestDepartment->department_code;
$number = (int) substr($latestDepartmentCode, 1);
$nextNumber = $number + 1;
$nextDepartmentCode = 'D' . str_pad($nextNumber, 4, '0', STR_PAD_LEFT);
}
return $nextDepartmentCode;
}
public function create(): View
{
// * Generate the department code
$generateDepartmentCode = $this->generateDepartmentCode();
return view('employee.pages.department.create', compact('generateDepartmentCode'));
}
public function store(DepartmentRequest $request): RedirectResponse
{
// * Create the department
$department = Department::create([
'department_code' => $request->department_code,
'department_name' => $request->department_name,
]);
// * Notification
$notification = [
'message' => 'Jurusan telah berhasil ditambahkan',
'alert-type' => 'info',
];
return redirect()->route('departments')->with($notification);
}
public function edit(Department $departments): View
{
return view('employee.pages.department.edit', compact('departments'));
}
public function update(DepartmentRequest $request, Department $departments): RedirectResponse
{
// * Update the department
$departments->update([
'department_code' => $request->department_code,
'department_name' => $request->department_name,
]);
// * Notification
$notification = [
'message' => 'Jurusan telah berhasil diperbarui',
'alert-type' => 'info',
];
return redirect()->route('departments')->with($notification);
}
public function reorderDepartmentCode(): void
{
// * Get all departments ordered by department_code ascending
$departmentCode = Department::orderBy('department_code', 'asc')->get();
// * Reorder the department code
foreach ($departmentCode as $index => $department) {
$department->update([
'department_code' => 'D' . str_pad($index + 1, 4, '0', STR_PAD_LEFT),
]);
}
}
public function destroy(Department $departments): RedirectResponse
{
// * Delete the department
$departments->delete();
// * Reorder the department code
$this->reorderDepartmentCode();
// * Notification
$notification = [
'message' => 'Jurusan telah berhasil dihapus',
'alert-type' => 'info',
];
return redirect()->route('departments')->with($notification);
}
}

View File

@ -0,0 +1,157 @@
<?php
namespace App\Http\Controllers\Employee;
use App\Models\Career;
use Illuminate\View\View;
use App\Models\Personality;
use Illuminate\Support\Str;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Storage;
use App\Http\Requests\Employee\PersonalityRequest;
class PersonalityController extends Controller
{
public function index(): View
{
// * Get all personalities ordered by personality_code ascending
$personalities = Personality::with('career')->orderBy('personality_code', 'asc')->get();
return view('employee.pages.personality.index', compact('personalities'));
}
public function generatePersonalityCode(): string
{
// * Get the latest personality ordered by personality_code descending
$latestPersonality = Personality::orderBy('personality_code', 'desc')->first();
// * If there is no personality, the next personality code will be P001
if (!$latestPersonality) {
$nextPersonalityCode = 'P0001';
// * If there is a personality, the next personality code will be the latest personality code + 1
} else {
$latestPersonalityCode = $latestPersonality->personality_code;
$number = (int) substr($latestPersonalityCode, 1);
$nextNumber = $number + 1;
$nextPersonalityCode = 'P' . str_pad($nextNumber, 4, '0', STR_PAD_LEFT);
}
return $nextPersonalityCode;
}
public function create(): View
{
// * Generate the personality code
$generatePersonalityCode = $this->generatePersonalityCode();
// * Get all careers ordered by career_code ascending
$careers = Career::orderBy('career_code', 'asc')->get();
return view('employee.pages.personality.create', compact('generatePersonalityCode', 'careers'));
}
public function store(PersonalityRequest $request): RedirectResponse
{
// * Create the personality
$personality = Personality::create([
'personality_code' => $request->personality_code,
'personality' => $request->personality,
'slug' => Str::slug($request->personality),
'desc' => $request->desc,
]);
if ($request->hasFile('image_url')) {
$filename = time() . '_' . uniqid() . '.' . $request->image_url->getClientOriginalExtension();
$path = $request->image_url->storeAs('public/illustrations', $filename);
$imageUrl = Storage::url($path);
$personality->image_url = $filename;
$personality->save();
}
// * Sync the careers to the personality
$personality->career()->sync($request->careers);
// * Notification
$notification = [
'message' => 'Tipe kepribadian telah berhasil ditambahkan',
'alert-type' => 'info',
];
return redirect()->route('personalities')->with($notification);
}
public function edit(Personality $personalities): View
{
// * Get all careers ordered by career_code ascending
$careers = Career::orderBy('career_code', 'asc')->get();
// * Get the selected career ids
$selectedCareerIds = $personalities->career()->pluck('careers.id')->toArray();
return view('employee.pages.personality.edit', compact('personalities', 'careers', 'selectedCareerIds'));
}
public function update(PersonalityRequest $request, Personality $personalities): RedirectResponse
{
// * Update the personality
$personalities->update([
'personality_code' => $request->personality_code,
'personality' => $request->personality,
'slug' => Str::slug($request->personality),
'desc' => $request->desc,
]);
if ($request->hasFile('image_url')) {
$filename = time() . '_' . uniqid() . '.' . $request->image_url->getClientOriginalExtension();
$path = $request->image_url->storeAs('public/illustrations', $filename);
$imageUrl = Storage::url($path);
$personalities->image_url = $filename;
$personalities->save();
}
// * Sync the careers to the personality
$personalities->career()->sync($request->careers);
// * Notification
$notification = [
'message' => 'Tipe kepribadian telah berhasil diperbarui',
'alert-type' => 'info',
];
return redirect()->route('personalities')->with($notification);
}
public function reorderPersonalityCode(): void
{
// * Get all personalities ordered by personality_code ascending
$personalityCode = Personality::orderBy('personality_code', 'asc')->get();
// * Reorder the personality code
foreach ($personalityCode as $index => $personality) {
$personality->update([
'personality_code' => 'P' . str_pad($index + 1, 4, '0', STR_PAD_LEFT),
]);
}
}
public function destroy(Personality $personalities): RedirectResponse
{
// * Delete the personality
$personalities->delete();
// * Reorder the personality code
$this->reorderPersonalityCode();
// * Notification
$notification = [
'message' => 'Tipe kepribadian telah berhasil dihapus',
'alert-type' => 'info',
];
return redirect()->route('personalities')->with($notification);
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace App\Http\Controllers\Employee;
use Illuminate\Http\Request;
use Illuminate\Contracts\View\View;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Storage;
use App\Http\Controllers\Function\GetAgeController;
use App\Http\Requests\Employee\ProfileUpdateRequest;
class ProfileController extends Controller
{
public function index(Request $request): View
{
$user = $request->user();
$age = (new GetAgeController())->getAge($user->birth_date);
$profileCompletion = empty($user->gender) || empty($user->birth_date) || empty($user->address) || empty($user->phone)
|| empty($user->employee->nip) || empty($user->employee->position);
return view('employee.pages.profile.index', compact('user', 'age', 'profileCompletion'));
}
public function edit(Request $request): View
{
$user = $request->user();
return view('employee.pages.profile.edit', compact('user'));
}
public function update(ProfileUpdateRequest $request): RedirectResponse
{
$user = $request->user();
$user->update([
'name' => $request->name,
'gender' => $request->gender,
'birth_date' => $request->birth_date,
'phone' => $request->phone,
'address' => $request->address,
]);
if ($request->hasFile('picture')) {
$filename = time() . '_' . uniqid() . '.' . $request->picture->getClientOriginalExtension();
$path = $request->picture->storeAs('public/images', $filename);
$pictureUrl = Storage::url($path);
$user->picture = $pictureUrl;
$user->save();
}
if ($user->role === 'admin') {
$employee = $user->employee;
$employee->update([
'nip' => $request->nip,
'position' => $request->position,
]);
}
return redirect()->route('employee.profile.setting')->with('success', 'Profile updated successfully!');
}
}

View File

@ -0,0 +1,173 @@
<?php
namespace App\Http\Controllers\Employee;
use App\Http\Controllers\Controller;
use App\Http\Requests\Employee\RuleRequest;
use App\Models\Personality;
use App\Models\Rule;
use App\Models\Statement;
use App\Models\Weight;
use Illuminate\Http\RedirectResponse;
use Illuminate\View\View;
class RuleController extends Controller
{
public function index(): View
{
// * Get all rules ordered by rule code ordered by ascending
$rules = Rule::orderBy('rule_code', 'asc')->get();
return view('employee.pages.rule.index', compact('rules'));
}
public function graph(): View
{
// * Get all personalities ordered by personality code ordered by ascending
$personalities = Personality::orderBy('personality_code', 'asc')->get();
// * Get all rules ordered by rule code ordered by ascending
$rules = Rule::orderBy('rule_code', 'asc')->get();
// * Create an empty array to store unique statements
$uniqueStatements = [];
//* Mengelompokkan pernyataan berdasarkan nilai kunci dan menambahkan kepribadian ke dalam array
foreach ($rules as $rule) {
$statement = $rule->statement->statement;
$personality = $rule->personality->personality;
//* Jika pernyataan sudah ada, tambahkan kepribadian baru ke dalam array kepribadian
if (isset($uniqueStatements[$statement])) {
$uniqueStatements[$statement]['personalities'][] = $personality;
} else {
//* Jika pernyataan belum ada, buat kunci baru dan tambahkan array kepribadian baru
$uniqueStatements[$statement] = [
'statement_code' => $rule->statement->statement_code,
'personalities' => [$personality],
];
}
}
return view('employee.pages.rule.graph', compact('personalities', 'rules', 'uniqueStatements'));
}
public function generateRuleCode(): string
{
// * Get the latest rule ordered by rule code descending
$latestRule = Rule::orderBy('rule_code', 'desc')->first();
// * If there is no rule yet in the database then the next rule code is R001
if (!$latestRule) {
$nextRuleCode = 'R0001';
// * If there is a rule, the next rule code will be the latest rule code + 1
} else {
$latestRuleCode = $latestRule->rule_code;
$number = (int) substr($latestRuleCode, 1);
$nextNumber = $number + 1;
$nextRuleCode = 'R' . str_pad($nextNumber, 4, '0', STR_PAD_LEFT);
}
return $nextRuleCode;
}
public function create(): View
{
// * Get all statements ordered by statement code ordered by ascending
$statements = Statement::orderBy('statement_code', 'asc')->get();
// * Get all personalities ordered by personality code ordered by ascending
$personalities = Personality::orderBy('personality_code', 'asc')->get();
// * Get all weights ordered by weight ordered by ascending
$weights = Weight::orderBy('weight', 'asc')->get();
// * Generate rule code
$generateRuleCode = $this->generateRuleCode();
return view('employee.pages.rule.create', compact('statements', 'personalities', 'weights', 'generateRuleCode'));
}
public function store(RuleRequest $request): RedirectResponse
{
// * Create the rule
Rule::create([
'rule_code' => $request->rule_code,
'statement_id' => $request->statement_id,
'personality_id' => $request->personality_id,
'weight_id' => $request->weight_id,
]);
// * Notification
$notification = [
'message' => 'Aturan telah berhasil ditambahkan',
'alert-type' => 'info',
];
return redirect()->route('rules')->with($notification);
}
public function edit(Rule $rules): View
{
// * Get all statements ordered by statement code ordered by ascending
$statements = Statement::orderBy('statement_code', 'asc')->get();
// * Get all personalities ordered by personality code ordered by ascending
$personalities = Personality::orderBy('personality_code', 'asc')->get();
// * Get all weights ordered by weight ordered by ascending
$weights = Weight::orderBy('weight', 'asc')->get();
return view('employee.pages.rule.edit', compact('rules', 'statements', 'personalities', 'weights'));
}
public function update(RuleRequest $request, Rule $rules): RedirectResponse
{
// * Update the rule
$rules->update([
'rule_code' => $request->rule_code,
'statement_id' => $request->statement_id,
'personality_id' => $request->personality_id,
'weight_id' => $request->weight_id,
]);
// * Notification
$notification = [
'message' => 'Aturan telah berhasil diperbarui',
'alert-type' => 'info',
];
return redirect()->route('rules')->with($notification);
}
public function reorderRuleCode(): void
{
// * Get all rule code ordered by rule code ascending
$ruleCode = Rule::orderBy('rule_code', 'asc')->get();
// * Reorder rule code
foreach ($ruleCode as $key => $rule) {
$rule->update([
'rule_code' => 'R' . str_pad($key + 1, 4, '0', STR_PAD_LEFT),
]);
}
}
public function destroy(Rule $rules): RedirectResponse
{
// * Delete the rule
$rules->delete();
// * Reorder rule code
$this->reorderRuleCode();
// * Notification
$notification = [
'message' => 'Aturan telah berhasil dihapus',
'alert-type' => 'info',
];
return redirect()->route('rules')->with($notification);
}
}

View File

@ -0,0 +1,39 @@
<?php
namespace App\Http\Controllers\Employee;
use App\Http\Controllers\Controller;
use App\Http\Requests\Employee\EmailUpdateRequest;
use App\Http\Requests\Employee\PasswordUpdateRequest;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\View\View;
class SettingController extends Controller
{
public function index(Request $request): View
{
$user = $request->user();
return view('employee.pages.profile.setting', compact('user'));
}
public function updateEmail(EmailUpdateRequest $request): RedirectResponse
{
$request->user()->update([
'email' => $request->email,
]);
return redirect()->route('employee.profile.account')->with('success', 'Email updated successfully!');
}
public function updatePassword(PasswordUpdateRequest $request): RedirectResponse
{
$request->user()->update([
'password' => Hash::make($request->password),
]);
return redirect()->route('employee.profile.account')->with('success', 'Password updated successfuly!');
}
}

View File

@ -0,0 +1,119 @@
<?php
namespace App\Http\Controllers\Employee;
use App\Http\Controllers\Controller;
use App\Http\Requests\Employee\StatementRequest;
use App\Models\Statement;
use Illuminate\Http\RedirectResponse;
use Illuminate\View\View;
class StatementController extends Controller
{
public function index(): View
{
// * Get all statements ordered by statement code ascending
$statements = Statement::orderBy('statement_code', 'asc')->get();
return view('employee.pages.statement.index', compact('statements'));
}
public function generateStatementCode(): string
{
// * Get the latest statement ordered by statement code descending
$latestStatement = Statement::orderBy('statement_code', 'desc')->first();
// * If there is no statement yet in the database then the next statement code is T001
if (!$latestStatement) {
$nextStatementCode = 'T0001';
// * If there is a statement, the next statement code will be the latest statement code + 1
} else {
$latestStatementCode = $latestStatement->statement_code;
$number = (int) substr($latestStatementCode, 1);
$nextNumber = $number + 1;
$nextStatementCode = 'T' . str_pad($nextNumber, 4, '0', STR_PAD_LEFT);
}
return $nextStatementCode;
}
public function create(): View
{
// * Generate statement code
$generateStatementCode = $this->generateStatementCode();
return view('employee.pages.statement.create', compact('generateStatementCode'));
}
public function store(StatementRequest $request): RedirectResponse
{
// * Create the statement
Statement::create([
'statement_code' => $request->statement_code,
'statement' => $request->statement,
'desc' => $request->desc,
]);
// * Notification
$notification = [
'message' => 'Statemen telah berhasil ditambahkan',
'alert-type' => 'info',
];
return redirect()->route('statements')->with($notification);
}
public function edit(Statement $statements): View
{
return view('employee.pages.statement.edit', compact('statements'));
}
public function update(StatementRequest $request, Statement $statements): RedirectResponse
{
// * Update the statement
$statements->update([
'statement_code' => $request->statement_code,
'statement' => $request->statement,
'desc' => $request->desc,
]);
// * Notification
$notification = [
'message' => 'Statemen telah berhasil diperbarui',
'alert-type' => 'info',
];
return redirect()->route('statements')->with($notification);
}
public function reorderStatementCode(): void
{
// * Get all statement code ordered by statement code ascending
$statementCode = Statement::orderBy('statement_code', 'asc')->get();
// * Reorder statement code
foreach ($statementCode as $key => $statement) {
$statement->update([
'statement_code' => 'T' . str_pad($key + 1, 4, '0', STR_PAD_LEFT),
]);
}
}
public function destroy(Statement $statements): RedirectResponse
{
// * Delete the statement
$statements->delete();
// * Reorder statement code
$this->reorderStatementCode();
// * Notification
$notification = [
'message' => 'Statemen telah berhasil dihapus',
'alert-type' => 'info',
];
return redirect()->route('statements')->with($notification);
}
}

View File

@ -0,0 +1,117 @@
<?php
namespace App\Http\Controllers\Employee;
use App\Http\Controllers\Controller;
use App\Http\Requests\Employee\UserEmployeeRequest;
use App\Models\Department;
use App\Models\Employee;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\View\View;
class UserManagementController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(): View
{
$users = User::all();
return view('employee.pages.user.index', compact('users'));
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('employee.pages.user.create');
}
/**
* Store a newly created resource in storage.
*/
public function store(UserEmployeeRequest $request)
{
$user = User::create([
'name' => $request->name,
'email' => $request->email,
'password' => bcrypt($request->password),
'gender' => $request->gender,
'birth_date' => $request->birth_date,
'phone' => $request->phone,
'address' => $request->address,
'role' => 'admin',
]);
Employee::create([
'user_id' => $user->id,
'nip' => $request->nip,
'position' => $request->position,
]);
return redirect()->route('employee.users')->with('success', 'User has been created');
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(User $user)
{
$departments = Department::orderBy('department_name', 'asc')->get();
return view('employee.pages.user.edit', compact('user', 'departments'));
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, User $user)
{
if ($user->role === 'admin') {
$user->update([
'name' => $request->name,
'email' => $request->email,
]);
$user->employee->update([
'user_id' => $user->id,
'nip' => $request->nip,
'position' => $request->position,
]);
} elseif ($user->role === 'student') {
$user->update([
'name' => $request->name,
'email' => $request->email,
]);
$user->student->update([
'user_id' => $user->id,
'nim' => $request->nim,
'faculty' => $request->faculty,
'department_id' => $request->department_id,
]);
}
// dd($request->all());
return redirect()->route('employee.users')->with('success', 'User has been updated');
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}

View File

@ -0,0 +1,76 @@
<?php
namespace App\Http\Controllers\Employee;
use App\Models\Weight;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use App\Http\Requests\Employee\WeightRequest;
use Illuminate\View\View;
class WeightController extends Controller
{
public function index(): View
{
// * Get all weights ordered by weight ascending
$weights = Weight::orderBy('weight', 'asc')->get();
return view('employee.pages.weight.index', compact('weights'));
}
public function create(): View
{
return view('employee.pages.weight.create');
}
public function store(WeightRequest $request): RedirectResponse
{
// * Create the weight
Weight::create([
'weight' => $request->weight,
]);
// * Notification
$notification = [
'message' => 'Bobot telah berhasil ditambahkan',
'alert-type' => 'info',
];
return redirect()->route('weights')->with($notification);
}
public function edit(Weight $weights): View
{
return view('employee.pages.weight.edit', compact('weights'));
}
public function update(WeightRequest $request, Weight $weights): RedirectResponse
{
// * Update the weight
$weights->update([
'weight' => $request->weight,
]);
// * Notification
$notification = [
'message' => 'Bobot telah berhasil diperbarui',
'alert-type' => 'info',
];
return redirect()->route('weights')->with($notification);
}
public function destroy(Weight $weights): RedirectResponse
{
// * Delete the weight
$weights->delete();
// * Notification
$notification = [
'message' => 'Bobot telah berhasil dihapus',
'alert-type' => 'info',
];
return redirect()->route('weights')->with($notification);
}
}

View File

@ -0,0 +1,168 @@
<?php
namespace App\Http\Controllers\Function;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
class CalcController extends Controller
{
public function getRulesData($statement)
{
return DB::table('rules AS a')
->selectRaw('GROUP_CONCAT(b.personality_code) as personality_code, c.weight, a.statement_id')
->join('personalities AS b', 'a.personality_id', '=', 'b.id')
->join('weights AS c', 'a.weight_id', '=', 'c.id')
->whereIn('a.statement_id', $statement)
->orderBy('a.rule_code', 'asc')
->groupBy('a.statement_id')
->get();
}
public function mapRulesData($rulesData)
{
return $rulesData->map(function ($item) {
$personalityCode = $item->personality_code;
$weight = (string) $item->weight;
$statementId = $item->statement_id;
return [$personalityCode, $weight, $statementId];
})->toArray();
}
public function getStatementData($rulesData)
{
$statementData = [];
foreach ($rulesData as $rule) {
$statement = DB::table('statements')
->select()
->where('id', $rule[2])
->get();
if ($statement->isNotEmpty()) {
$statementData[] = [
'statement_code' => $statement[0]->statement_code,
'statement' => $statement[0]->statement,
];
}
}
return $statementData;
}
public function getPersonalitiesData()
{
return DB::table('personalities')
->selectRaw('GROUP_CONCAT(personality_code) as personality_code')
->get();
}
public function mapPersonalitiesData($personalitiesData)
{
return $personalitiesData->map(function ($item) {
$personalityCode = $item->personality_code;
// Create a new array with numeric keys
return [$personalityCode];
})->toArray();
}
public function processEvidence($rules, $personalitiesData)
{
//? Mendapatkan nilai FOD dari data personalitas pada indeks 0
$fod = $personalitiesData[0][0];
//? Inisialisasi array densitas baru.
$newDensity = [];
//? Jika hanya ada satu aturan, langsung kembalikan hasil perhitungan densitas baru.
if (count($rules) == 1) {
foreach ($rules as $rule) {
$newDensity[$rule[0]] = (float) $rule[1];
}
return $newDensity;
} else {
//? Jika masih ada aturan yang belum diproses.
while (!empty($rules)) {
//? Mengambil aturan pertama dari daftar aturan.
$densitas1[0] = array_shift($rules);
//? // Menghitung nilai densitas pada baris atas dari Y2.
$densitas1[1] = [$fod, 1 - $densitas1[0][1]];
//? Inisialisasi array densitas ke-2.
$densitas2 = [];
//
if (empty($newDensity)) {
//nilai pada X1 baris 1
$densitas2[0] = array_shift($rules);
} else {
foreach ($newDensity as $k => $r) {
//nilai pada X1 baris 2; jika ad densitas baru
if ($k != 'θ') {
$densitas2[] = [$k, $r];
}
}
}
$theta = 1;
//nilai X1 baris 2 teta
foreach ($densitas2 as $d) {
$theta -= $d[1];
}
$densitas2[] = [$fod, $theta];
$m = count($densitas2);
$newDensity = [];
for ($y = 0; $y < $m; $y++) {
for ($x = 0; $x < 2; $x++) {
if (!($y == $m - 1 && $x == 1)) {
$v = explode(',', $densitas1[$x][0]);
$w = explode(',', $densitas2[$y][0]);
sort($v);
sort($w);
$vw = array_intersect($v, $w);
if (empty($vw)) {
$k = 'θ';
} else {
$k = implode(',', $vw);
}
if (!isset($newDensity[$k])) {
$newDensity[$k] = $densitas1[$x][1] * $densitas2[$y][1];
$k = implode(',', $vw);
} else {
$newDensity[$k] += $densitas1[$x][1] * $densitas2[$y][1];
}
}
}
}
foreach ($newDensity as $k => $d) {
// Periksa apakah kunci bukan θ
if ($k != 'θ') {
// Tentukan nilai untuk theta, jika tidak ada konflik maka 0
$thetaValue = isset($newDensity['θ']) ? $newDensity['θ'] : 0;
// Hitung densitas baru sesuai dengan rumus Dempster-Shafer
$newDensity[$k] = $d / (1 - $thetaValue);
}
}
//? Filter array dengan key theta "θ"
$newDensity = array_filter($newDensity, function ($key) {
return $key !== 'θ';
}, ARRAY_FILTER_USE_KEY);
}
}
//? Mengurutkan array berdasarkan nilai dari terbesar ke terkecil
arsort($newDensity);
return $newDensity;
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Controllers\Function;
use App\Http\Controllers\Controller;
use Illuminate\Support\Carbon;
class GetAgeController extends Controller
{
public function getAge(?string $birthDate)
{
$birthDate = Carbon::parse($birthDate);
$today = Carbon::now();
return $birthDate->diffInYears($today);
}
}

View File

@ -0,0 +1,74 @@
<?php
namespace App\Http\Controllers\Function;
use App\Models\Rule;
use App\Models\Statement;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class LaborController extends Controller
{
public function quest()
{
$quests = Rule::join('statements', 'rules.statement_id', '=', 'statements.id')
->orderBy('rules.rule_code', 'asc')
->select('statements.*')
->distinct()
->get();
return view('employee.pages.theory.quest', compact('quests'));
}
public function calculator(Request $request)
{
// $quests = Rule::join('statements', 'rules.statement_id', '=', 'statements.id')
// ->orderBy('rules.rule_code', 'asc')
// ->select('statements.*')
// ->distinct()
// ->get();
$quests = Statement::all();
// Select all statement columns
// Inisialisasi array untuk menyimpan ID pernyataan yang dijawab
$answeredQuestIds = [];
// Loop melalui setiap pernyataan untuk memeriksa jawaban yang diinput
foreach ($quests as $quest) {
// Dapatkan nilai input untuk pernyataan saat ini
$inputValue = $request->input($quest->statement_code);
//! tambahkan validasi jika jawaban kosong
// Periksa apakah nilai input tidak kosong dan tidak sama dengan "on"
if (!empty($inputValue) && $inputValue !== 'on') {
// Jika dijawab, tambahkan ID pernyataan ke dalam array
$answeredQuestIds[] = $quest->id;
}
}
// dd($answeredQuestIds);
// $evidence = ["65600f6d-aaa6-424f-b065-29e953cef651", "3351350f-0806-46b5-aebc-4fcf4ce08efb", "73fa4954-e2a1-4639-9e93-df54d85bb5c8", "38a5f7d8-bfba-4f53-9a53-428e52be162a"];
$calc = new CalcController();
$rulesQuery = $calc->getRulesData($answeredQuestIds);
$rulesData = $calc->mapRulesData($rulesQuery);
//? Mendapatkan data statement
$statementData = $calc->getStatementData($rulesData);
$personalitiesQuery = $calc->getPersonalitiesData();
$personalitiesData = $calc->mapPersonalitiesData($personalitiesQuery);
$result = $calc->processEvidence($rulesData, $personalitiesData);
// dd($result);
return view('employee.pages.theory.calc', [
'rules' => $rulesData,
'statementData' => $statementData,
'personalitiesData' => $personalitiesData,
]);
}
}

View File

@ -0,0 +1,60 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\ProfileUpdateRequest;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
use Illuminate\View\View;
class ProfileController extends Controller
{
/**
* Display the user's profile form.
*/
public function edit(Request $request): View
{
return view('profile.edit', [
'user' => $request->user(),
]);
}
/**
* Update the user's profile information.
*/
public function update(ProfileUpdateRequest $request): RedirectResponse
{
$request->user()->fill($request->validated());
if ($request->user()->isDirty('email')) {
$request->user()->email_verified_at = null;
}
$request->user()->save();
return Redirect::route('profile.edit')->with('status', 'profile-updated');
}
/**
* Delete the user's account.
*/
public function destroy(Request $request): RedirectResponse
{
$request->validateWithBag('userDeletion', [
'password' => ['required', 'current_password'],
]);
$user = $request->user();
Auth::logout();
$user->delete();
$request->session()->invalidate();
$request->session()->regenerateToken();
return Redirect::to('/');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers\Student;
use App\Http\Controllers\Controller;
class DashboardController extends Controller
{
public function index()
{
return view('student.pages.dashboard.dashboard');
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Http\Controllers\Student;
use App\Http\Controllers\Controller;
use App\Models\Personality;
use Illuminate\View\View;
class PersonalityController extends Controller
{
public function index(): View
{
$personalities = Personality::orderBy('personality_code', 'asc')->get();
return view('student.pages.personality.index', compact('personalities'));
}
public function view(string $slug): View
{
$personality = Personality::where('slug', $slug)->first();
return view('student.pages.personality.detail', compact('personality'));
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace App\Http\Controllers\Student;
use App\Models\Department;
use Illuminate\Http\Request;
use Illuminate\Contracts\View\View;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Storage;
use App\Http\Controllers\Function\GetAgeController;
use App\Http\Requests\Student\ProfileUpdateRequest;
class ProfileController extends Controller
{
public function index(Request $request): View
{
$user = $request->user();
$age = (new GetAgeController())->getAge($user->birth_date);
$profileCompletion = empty($user->gender) || empty($user->birth_date) || empty($user->address) || empty($user->phone)
|| empty($user->student->nim) || empty($user->student->department_id) || empty($user->student->faculty);
return view('student.pages.myprofile.index', compact('user', 'age', 'profileCompletion'));
}
public function edit(Request $request): View
{
$user = $request->user();
$departments = Department::orderBy('department_name', 'asc')->get();
return view('student.pages.myprofile.edit', compact('user', 'departments'));
}
public function update(ProfileUpdateRequest $request): RedirectResponse
{
$user = $request->user();
$user->update([
'name' => $request->name,
'gender' => $request->gender,
'birth_date' => $request->birth_date,
'phone' => $request->phone,
'address' => $request->address,
]);
if ($request->hasFile('picture')) {
$filename = time() . '_' . uniqid() . '.' . $request->picture->getClientOriginalExtension();
$path = $request->picture->storeAs('public/images', $filename);
$pictureUrl = Storage::url($path);
$user->picture = $pictureUrl;
$user->save();
}
if ($user->role === 'student') {
$student = $user->student;
$student->update([
'nim' => $request->nim,
'department_id' => $request->department_id,
'faculty' => $request->faculty,
]);
}
return redirect()->route('student.profile.setting')->with('success', 'Profile updated successfully!');
}
}

View File

@ -0,0 +1,166 @@
<?php
namespace App\Http\Controllers\Student;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Function\CalcController;
use App\Models\Personality;
use App\Models\Result;
use App\Models\Rule;
use App\Models\Statement;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
class QuisionnareController extends Controller
{
public function index(Request $request): View
{
$user = $request->user();
$hasCompleteProfile = empty($user->student->nim) || empty($user->student->department_id) || empty($user->student->faculty);
$hasStatement = Rule::count();
return view('student.pages.quisionnare.index', compact('hasCompleteProfile', 'hasStatement'));
}
public function quest(): View
{
$quests = Statement::join('rules', 'statements.id', '=', 'rules.statement_id')
->orderByRaw('rules.rule_code ASC')
->whereRaw('rules.id = (select id from rules where statement_id = statements.id limit 1)')
->get();
$hasStatement = Rule::count();
return view('student.pages.quisionnare.quest', compact('quests', 'hasStatement'));
}
public function store(Request $request): RedirectResponse
{
// dd($request->all());
//! Jika semua pernyataan dijawab tidak, kembalikan ke halaman sebelumnya
// Mengambil semua input kecuali '_token'
$inputValues = $request->except('_token');
// Memeriksa apakah semua nilai adalah 'on'
if (count(array_filter($inputValues, fn ($value) => $value !== 'on')) === 0) {
return redirect()->route('student.quisionnare.start')->with('error', 'Hasil tes tidak dapat diidentifikasi, silahkan melakukan tes ulang');
}
$quests = Statement::orderBy('statement_code', 'asc')->get();
// Inisialisasi array untuk menyimpan ID pernyataan yang dijawab
$answeredQuestIds = [];
// Loop melalui setiap pernyataan untuk memeriksa jawaban yang diinput
foreach ($quests as $quest) {
// Dapatkan nilai input untuk pernyataan saat ini
$inputValue = $request->input($quest->statement_code);
// Periksa apakah nilai input tidak kosong dan tidak sama dengan "on"
if (!empty($inputValue) && $inputValue !== 'on') {
// Jika dijawab, tambahkan ID pernyataan ke dalam array
$answeredQuestIds[] = $quest->id;
}
}
// dd($answeredQuestIds);
$calc = new CalcController();
$rulesQuery = $calc->getRulesData($answeredQuestIds);
$rulesData = $calc->mapRulesData($rulesQuery);
$statementData = $calc->getStatementData($rulesData);
$personalitiesQuery = $calc->getPersonalitiesData();
$personalitiesData = $calc->mapPersonalitiesData($personalitiesQuery);
$result = $calc->processEvidence($rulesData, $personalitiesData);
// dd($result);
// calculate the result with dempster shafer theory
// Menghitung total nilai
// $total = array_sum($result);
//? Ambil kode personality teratas
// $topPersonalityCode = array_key_first($result);
$arrayPersonalities = array_keys($result);
// dd($arrayPersonalities);
$firstPersonalityCode = $arrayPersonalities[0];
if (count($arrayPersonalities) > 1) {
$secondPersonalityCode = $arrayPersonalities[1];
}
if (count($arrayPersonalities) > 2) {
$thirdPersonalityCode = $arrayPersonalities[2];
}
// dd($topPersonalityCode, $firstPersonalityCode, $secondPersonalityCode, $thirdPersonalityCode);
$topPersonalityId = Personality::where('personality_code', $firstPersonalityCode)->first()->id;
$secondPersonalityId = null;
$thirdPersonalityId = null;
//? Inisialisasi array untuk menyimpan nama personality dan nilai
$personalityNames = [];
$personalityValues = [];
foreach ($result as $key => $value) {
// Hitung persentase untuk setiap nilai
$percentage = round($value, 3); //* Bulatkan ke tiga angka desimal
$percentageRound = $percentage * 100; //* Ubah ke persen
// Cari nama personality berdasarkan kode personality
$personality = Personality::where('personality_code', $key)->first();
// Periksa apakah personality ditemukan
if ($personality) {
// Jika ditemukan, simpan nama personality dan persentase ke dalam array
$personalityNames[] = $personality->personality;
$personalityValues[] = $percentageRound;
}
}
// dd($result, $topPersonalityCode, $topPersonalityId, $personalityNames, $personalityValues);
// dd($personalityValues);
if (count($arrayPersonalities) > 1 && $personalityValues[1] > 0) {
$secondPersonalityId = Personality::where('personality_code', $secondPersonalityCode)->first()->id;
}
if (count($arrayPersonalities) > 2 && $personalityValues[2] > 0) {
$thirdPersonalityId = Personality::where('personality_code', $thirdPersonalityCode)->first()->id;
}
$overallPersonality = serialize($personalityNames);
$overallScore = serialize($personalityValues);
$result = Result::create([
'user_id' => auth()->id(),
'overall_personality' => $overallPersonality,
'overall_score' => $overallScore,
]);
$personalitiesToSync = [];
if ($topPersonalityId) {
$personalitiesToSync[] = $topPersonalityId;
}
if ($secondPersonalityId) {
$personalitiesToSync[] = $secondPersonalityId;
}
if ($thirdPersonalityId) {
$personalitiesToSync[] = $thirdPersonalityId;
}
$result->personality()->sync($personalitiesToSync);
return redirect()->route('student.result');
}
}

View File

@ -0,0 +1,93 @@
<?php
namespace App\Http\Controllers\Student;
use App\Http\Controllers\Controller;
use App\Models\Career;
use App\Models\Personality;
use App\Models\Result;
use Illuminate\Http\RedirectResponse;
use Illuminate\View\View;
class ResultController extends Controller
{
public function index(): View|RedirectResponse
{
// $personalityNames = ["Investigative", "Artistic", "Social", "Enterprising", "Conventional", "Realistic", "Unknown"];
// $personalityValues = [78, 15, 15, 14, 23, 30, 2];
//? Get user data
$user = auth()->user();
$result = Result::with(['user', 'personality'])->where('user_id', $user->id)
->orderBy('created_at', 'desc')
->first();
// ? Check if result is null
if ($result === null) {
return redirect()->route('student.quisionnare.start')->with('error', 'Tidak ada hasil yang ditemukan. Silakan mulai kuesioner untuk mendapatkan hasil.');
}
if ($result) {
$topPersonalityId = $result->personality->pluck('id')->first();
}
//? Convert String to array
$personalityNames = unserialize($result->overall_personality);
$personalityValues = unserialize($result->overall_score);
//? Get top personality description
// $topPersonalityDesc = Personality::where('id', $result->personality_id)->first();
$potentialCareers = Career::with(['personalities', 'departments'])
->whereHas('personalities', function ($query) use ($topPersonalityId) {
$query->where('personalities.id', $topPersonalityId);
})
->whereHas('departments', function ($query) use ($user) {
$query->where('departments.id', $user->student->department_id);
})
->get();
// dd($personalityNames, $personalityValues, $topPersonalityDesc);
return view('student.pages.result.index', compact('personalityNames', 'personalityValues', 'result', 'potentialCareers'));
}
public function resultList(): View
{
$results = Result::with('user', 'personality')
->where('user_id', auth()->user()->id)
->orderBy('created_at', 'desc')
->get();
return view('student.pages.result.list', compact('results'));
}
public function resultDetail(Result $result): View
{
//? Get user data
$user = auth()->user();
//? Convert String to array
$personalityNames = unserialize($result->overall_personality);
$personalityValues = unserialize($result->overall_score);
//? Get top personality description
$result = Result::with('personality')->where('id', $result->id)->first();
if ($result) {
$topPersonalityId = $result->personality->pluck('id')->first();
}
$potentialCareers = Career::with(['personalities', 'departments'])
->whereHas('personalities', function ($query) use ($topPersonalityId) {
$query->where('personalities.id', $topPersonalityId);
})
->whereHas('departments', function ($query) use ($user) {
$query->where('departments.id', $user->student->department_id);
})
->get();
return view('student.pages.result.index', compact('personalityNames', 'personalityValues', 'result', 'potentialCareers'));
}
}

View File

@ -0,0 +1,39 @@
<?php
namespace App\Http\Controllers\Student;
use App\Http\Controllers\Controller;
use App\Http\Requests\Student\EmailUpdateRequest;
use App\Http\Requests\Student\PasswordUpdateRequest;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\View\View;
class SettingController extends Controller
{
public function index(Request $request): View
{
$user = $request->user();
return view('student.pages.myprofile.setting', compact('user'));
}
public function updateEmail(EmailUpdateRequest $request): RedirectResponse
{
$request->user()->update([
'email' => $request->email,
]);
return redirect()->route('student.profile.account')->with('success', 'Email updated successfully!');
}
public function updatePassword(PasswordUpdateRequest $request): RedirectResponse
{
$request->user()->update([
'password' => Hash::make($request->password),
]);
return redirect()->route('student.profile.account')->with('success', 'Password updated successfuly!');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers\Theory;
use App\Http\Controllers\Controller;
class DempsterController extends Controller
{
public function index()
{
return view('employee.pages.theory.index');
}
}

69
app/Http/Kernel.php Normal file
View File

@ -0,0 +1,69 @@
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's middleware aliases.
*
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
*
* @var array<string, class-string|string>
*/
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'employee' => \App\Http\Middleware\EmployeeMiddleware::class,
];
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*/
protected function redirectTo(Request $request): ?string
{
return $request->expectsJson() ? null : route('login');
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class EmployeeMiddleware
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (Auth::user()->role !== 'admin') {
return redirect()->route('student.dashboard');
}
return $next($request);
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next, string ...$guards): Response
{
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}
return $next($request);
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array<int, string>
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
class TrustHosts extends Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array<int, string|null>
*/
public function hosts(): array
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [
// 'fbclid',
// 'utm_campaign',
// 'utm_content',
// 'utm_medium',
// 'utm_source',
// 'utm_term',
];
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array<int, string>
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,96 @@
<?php
namespace App\Http\Requests\Auth;
use Illuminate\Auth\Events\Lockout;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
class LoginRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'email' => ['required', 'string', 'email'],
'password' => ['required', 'string'],
];
}
public function messages(): array
{
return [
'email.required' => 'Email harus diisi.',
'email.string' => 'Email harus berupa teks.',
'email.email' => 'Email tidak valid.',
'password.required' => 'Password harus diisi.',
'password.string' => 'Password harus berupa teks.',
];
}
/**
* Attempt to authenticate the request's credentials.
*
* @throws \Illuminate\Validation\ValidationException
*/
public function authenticate(): void
{
$this->ensureIsNotRateLimited();
if (!Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => trans('auth.failed'),
]);
}
RateLimiter::clear($this->throttleKey());
}
/**
* Ensure the login request is not rate limited.
*
* @throws \Illuminate\Validation\ValidationException
*/
public function ensureIsNotRateLimited(): void
{
if (!RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
return;
}
event(new Lockout($this));
$seconds = RateLimiter::availableIn($this->throttleKey());
throw ValidationException::withMessages([
'email' => trans('auth.throttle', [
'seconds' => $seconds,
'minutes' => ceil($seconds / 60),
]),
]);
}
/**
* Get the rate limiting throttle key for the request.
*/
public function throttleKey(): string
{
return Str::transliterate(Str::lower($this->input('email')) . '|' . $this->ip());
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace App\Http\Requests\Employee;
use App\Models\Career;
use Illuminate\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
class CareerRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'career_code' => ['required', 'string', 'max:255'],
'career_title' => ['required', 'string', 'max:255', Rule::unique(Career::class)->ignore($this->careers)],
'departments' => ['required'],
'career_description' => ['required'],
'is_specific' => ['required'],
'image_url' => ['required', 'image', 'mimes:jpeg,png,jpg', 'max:2048']
];
}
public function messages(): array
{
return [
'career_code.required' => 'Kode karir harus diisi.',
'career_code.string' => 'Kode karir harus berupa teks.',
'career_code.max' => 'Kode karir tidak boleh lebih dari 255 karakter.',
'career_title.required' => 'Judul karir harus diisi.',
'career_title.string' => 'Judul karir harus berupa teks.',
'career_title.max' => 'Judul karir tidak boleh lebih dari 255 karakter.',
'career_title.unique' => 'Judul karir telah digunakan.',
'departments.required' => 'Jurusan harus dipilih.',
'career_description.required' => 'Deskripsi karir harus diisi.',
'is_specific.required' => 'Tipe Karier harus dipilih.',
'image_url.required' => 'Gambar harus diisi.',
'image_url.image' => 'File harus berupa gambar.',
'image_url.mimes' => 'Gambar harus berformat jpeg, png, jpg.',
'image_url.max' => 'Gambar tidak boleh lebih dari 2MB.'
];
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Http\Requests\Employee;
use Illuminate\Foundation\Http\FormRequest;
class DepartmentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'department_code' => ['required', 'string', 'max:255'],
'department_name' => ['required', 'string', 'max:255']
];
}
public function messages(): array
{
return [
'department_code.required' => 'Kode jurusan harus diisi.',
'department_code.string' => 'Kode jurusan harus berupa teks.',
'department_code.max' => 'Kode jurusan tidak boleh lebih dari 255 karakter.',
'department_name.required' => 'Nama jurusan harus diisi.',
'department_name.string' => 'Nama jurusan harus berupa teks.',
'department_name.max' => 'Nama jurusan tidak boleh lebih dari 255 karakter.',
];
}
}

View File

@ -0,0 +1,45 @@
<?php
namespace App\Http\Requests\Employee;
use App\Models\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class EmailUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)],
'confirmation_password' => ['required', 'current_password'],
];
}
public function messages(): array
{
return [
'email.required' => 'Email harus diisi.',
'email.string' => 'Email harus berupa teks.',
'email.lowercase' => 'Email harus berupa huruf kecil.',
'email.email' => 'Email harus berupa alamat email yang valid.',
'email.max' => 'Email tidak boleh lebih dari 255 karakter.',
'email.unique' => 'Email telah digunakan.',
'confirmation_password.required' => 'Password harus diisi.',
'confirmation_password.current_password' => 'Password ini tidak sesuai dengan password akun Anda.',
];
}
}

View File

@ -0,0 +1,45 @@
<?php
namespace App\Http\Requests\Employee;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;
class PasswordUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'current_password' => ['required', 'current_password'],
'password' => ['required', Password::defaults(), 'confirmed'],
'password_confirmation' => ['required'],
];
}
public function messages(): array
{
return [
'current_password.required' => 'Password lama harus diisi.',
'current_password.current_password' => 'Password lama tidak sesuai dengan password akun Anda.',
'password.required' => 'Password baru harus diisi.',
'password.confirmed' => 'Konfirmasi password baru tidak sesuai.',
'password.min' => 'Password baru minimal 8 karakter.',
'password.max' => 'Password baru maksimal 255 karakter.',
'password.regex' => 'Password baru harus mengandung huruf besar, huruf kecil, angka, dan karakter khusus.',
'password_confirmation.required' => 'Konfirmasi password baru harus diisi.',
];
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace App\Http\Requests\Employee;
use App\Models\Personality;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class PersonalityRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'personality_code' => ['required', 'string', 'max:255'],
'personality' => ['required', 'string', 'max:255', Rule::unique(Personality::class)->ignore($this->personalities)],
'careers' => ['required'],
'desc' => ['required'],
'image_url' => ['required', 'image', 'mimes:jpeg,png,jpg', 'max:2048']
];
}
public function messages(): array
{
return [
'personality_code.required' => 'Kode kepribadian harus diisi.',
'personality_code.string' => 'Kode kepribadian harus berupa teks.',
'personality_code.max' => 'Kode kepribadian tidak boleh lebih dari 255 karakter.',
'personality.required' => 'Tipe Kepribadian harus diisi.',
'personality.string' => 'Tipe Kepribadian harus berupa teks.',
'personality.max' => 'Tipe Kepribadian tidak boleh lebih dari 255 karakter.',
'personality.unique' => 'Tipe Kepribadian telah digunakan.',
'careers.required' => 'Karir harus dipilih.',
'desc.required' => 'Deskripsi kepribadian harus diisi.',
'image_url.required' => 'Gambar harus diisi.',
'image_url.image' => 'File harus berupa gambar.',
'image_url.mimes' => 'Gambar harus berformat jpeg, png, jpg.',
'image_url.max' => 'Gambar tidak boleh lebih dari 2MB.'
];
}
}

View File

@ -0,0 +1,58 @@
<?php
namespace App\Http\Requests\Employee;
use Illuminate\Foundation\Http\FormRequest;
class ProfileUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'gender' => ['nullable', 'string'],
'birth_date' => ['nullable', 'date'],
'phone' => ['nullable', 'regex:/^(\+?)(\d{1,3})?([-.\s]?)(\(\d{1,4}\))?(?:[-.\s]?(\d{1,5}))?([-.\s]?(\d{1,5}))?([-.\s]?(\d{1,5}))?$/', 'max:13'],
'address' => ['nullable', 'string'],
'picture' => ['nullable', 'image', 'mimes:jpeg,jpg,png', 'max:1024'],
// ? Employee
'nip' => ['nullable', 'string', 'max:25'],
'position' => ['nullable', 'string', 'max:50'],
];
}
public function messages()
{
return [
'name.required' => 'Nama harus diisi',
'name.string' => 'Nama harus berupa teks',
'name.max' => 'Nama maksimal 255 karakter',
'gender.string' => 'Jenis kelamin harus berupa teks',
'birth_date.date' => 'Tanggal lahir harus berupa format tanggal',
'phone.regex' => 'Nomor telepon tidak valid',
'phone.max' => 'Nomor telepon maksimal 13 karakter',
'address.string' => 'Alamat harus berupa teks',
'picture.image' => 'Foto harus berupa gambar',
'picture.mimes' => 'Foto harus berformat jpeg, jpg, atau png',
'picture.max' => 'Ukuran foto maksimal 1 MB',
'nip.string' => 'NIP harus berupa teks',
'nip.max' => 'NIP maksimal 25 karakter',
'position.string' => 'Jabatan harus berupa teks',
'position.max' => 'Jabatan maksimal 50 karakter',
];
}
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Http\Requests\Employee;
use Illuminate\Foundation\Http\FormRequest;
class RuleRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'rule_code' => ['required', 'string', 'max:255'],
'statement_id' => ['required'],
'personality_id' => ['required'],
'weight_id' => ['required'],
];
}
public function messages(): array
{
return [
'rule_code.required' => 'Kode rule harus diisi.',
'rule_code.string' => 'Kode rule harus berupa teks.',
'rule_code.max' => 'Kode rule tidak boleh lebih dari 255 karakter.',
'statement_id.required' => 'Statemen/pernyataan harus dipilih.',
'personality_id.required' => 'Tipe kepribadian harus dipilih.',
'weight_id.required' => 'Bobot harus dipilih.',
];
}
}

View File

@ -0,0 +1,44 @@
<?php
namespace App\Http\Requests\Employee;
use App\Models\Statement;
use Illuminate\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
class StatementRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'statement_code' => ['required', 'string', 'max:255'],
'statement' => ['required', 'string', 'max:255', Rule::unique(Statement::class)->ignore($this->statements)],
];
}
public function messages(): array
{
return [
'statement_code.required' => 'Kode statement harus diisi.',
'statement_code.string' => 'Kode statement harus berupa teks.',
'statement_code.max' => 'Kode statement tidak boleh lebih dari 255 karakter.',
'statement.required' => 'Statemen harus diisi.',
'statement.string' => 'Statemen harus berupa teks.',
'statement.max' => 'Statemen tidak boleh lebih dari 255 karakter.',
'statement.unique' => 'Statemen telah digunakan.',
];
}
}

View File

@ -0,0 +1,44 @@
<?php
namespace App\Http\Requests\Employee;
use App\Models\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UserEmployeeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => ['required'],
'email' => ['required', 'email', Rule::unique(User::class)->ignore($this->user()->id)],
'password' => ['required', 'min:8'],
];
}
public function messages()
{
return [
'name.required' => 'Nama harus diisi',
'email.required' => 'Email harus diisi',
'email.email' => 'Email tidak valid',
'email.unique' => 'Email sudah terdaftar',
'password.required' => 'Password harus diisi',
'password.min' => 'Password minimal 8 karakter',
];
}
}

View File

@ -0,0 +1,36 @@
<?php
namespace App\Http\Requests\Employee;
use Illuminate\Foundation\Http\FormRequest;
class WeightRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'weight' => ['required', 'max:4'],
];
}
public function messages(): array
{
return [
'weight.required' => 'Bobot harus diisi',
'weight.max' => 'Bobot maksimal 4 karakter',
];
}
}

View File

@ -0,0 +1,45 @@
<?php
namespace App\Http\Requests\Student;
use App\Models\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class EmailUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)],
'confirmation_password' => ['required', 'current_password'],
];
}
public function messages(): array
{
return [
'email.required' => 'Email harus diisi',
'email.string' => 'Email harus berupa teks',
'email.lowercase' => 'Email harus berupa huruf kecil',
'email.email' => 'Email tidak valid',
'email.max' => 'Email maksimal 255 karakter',
'email.unique' => 'Email sudah terdaftar',
'confirmation_password.required' => 'Password konfirmasi harus diisi',
'confirmation_password.current_password' => 'Password konfirmasi tidak sesuai',
];
}
}

View File

@ -0,0 +1,45 @@
<?php
namespace App\Http\Requests\Student;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;
class PasswordUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'current_password' => ['required', 'current_password'],
'password' => ['required', Password::defaults(), 'confirmed'],
'password_confirmation' => ['required'],
];
}
public function messages(): array
{
return [
'current_password.required' => 'Password saat ini harus diisi',
'current_password.current_password' => 'Password saat ini tidak sesuai',
'password.required' => 'Password baru harus diisi',
'password.confirmed' => 'Konfirmasi password baru tidak sesuai',
'password.min' => 'Password minimal 8 karakter',
'password.max' => 'Password maksimal 255 karakter',
'password.regex' => 'Password harus mengandung huruf besar, huruf kecil, angka, dan karakter khusus',
'password_confirmation.required' => 'Konfirmasi password baru harus diisi',
];
}
}

View File

@ -0,0 +1,65 @@
<?php
namespace App\Http\Requests\Student;
use App\Models\Student;
use Illuminate\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
class ProfileUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'gender' => ['nullable', 'string'],
'birth_date' => ['nullable', 'date'],
'phone' => ['nullable', 'regex:/^(\+?)(\d{1,3})?([-.\s]?)(\(\d{1,4}\))?(?:[-.\s]?(\d{1,5}))?([-.\s]?(\d{1,5}))?([-.\s]?(\d{1,5}))?$/', 'max:13'],
'address' => ['nullable', 'string'],
'picture' => ['nullable', 'image', 'mimes:jpeg,jpg,png', 'max:1024'],
// ? Student Request Validation
'nim' => ['required', 'string', 'max:15', Rule::unique(Student::class)->ignore($this->user()->student->id)],
'department_id' => ['required', 'string'],
'faculty' => ['required', 'string', 'max:100'],
];
}
public function messages(): array
{
return [
'name.required' => 'Nama harus diisi',
'name.string' => 'Nama harus berupa teks',
'name.max' => 'Nama maksimal 255 karakter',
'gender.string' => 'Jenis kelamin harus berupa teks',
'birth_date.date' => 'Tanggal lahir harus berupa format tanggal',
'phone.regex' => 'Nomor telepon tidak valid',
'phone.max' => 'Nomor telepon maksimal 13 karakter',
'address.string' => 'Alamat harus berupa teks',
'picture.image' => 'Foto harus berupa gambar',
'picture.mimes' => 'Foto harus berformat jpeg, jpg, atau png',
'picture.max' => 'Ukuran foto maksimal 1 MB',
'nim.required' => 'NIM harus diisi',
'nim.string' => 'NIM harus berupa teks',
'nim.max' => 'NIM maksimal 15 karakter',
'department_id.required' => 'Jurusan harus diisi',
'department_id.string' => 'Jurusan harus berupa teks',
'faculty.required' => 'Program Studi harus diisi',
'faculty.string' => 'Program Studi harus berupa teks',
'faculty.max' => 'Program Studi maksimal 100 karakter',
];
}
}

31
app/Models/Career.php Normal file
View File

@ -0,0 +1,31 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Career extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'career_code',
'career_title',
'slug',
'career_description',
'is_specific',
'image_url'
];
public function departments()
{
return $this->belongsToMany(Department::class);
}
public function personalities()
{
return $this->belongsToMany(Personality::class);
}
}

27
app/Models/Department.php Normal file
View File

@ -0,0 +1,27 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Department extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'department_code',
'department_name'
];
public function careers()
{
return $this->belongsToMany(Career::class);
}
public function students()
{
return $this->hasMany(Student::class);
}
}

23
app/Models/Employee.php Normal file
View File

@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Employee extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'user_id',
'nip',
'position',
];
public function user()
{
return $this->belongsTo(User::class);
}
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Personality extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'personality_code',
'personality',
'slug',
'desc',
'image_url',
];
public function rules()
{
return $this->hasMany(Rule::class);
}
public function career()
{
return $this->belongsToMany(Career::class);
}
public function results()
{
return $this->belongsToMany(Result::class);
}
}

29
app/Models/Result.php Normal file
View File

@ -0,0 +1,29 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Result extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'user_id',
// 'personality_id',
'overall_personality',
'overall_score',
];
public function user()
{
return $this->belongsTo(User::class);
}
public function personality()
{
return $this->belongsToMany(Personality::class);
}
}

34
app/Models/Rule.php Normal file
View File

@ -0,0 +1,34 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Rule extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'rule_code',
'statement_id',
'personality_id',
'weight_id',
];
public function statement()
{
return $this->belongsTo(Statement::class);
}
public function personality()
{
return $this->belongsTo(Personality::class);
}
public function weight()
{
return $this->belongsTo(Weight::class);
}
}

23
app/Models/Statement.php Normal file
View File

@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Statement extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'statement_code',
'statement',
'desc',
];
public function rules()
{
return $this->hasOne(Rule::class);
}
}

30
app/Models/Student.php Normal file
View File

@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Student extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'user_id',
'nim',
'faculty',
'department_id',
'generation',
];
public function user()
{
return $this->belongsTo(User::class);
}
public function department()
{
return $this->belongsTo(Department::class);
}
}

68
app/Models/User.php Normal file
View File

@ -0,0 +1,68 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, HasRoles, HasUuids, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'gender',
'phone',
'address',
'role',
'birth_date',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
public function employee()
{
return $this->hasOne(Employee::class);
}
public function student()
{
return $this->hasOne(Student::class);
}
public function result()
{
return $this->hasMany(Result::class);
}
}

21
app/Models/Weight.php Normal file
View File

@ -0,0 +1,21 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Weight extends Model
{
use HasFactory, HasUuids;
protected $fillable = [
'weight',
];
public function rules()
{
return $this->hasMany(Rule::class);
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Providers;
// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
//
];
/**
* Register any authentication / authorization services.
*/
public function boot(): void
{
//
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View File

@ -0,0 +1,38 @@
<?php
namespace App\Providers;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
/**
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*/
public function boot(): void
{
//
}
/**
* Determine if events and listeners should be automatically discovered.
*/
public function shouldDiscoverEvents(): bool
{
return false;
}
}

View File

@ -0,0 +1,40 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to your application's "home" route.
*
* Typically, users are redirected here after authentication.
*
* @var string
*/
public const HOME = '/dashboard';
/**
* Define your route model bindings, pattern filters, and other route configuration.
*/
public function boot(): void
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
$this->routes(function () {
Route::middleware('api')
->prefix('api')
->group(base_path('routes/api.php'));
Route::middleware('web')
->group(base_path('routes/web.php'));
});
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\View\Components;
use Illuminate\View\Component;
use Illuminate\View\View;
class AppLayout extends Component
{
/**
* Get the view / contents that represents the component.
*/
public function render(): View
{
return view('layouts.app');
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\View\Components;
use Illuminate\View\Component;
use Illuminate\View\View;
class GuestLayout extends Component
{
/**
* Get the view / contents that represents the component.
*/
public function render(): View
{
return view('layouts.guest');
}
}

53
artisan Normal file
View File

@ -0,0 +1,53 @@
#!/usr/bin/env php
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any of our classes manually. It's great to relax.
|
*/
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);

55
bootstrap/app.php Normal file
View File

@ -0,0 +1,55 @@
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;

2
bootstrap/cache/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

70
composer.json Normal file
View File

@ -0,0 +1,70 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.1",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"opcodesio/log-viewer": "^3.1",
"spatie/laravel-permission": "^6.3"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.9",
"fakerphp/faker": "^1.9.1",
"laravel/breeze": "^1.27",
"laravel/pint": "^1.13",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1",
"spatie/laravel-ignition": "^2.0"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}

8599
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

189
config/app.php Normal file
View File

@ -0,0 +1,189 @@
<?php
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/
'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
],
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => ServiceProvider::defaultProviders()->merge([
/*
* Package Service Providers...
*/
Spatie\Permission\PermissionServiceProvider::class,
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
])->toArray(),
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => Facade::defaultAliases()->merge([
// 'Example' => App\Facades\Example::class,
])->toArray(),
];

115
config/auth.php Normal file
View File

@ -0,0 +1,115 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_reset_tokens',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
];

71
config/broadcasting.php Normal file
View File

@ -0,0 +1,71 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "ably", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];

111
config/cache.php Normal file
View File

@ -0,0 +1,111 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "octane", "null"
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'lock_connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
'lock_connection' => 'default',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'octane' => [
'driver' => 'octane',
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing the APC, database, memcached, Redis, or DynamoDB cache
| stores there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
];

Some files were not shown because too many files have changed in this diff Show More