├── public ├── favicon.ico ├── robots.txt ├── mix-manifest.json ├── .htaccess ├── web.config └── index.php ├── bootstrap ├── cache │ └── .gitignore └── app.php ├── resources ├── js │ ├── app.js │ └── bootstrap.js ├── css │ └── app.css ├── views │ ├── vendor │ │ └── jetstream │ │ │ └── components │ │ │ ├── input-error.blade.php │ │ │ ├── section-border.blade.php │ │ │ ├── input.blade.php │ │ │ ├── label.blade.php │ │ │ ├── dropdown-link.blade.php │ │ │ ├── section-title.blade.php │ │ │ ├── authentication-card.blade.php │ │ │ ├── danger-button.blade.php │ │ │ ├── button.blade.php │ │ │ ├── validation-errors.blade.php │ │ │ ├── secondary-button.blade.php │ │ │ ├── action-message.blade.php │ │ │ ├── application-mark.blade.php │ │ │ ├── action-section.blade.php │ │ │ ├── dialog-modal.blade.php │ │ │ ├── authentication-card-logo.blade.php │ │ │ ├── nav-link.blade.php │ │ │ ├── responsive-nav-link.blade.php │ │ │ ├── switchable-team.blade.php │ │ │ ├── form-section.blade.php │ │ │ ├── welcome.blade.php │ │ │ ├── confirmation-modal.blade.php │ │ │ ├── dropdown.blade.php │ │ │ ├── confirms-password.blade.php │ │ │ ├── modal.blade.php │ │ │ └── application-logo.blade.php │ ├── api │ │ └── index.blade.php │ ├── dashboard.blade.php │ ├── layouts │ │ ├── guest.blade.php │ │ └── app.blade.php │ ├── auth │ │ ├── forgot-password.blade.php │ │ ├── reset-password.blade.php │ │ ├── verify-email.blade.php │ │ ├── register.blade.php │ │ ├── login.blade.php │ │ └── two-factor-challenge.blade.php │ ├── profile │ │ ├── show.blade.php │ │ ├── update-password-form.blade.php │ │ ├── delete-user-form.blade.php │ │ ├── update-profile-information-form.blade.php │ │ └── two-factor-authentication-form.blade.php │ ├── users │ │ └── index.blade.php │ ├── transactions │ │ └── index.blade.php │ ├── food │ │ └── index.blade.php │ └── midtrans │ │ ├── error.blade.php │ │ └── unfinish.blade.php └── lang │ └── en │ ├── pagination.php │ ├── auth.php │ └── passwords.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── testing │ └── .gitignore │ ├── views │ └── .gitignore │ ├── cache │ ├── data │ │ └── .gitignore │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── database ├── .gitignore ├── seeders │ └── DatabaseSeeder.php ├── migrations │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2020_09_17_064803_add_roles_to_users_table.php │ ├── 2020_09_22_105946_change_picture_field.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2020_09_17_054644_create_sessions_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2020_09_17_052431_create_transactions_table.php │ ├── 2014_10_12_200000_add_two_factor_columns_to_users_table.php │ ├── 2020_09_17_052150_create_food_table.php │ └── 2014_10_12_000000_create_users_table.php └── factories │ └── UserFactory.php ├── .idea ├── sonarlint │ └── issuestore │ │ ├── 3 │ │ ├── 3 │ │ │ └── 33cdd3b8c61fc209aab9e9b947a657801b4cfbb3 │ │ └── c │ │ │ └── 3c84dcdc6bbe3d7817c49dcdc327b926fea1808a │ │ ├── 6 │ │ └── 7 │ │ │ └── 67cde7ebf0c82e44eedc43a9b83d4fa13c684078 │ │ ├── b │ │ └── 3 │ │ │ └── b337d07ab0e7d54bf5547a0321a43ecafbd73ec1 │ │ ├── f │ │ └── 3 │ │ │ └── f3cae797cbcb5410c34784294fca1a1cc4d472a8 │ │ └── index.pb ├── codeStyles │ └── codeStyleConfig.xml ├── vcs.xml ├── symfony2.xml ├── laravel-plugin.xml ├── modules.xml └── phpunit.xml ├── .gitattributes ├── tests ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── Feature │ └── ExampleTest.php └── CreatesApplication.php ├── .styleci.yml ├── .gitignore ├── .editorconfig ├── app ├── Http │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── TrustProxies.php │ │ ├── Authenticate.php │ │ ├── IsAdmin.php │ │ └── RedirectIfAuthenticated.php │ ├── Controllers │ │ ├── DashboardController.php │ │ ├── Controller.php │ │ ├── API │ │ │ ├── FoodController.php │ │ │ ├── TransactionController.php │ │ │ └── MidtransController.php │ │ ├── TransactionController.php │ │ ├── FoodController.php │ │ └── UserController.php │ ├── Requests │ │ ├── FoodRequest.php │ │ └── UserRequest.php │ └── Kernel.php ├── View │ └── Components │ │ ├── AppLayout.php │ │ └── GuestLayout.php ├── Actions │ ├── Jetstream │ │ └── DeleteUser.php │ └── Fortify │ │ ├── PasswordValidationRules.php │ │ ├── ResetUserPassword.php │ │ ├── CreateNewUser.php │ │ ├── UpdateUserProfileInformation.php │ │ └── UpdateUserPassword.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ ├── FortifyServiceProvider.php │ ├── JetstreamServiceProvider.php │ └── RouteServiceProvider.php ├── Exceptions │ └── Handler.php ├── Console │ └── Kernel.php ├── Models │ ├── Transaction.php │ ├── Food.php │ └── User.php └── Helpers │ └── ResponseFormatter.php ├── tailwind.config.js ├── routes ├── channels.php ├── console.php ├── api.php └── web.php ├── server.php ├── webpack.mix.js ├── config ├── cors.php ├── view.php ├── jetstream.php ├── services.php ├── hashing.php ├── sanctum.php ├── broadcasting.php ├── filesystems.php ├── queue.php ├── logging.php ├── fortify.php ├── cache.php ├── mail.php ├── auth.php └── datatables.php ├── .env.example ├── package.json ├── phpunit.xml ├── artisan ├── composer.json └── README.md /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | require('./bootstrap'); 2 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /.idea/sonarlint/issuestore/3/3/33cdd3b8c61fc209aab9e9b947a657801b4cfbb3: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/sonarlint/issuestore/3/c/3c84dcdc6bbe3d7817c49dcdc327b926fea1808a: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/sonarlint/issuestore/6/7/67cde7ebf0c82e44eedc43a9b83d4fa13c684078: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/sonarlint/issuestore/b/3/b337d07ab0e7d54bf5547a0321a43ecafbd73ec1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js", 3 | "/css/app.css": "/css/app.css" 4 | } 5 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss/base'; 2 | @import 'tailwindcss/components'; 3 | @import 'tailwindcss/utilities'; 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/sonarlint/issuestore/f/3/f3cae797cbcb5410c34784294fca1a1cc4d472a8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/belajarkoding/foodmarket-backend/HEAD/.idea/sonarlint/issuestore/f/3/f3cae797cbcb5410c34784294fca1a1cc4d472a8 -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/input-error.blade.php: -------------------------------------------------------------------------------- 1 | @props(['for']) 2 | 3 | @error($for) 4 |

merge(['class' => 'text-sm text-red-600']) }}>{{ $message }}

5 | @enderror 6 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/section-border.blade.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /.idea/symfony2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/laravel-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/input.blade.php: -------------------------------------------------------------------------------- 1 | @props(['disabled' => false]) 2 | 3 | merge(['class' => 'form-input rounded-md shadow-sm']) !!}> 4 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/label.blade.php: -------------------------------------------------------------------------------- 1 | @props(['value']) 2 | 3 | 6 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | merge(['class' => 'block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out']) }}>{{ $slot }} 2 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/section-title.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

{{ $title }}

4 | 5 |

6 | {{ $description }} 7 |

8 |
9 |
10 | -------------------------------------------------------------------------------- /.idea/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /tests/Unit/ExampleTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/authentication-card.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ $logo }} 4 |
5 | 6 |
7 | {{ $slot }} 8 |
9 |
10 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | delete(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/View/Components/GuestLayout.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('API Tokens') }} 5 |

6 |
7 | 8 |
9 |
10 | @livewire('api.api-token-manager') 11 |
12 |
13 | 14 | -------------------------------------------------------------------------------- /app/Http/Controllers/DashboardController.php: -------------------------------------------------------------------------------- 1 | merge(['type' => 'button', 'class' => 'inline-flex items-center justify-center px-4 py-2 bg-red-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-500 focus:outline-none focus:border-red-700 focus:shadow-outline-red active:bg-red-600 transition ease-in-out duration-150']) }}> 2 | {{ $slot }} 3 | 4 | -------------------------------------------------------------------------------- /app/Actions/Fortify/PasswordValidationRules.php: -------------------------------------------------------------------------------- 1 | merge(['type' => 'submit', 'class' => 'inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150']) }}> 2 | {{ $slot }} 3 | 4 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/validation-errors.blade.php: -------------------------------------------------------------------------------- 1 | @if ($errors->any()) 2 |
3 |
Whoops! Something went wrong.
4 | 5 | 10 |
11 | @endif 12 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/secondary-button.blade.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | { clearTimeout(timeout); shown = true; timeout = setTimeout(() => { shown = false }, 2000); })" 5 | x-show.transition.opacity.out.duration.1500ms="shown" 6 | style="display: none;" 7 | {{ $attributes->merge(['class' => 'text-sm text-gray-600']) }}> 8 | {{ $slot ?? 'Saved.' }} 9 | 10 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/application-mark.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Dashboard') }} 5 |

6 |
7 | 8 |
9 |
10 |
11 | 12 |
13 |
14 |
15 | 16 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/action-section.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | {{ $title }} 4 | {{ $description }} 5 | 6 | 7 |
8 |
9 | {{ $content }} 10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/dialog-modal.blade.php: -------------------------------------------------------------------------------- 1 | @props(['id' => null, 'maxWidth' => null]) 2 | 3 | 4 |
5 |
6 | {{ $title }} 7 |
8 | 9 |
10 | {{ $content }} 11 |
12 |
13 | 14 |
15 | {{ $footer }} 16 |
17 |
18 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/authentication-card-logo.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | const defaultTheme = require('tailwindcss/defaultTheme'); 2 | 3 | module.exports = { 4 | purge: ['./storage/framework/views/*.php', './resources/views/**/*.blade.php'], 5 | 6 | theme: { 7 | extend: { 8 | fontFamily: { 9 | sans: ['Nunito', ...defaultTheme.fontFamily.sans], 10 | }, 11 | }, 12 | }, 13 | 14 | variants: { 15 | opacity: ['responsive', 'hover', 'focus', 'disabled'], 16 | }, 17 | 18 | plugins: [require('@tailwindcss/ui')], 19 | }; 20 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /app/Http/Middleware/IsAdmin.php: -------------------------------------------------------------------------------- 1 | roles == 'ADMIN') 21 | { 22 | return $next($request); 23 | } 24 | 25 | return redirect('/'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/nav-link.blade.php: -------------------------------------------------------------------------------- 1 | @props(['active']) 2 | 3 | @php 4 | $classes = ($active ?? false) 5 | ? 'inline-flex items-center px-1 pt-1 border-b-2 border-indigo-400 text-sm font-medium leading-5 text-gray-900 focus:outline-none focus:border-indigo-700 transition duration-150 ease-in-out' 6 | : 'inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out'; 7 | @endphp 8 | 9 | merge(['class' => $classes]) }}> 10 | {{ $slot }} 11 | 12 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel applications. By default, we are compiling the CSS 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/js/app.js', 'public/js') 15 | .postCss('resources/css/app.css', 'public/css', [ 16 | require('postcss-import'), 17 | require('tailwindcss'), 18 | ]); 19 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/responsive-nav-link.blade.php: -------------------------------------------------------------------------------- 1 | @props(['active']) 2 | 3 | @php 4 | $classes = ($active ?? false) 5 | ? 'block pl-3 pr-4 py-2 border-l-4 border-indigo-400 text-base font-medium text-indigo-700 bg-indigo-50 focus:outline-none focus:text-indigo-800 focus:bg-indigo-100 focus:border-indigo-700 transition duration-150 ease-in-out' 6 | : 'block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:text-gray-800 focus:bg-gray-50 focus:border-gray-300 transition duration-150 ease-in-out'; 7 | @endphp 8 | 9 | merge(['class' => $classes]) }}> 10 | {{ $slot }} 11 | 12 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have emailed your password reset link!', 18 | 'throttled' => 'Please wait before retrying.', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 25 | return redirect(RouteServiceProvider::HOME); 26 | } 27 | } 28 | 29 | return $next($request); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Actions/Fortify/ResetUserPassword.php: -------------------------------------------------------------------------------- 1 | $this->passwordRules(), 24 | ])->validateWithBag('updatePassword'); 25 | 26 | $user->forceFill([ 27 | 'password' => Hash::make($input['password']), 28 | ])->save(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2020_09_17_064803_add_roles_to_users_table.php: -------------------------------------------------------------------------------- 1 | string('roles') 18 | ->after('password') 19 | ->default('USER'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::table('users', function (Blueprint $table) { 31 | $table->dropColumn('roles'); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->name, 27 | 'email' => $this->faker->unique()->safeEmail, 28 | 'email_verified_at' => now(), 29 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 30 | 'remember_token' => Str::random(10), 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /resources/views/layouts/guest.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config('app.name', 'Laravel') }} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | {{ $slot }} 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /app/Http/Requests/FoodRequest.php: -------------------------------------------------------------------------------- 1 | 'required|max:255', 28 | 'picturePath' => 'required|image', 29 | 'description' => 'required', 30 | 'ingredients' => 'required', 31 | 'price' => 'required|integer', 32 | 'rate' => 'required|integer', 33 | 'types' => '', 34 | ]; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/switchable-team.blade.php: -------------------------------------------------------------------------------- 1 | @props(['team', 'component' => 'jet-dropdown-link']) 2 | 3 |
4 | @method('PUT') 5 | @csrf 6 | 7 | 8 | 9 | 10 | 11 |
12 | @if (Auth::user()->isCurrentTeam($team)) 13 | 14 | @endif 15 | 16 |
{{ $team->name }}
17 |
18 |
19 |
20 | -------------------------------------------------------------------------------- /database/migrations/2020_09_22_105946_change_picture_field.php: -------------------------------------------------------------------------------- 1 | dropColumn('picturePath'); 18 | $table->text('profile_photo_path')->nullable(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::table('users', function (Blueprint $table) { 30 | $table->dropColumn('profile_photo_path'); 31 | $table->text('picturePath')->nullable(); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=127.0.0.1 11 | DB_PORT=3306 12 | DB_DATABASE=laravel 13 | DB_USERNAME=root 14 | DB_PASSWORD= 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | QUEUE_CONNECTION=sync 19 | SESSION_DRIVER=database 20 | SESSION_LIFETIME=120 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_MAILER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | MAIL_FROM_ADDRESS=null 33 | MAIL_FROM_NAME="${APP_NAME}" 34 | 35 | AWS_ACCESS_KEY_ID= 36 | AWS_SECRET_ACCESS_KEY= 37 | AWS_DEFAULT_REGION=us-east-1 38 | AWS_BUCKET= 39 | 40 | PUSHER_APP_ID= 41 | PUSHER_APP_KEY= 42 | PUSHER_APP_SECRET= 43 | PUSHER_APP_CLUSTER=mt1 44 | 45 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 46 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 47 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load the axios HTTP library which allows us to easily issue requests 5 | * to our Laravel back-end. This library automatically handles sending the 6 | * CSRF token as a header based on the value of the "XSRF" token cookie. 7 | */ 8 | 9 | window.axios = require('axios'); 10 | 11 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 12 | 13 | /** 14 | * Echo exposes an expressive API for subscribing to channels and listening 15 | * for events that are broadcast by Laravel. Echo and event broadcasting 16 | * allows your team to easily build robust real-time web applications. 17 | */ 18 | 19 | // import Echo from 'laravel-echo'; 20 | 21 | // window.Pusher = require('pusher-js'); 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: process.env.MIX_PUSHER_APP_KEY, 26 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 27 | // forceTLS: true 28 | // }); 29 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 28 | } 29 | 30 | /** 31 | * Register the commands for the application. 32 | * 33 | * @return void 34 | */ 35 | protected function commands() 36 | { 37 | $this->load(__DIR__.'/Commands'); 38 | 39 | require base_path('routes/console.php'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2020_09_17_054644_create_sessions_table.php: -------------------------------------------------------------------------------- 1 | string('id')->primary(); 18 | $table->foreignId('user_id')->nullable()->index(); 19 | $table->string('ip_address', 45)->nullable(); 20 | $table->text('user_agent')->nullable(); 21 | $table->text('payload'); 22 | $table->integer('last_activity')->index(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('sessions'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Actions/Fortify/CreateNewUser.php: -------------------------------------------------------------------------------- 1 | ['required', 'string', 'max:255'], 24 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 25 | 'password' => $this->passwordRules(), 26 | ])->validate(); 27 | 28 | return User::create([ 29 | 'name' => $input['name'], 30 | 'email' => $input['email'], 31 | 'password' => Hash::make($input['password']), 32 | ]); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/form-section.blade.php: -------------------------------------------------------------------------------- 1 | @props(['submit']) 2 | 3 |
merge(['class' => 'md:grid md:grid-cols-3 md:gap-6']) }}> 4 | 5 | {{ $title }} 6 | {{ $description }} 7 | 8 | 9 |
10 |
11 |
12 |
13 |
14 | {{ $form }} 15 |
16 |
17 | 18 | @if (isset($actions)) 19 |
20 | {{ $actions }} 21 |
22 | @endif 23 |
24 |
25 |
26 |
27 | -------------------------------------------------------------------------------- /app/Providers/FortifyServiceProvider.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->morphs('tokenable'); 19 | $table->string('name'); 20 | $table->string('token', 64)->unique(); 21 | $table->text('abilities')->nullable(); 22 | $table->timestamp('last_used_at')->nullable(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('personal_access_tokens'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2020_09_17_052431_create_transactions_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | 19 | $table->integer('food_id'); 20 | $table->integer('user_id'); 21 | $table->integer('quantity'); 22 | $table->integer('total'); 23 | $table->string('status'); 24 | $table->text('payment_url'); 25 | 26 | $table->softDeletes(); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('transactions'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Models/Transaction.php: -------------------------------------------------------------------------------- 1 | hasOne(Food::class,'id','food_id'); 30 | } 31 | 32 | public function user() 33 | { 34 | return $this->hasOne(User::class,'id','user_id'); 35 | } 36 | 37 | public function getCreatedAtAttribute($created_at) 38 | { 39 | return Carbon::parse($created_at) 40 | ->getPreciseTimestamp(3); 41 | } 42 | public function getUpdatedAtAttribute($updated_at) 43 | { 44 | return Carbon::parse($updated_at) 45 | ->getPreciseTimestamp(3); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php: -------------------------------------------------------------------------------- 1 | text('two_factor_secret') 18 | ->after('password') 19 | ->nullable(); 20 | 21 | $table->text('two_factor_recovery_codes') 22 | ->after('two_factor_secret') 23 | ->nullable(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::table('users', function (Blueprint $table) { 35 | $table->dropColumn('two_factor_secret'); 36 | $table->dropColumn('two_factor_recovery_codes'); 37 | }); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Providers/JetstreamServiceProvider.php: -------------------------------------------------------------------------------- 1 | configurePermissions(); 29 | 30 | Jetstream::deleteUsersUsing(DeleteUser::class); 31 | } 32 | 33 | /** 34 | * Configure the permissions that are available within the application. 35 | * 36 | * @return void 37 | */ 38 | protected function configurePermissions() 39 | { 40 | Jetstream::defaultApiTokenPermissions(['read']); 41 | 42 | Jetstream::permissions([ 43 | 'create', 44 | 'read', 45 | 'update', 46 | 'delete', 47 | ]); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /database/migrations/2020_09_17_052150_create_food_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | 19 | $table->text('picturePath')->nullable(); 20 | $table->string('name')->nullable(); 21 | $table->text('description')->nullable(); 22 | $table->text('ingredients')->nullable(); 23 | $table->integer('price')->nullable(); 24 | $table->double('rate')->nullable(); 25 | $table->string('types')->default(''); 26 | 27 | $table->softDeletes(); 28 | $table->timestamps(); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | * 35 | * @return void 36 | */ 37 | public function down() 38 | { 39 | Schema::dropIfExists('food'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Models/Food.php: -------------------------------------------------------------------------------- 1 | picturePath; 23 | return $toArray; 24 | } 25 | 26 | public function getCreatedAtAttribute($created_at) 27 | { 28 | return Carbon::parse($created_at) 29 | ->getPreciseTimestamp(3); 30 | } 31 | public function getUpdatedAtAttribute($updated_at) 32 | { 33 | return Carbon::parse($updated_at) 34 | ->getPreciseTimestamp(3); 35 | } 36 | public function getPicturePathAttribute() 37 | { 38 | return config('app.url') . Storage::url($this->attributes['picturePath']); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Actions/Fortify/UpdateUserProfileInformation.php: -------------------------------------------------------------------------------- 1 | ['required', 'string', 'max:255'], 22 | 'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)], 23 | 'photo' => ['nullable', 'image', 'max:1024'], 24 | ])->validateWithBag('updateProfileInformation'); 25 | 26 | if (isset($input['photo'])) { 27 | $user->updateProfilePhoto($input['photo']); 28 | } 29 | 30 | $user->forceFill([ 31 | 'name' => $input['name'], 32 | 'email' => $input['email'], 33 | ])->save(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "npm run development -- --watch", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "@tailwindcss/ui": "^0.5.0", 14 | "axios": "^0.19", 15 | "cross-env": "^7.0", 16 | "laravel-mix": "^5.0.1", 17 | "lodash": "^4.17.19", 18 | "postcss-import": "^12.0.1", 19 | "resolve-url-loader": "^3.1.0", 20 | "tailwindcss": "^1.3.0", 21 | "vue-template-compiler": "^2.6.12" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /config/jetstream.php: -------------------------------------------------------------------------------- 1 | 'livewire', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Features 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Some of Jetstream's features are optional. You may disable the features 26 | | by removing them from this array. You're free to only remove some of 27 | | these features or you can even remove all of these if you need to. 28 | | 29 | */ 30 | 31 | 'features' => [ 32 | Features::profilePhotos(), 33 | Features::api(), 34 | // Features::teams(), 35 | ], 36 | 37 | ]; 38 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/welcome.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | 8 |
9 |
10 | 11 |
12 |
13 | 14 |
15 |
16 | 17 |
18 |
19 | 20 |
21 |
22 | 23 |
24 |
25 |
26 | -------------------------------------------------------------------------------- /app/Actions/Fortify/UpdateUserPassword.php: -------------------------------------------------------------------------------- 1 | ['required', 'string'], 24 | 'password' => $this->passwordRules(), 25 | ])->after(function ($validator) use ($user, $input) { 26 | if (! Hash::check($input['current_password'], $user->password)) { 27 | $validator->errors()->add('current_password', __('The provided password does not match your current password.')); 28 | } 29 | })->validateWithBag('updatePassword'); 30 | 31 | $user->forceFill([ 32 | 'password' => Hash::make($input['password']), 33 | ])->save(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/Requests/UserRequest.php: -------------------------------------------------------------------------------- 1 | ['required', 'string', 'max:255'], 32 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 33 | 'password' => $this->passwordRules(), 34 | 'address' => ['required', 'string'], 35 | 'roles' => ['required', 'string', 'max:255', 'in:USER,ADMIN'], 36 | 'houseNumber' => ['required', 'string', 'max:255'], 37 | 'phoneNumber' => ['required', 'string', 'max:255'], 38 | 'city' => ['required', 'string', 'max:255'], 39 | ]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Helpers/ResponseFormatter.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'code' => 200, 18 | 'status' => 'success', 19 | 'message' => null, 20 | ], 21 | 'data' => null, 22 | ]; 23 | 24 | /** 25 | * Give success response. 26 | */ 27 | public static function success($data = null, $message = null) 28 | { 29 | self::$response['meta']['message'] = $message; 30 | self::$response['data'] = $data; 31 | 32 | return response()->json(self::$response, self::$response['meta']['code']); 33 | } 34 | 35 | /** 36 | * Give error response. 37 | */ 38 | public static function error($data = null, $message = null, $code = 400) 39 | { 40 | self::$response['meta']['status'] = 'error'; 41 | self::$response['meta']['code'] = $code; 42 | self::$response['meta']['message'] = $message; 43 | self::$response['data'] = $data; 44 | 45 | return response()->json(self::$response, self::$response['meta']['code']); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/confirmation-modal.blade.php: -------------------------------------------------------------------------------- 1 | @props(['id' => null, 'maxWidth' => null]) 2 | 3 | 4 |
5 |
6 |
7 | 8 | 9 | 10 |
11 | 12 |
13 |

14 | {{ $title }} 15 |

16 | 17 |
18 | {{ $content }} 19 |
20 |
21 |
22 |
23 | 24 |
25 | {{ $footer }} 26 |
27 |
28 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | 24 | $table->string('current_team_id')->nullable(); 25 | $table->text('picturePath')->nullable(); 26 | 27 | $table->text('address')->nullable(); 28 | $table->string('houseNumber')->nullable(); 29 | $table->string('phoneNumber')->nullable(); 30 | $table->string('city')->nullable(); 31 | 32 | $table->timestamps(); 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | Schema::dropIfExists('users'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /resources/views/auth/forgot-password.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | {{ __('Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.') }} 9 |
10 | 11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 | 18 | 19 |
20 | @csrf 21 | 22 |
23 | 24 | 25 |
26 | 27 |
28 | 29 | {{ __('Email Password Reset Link') }} 30 | 31 |
32 |
33 |
34 |
35 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | 'midtrans' => [ 34 | 'serverKey' => env('MIDTRANS_SERVER_KEY'), 35 | 'clientKey' => env('MIDTRANS_CLIENT_KEY'), 36 | 'isProduction' => env('MIDTRANS_IS_PRODUCTION', false), 37 | 'isSanitized' => env('MIDTRANS_IS_SANITIZED', true), 38 | 'is3ds' => env('MIDTRANS_IS_3DS', true), 39 | ], 40 | 41 | ]; 42 | -------------------------------------------------------------------------------- /resources/views/profile/show.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Profile') }} 5 |

6 |
7 | 8 |
9 |
10 | @livewire('profile.update-profile-information-form') 11 | 12 | @if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::updatePasswords())) 13 | 14 | 15 |
16 | @livewire('profile.update-password-form') 17 |
18 | @endif 19 | 20 | @if (Laravel\Fortify\Features::canManageTwoFactorAuthentication()) 21 | 22 | 23 |
24 | @livewire('profile.two-factor-authentication-form') 25 |
26 | @endif 27 | 28 | 29 | 30 |
31 | @livewire('profile.logout-other-browser-sessions-form') 32 |
33 | 34 | 35 | 36 |
37 | @livewire('profile.delete-user-form') 38 |
39 |
40 |
41 |
42 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config('app.name', 'Laravel') }} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | @livewireStyles 17 | 18 | 19 | 20 | 21 | 22 |
23 | @livewire('navigation-dropdown') 24 | 25 | 26 |
27 |
28 | {{ $header ?? '' }} 29 |
30 |
31 | 32 | 33 |
34 | {{ $slot }} 35 |
36 |
37 | 38 | @stack('modals') 39 | 40 | @livewireScripts 41 | 42 | {{ $footer ?? '' }} 43 | 44 | 45 | -------------------------------------------------------------------------------- /resources/views/auth/reset-password.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | @csrf 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 |
23 | 24 |
25 | 26 | 27 |
28 | 29 |
30 | 31 | {{ __('Reset Password') }} 32 | 33 |
34 |
35 |
36 |
37 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/dropdown.blade.php: -------------------------------------------------------------------------------- 1 | @props(['align' => 'right', 'width' => '48', 'contentClasses' => 'py-1 bg-white']) 2 | 3 | @php 4 | switch ($align) { 5 | case 'left': 6 | $alignmentClasses = 'origin-top-left left-0'; 7 | break; 8 | case 'top': 9 | $alignmentClasses = 'origin-top'; 10 | break; 11 | case 'right': 12 | default: 13 | $alignmentClasses = 'origin-top-right right-0'; 14 | break; 15 | } 16 | 17 | switch ($width) { 18 | case '48': 19 | $width = 'w-48'; 20 | break; 21 | } 22 | @endphp 23 | 24 |
25 |
26 | {{ $trigger }} 27 |
28 | 29 | 43 |
44 | -------------------------------------------------------------------------------- /resources/views/auth/verify-email.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | {{ __('Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn\'t receive the email, we will gladly send you another.') }} 9 |
10 | 11 | @if (session('status') == 'verification-link-sent') 12 |
13 | {{ __('A new verification link has been sent to the email address you provided during registration.') }} 14 |
15 | @endif 16 | 17 |
18 |
19 | @csrf 20 | 21 |
22 | 23 | {{ __('Resend Verification Email') }} 24 | 25 |
26 |
27 | 28 |
29 | @csrf 30 | 31 | 34 |
35 |
36 |
37 |
38 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | group(function () { 23 | Route::get('user', [UserController::class, 'fetch']); 24 | Route::post('user', [UserController::class, 'updateProfile']); 25 | Route::post('user/photo', [UserController::class, 'updatePhoto']); 26 | Route::get('transaction', [TransactionController::class, 'all']); 27 | Route::post('transaction/{id}', [TransactionController::class, 'update']); 28 | Route::post('checkout', [TransactionController::class, 'checkout']); 29 | Route::post('logout', [UserController::class, 'logout']); 30 | }); 31 | 32 | Route::post('login', [UserController::class, 'login']); 33 | Route::post('register', [UserController::class, 'register']); 34 | 35 | Route::get('food', [FoodController::class, 'all']); 36 | Route::post('midtrans/callback', [MidtransController::class, 'callback']); 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | route('admin-dashboard'); 24 | }); 25 | 26 | // Dashboard 27 | Route::prefix('dashboard') 28 | ->middleware(['auth:sanctum','admin']) 29 | ->group(function() { 30 | Route::get('/', [DashboardController::class, 'index']) 31 | ->name('admin-dashboard'); 32 | Route::resource('food', FoodController::class); 33 | Route::resource('users', UserController::class); 34 | 35 | Route::get('transactions/{id}/status/{status}', [TransactionController::class, 'changeStatus']) 36 | ->name('transactions.changeStatus'); 37 | Route::resource('transactions', TransactionController::class); 38 | }); 39 | 40 | // Midtrans Related 41 | Route::get('midtrans/success', [MidtransController::class, 'success']); 42 | Route::get('midtrans/unfinish', [MidtransController::class, 'unfinish']); 43 | Route::get('midtrans/error', [MidtransController::class, 'error']); 44 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 39 | 40 | $this->routes(function () { 41 | Route::middleware('web') 42 | ->group(base_path('routes/web.php')); 43 | 44 | Route::prefix('api') 45 | ->middleware('api') 46 | ->group(base_path('routes/api.php')); 47 | }); 48 | } 49 | 50 | /** 51 | * Configure the rate limiters for the application. 52 | * 53 | * @return void 54 | */ 55 | protected function configureRateLimiting() 56 | { 57 | RateLimiter::for('api', function (Request $request) { 58 | return Limit::perMinute(60); 59 | }); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', 'localhost,127.0.0.1,127.0.0.1:8000,::1')), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Expiration Minutes 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value controls the number of minutes until an issued token will be 24 | | considered expired. If this value is null, personal access tokens do 25 | | not expire. This won't tweak the lifetime of first-party sessions. 26 | | 27 | */ 28 | 29 | 'expiration' => null, 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Sanctum Middleware 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When authenticating your first-party SPA with Sanctum you may need to 37 | | customize some of the middleware Sanctum uses while processing the 38 | | request. You may change the middleware listed below as required. 39 | | 40 | */ 41 | 42 | 'middleware' => [ 43 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 44 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 45 | ], 46 | 47 | ]; 48 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/confirms-password.blade.php: -------------------------------------------------------------------------------- 1 | @props(['title' => __('Confirm Password'), 'content' => __('For your security, please confirm your password to continue.'), 'button' => __('Confirm')]) 2 | 3 | @php 4 | $confirmableId = md5($attributes->wire('then')); 5 | @endphp 6 | 7 | wire('then') }} 9 | x-data 10 | x-ref="span" 11 | x-on:click="$wire.startConfirmingPassword('{{ $confirmableId }}')" 12 | x-on:password-confirmed.window="setTimeout(() => $event.detail.id === '{{ $confirmableId }}' && $refs.span.dispatchEvent(new CustomEvent('then', { bubbles: false })), 250);" 13 | > 14 | {{ $slot }} 15 | 16 | 17 | @once 18 | 19 | 20 | {{ $title }} 21 | 22 | 23 | 24 | {{ $content }} 25 | 26 |
27 | 31 | 32 | 33 |
34 |
35 | 36 | 37 | 38 | Nevermind 39 | 40 | 41 | 42 | {{ $button }} 43 | 44 | 45 |
46 | @endonce 47 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | @csrf 11 | 12 |
13 | 14 | 15 |
16 | 17 |
18 | 19 | 20 |
21 | 22 |
23 | 24 | 25 |
26 | 27 |
28 | 29 | 30 |
31 | 32 |
33 | 34 | {{ __('Already registered?') }} 35 | 36 | 37 | 38 | {{ __('Register') }} 39 | 40 |
41 |
42 |
43 |
44 | -------------------------------------------------------------------------------- /resources/views/profile/update-password-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Update Password') }} 4 | 5 | 6 | 7 | {{ __('Ensure your account is using a long, random password to stay secure.') }} 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 |
18 | 19 | 20 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 |
29 | 30 | 31 | 32 | {{ __('Saved.') }} 33 | 34 | 35 | 36 | {{ __('Save') }} 37 | 38 | 39 |
40 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = tap($kernel->handle( 52 | $request = Request::capture() 53 | ))->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | @if (session('status')) 10 |
11 | {{ session('status') }} 12 |
13 | @endif 14 | 15 |
16 | @csrf 17 | 18 |
19 | 20 | 21 |
22 | 23 |
24 | 25 | 26 |
27 | 28 |
29 | 33 |
34 | 35 |
36 | @if (Route::has('password.request')) 37 | 38 | {{ __('Forgot your password?') }} 39 | 40 | @endif 41 | 42 | 43 | {{ __('Login') }} 44 | 45 |
46 |
47 |
48 |
49 | -------------------------------------------------------------------------------- /app/Http/Controllers/API/FoodController.php: -------------------------------------------------------------------------------- 1 | input('id'); 15 | $limit = $request->input('limit', 6); 16 | $name = $request->input('name'); 17 | $types = $request->input('types'); 18 | 19 | $price_from = $request->input('price_from'); 20 | $price_to = $request->input('price_to'); 21 | 22 | $rate_from = $request->input('rate_from'); 23 | $rate_to = $request->input('rate_to'); 24 | 25 | if($id) 26 | { 27 | $food = Food::find($id); 28 | 29 | if($food) 30 | return ResponseFormatter::success( 31 | $food, 32 | 'Data produk berhasil diambil' 33 | ); 34 | else 35 | return ResponseFormatter::error( 36 | null, 37 | 'Data produk tidak ada', 38 | 404 39 | ); 40 | } 41 | 42 | $food = Food::query(); 43 | 44 | if($name) 45 | $food->where('name', 'like', '%' . $name . '%'); 46 | 47 | if($types) 48 | $food->where('types', 'like', '%' . $types . '%'); 49 | 50 | if($price_from) 51 | $food->where('price', '>=', $price_from); 52 | 53 | if($price_to) 54 | $food->where('price', '<=', $price_to); 55 | 56 | if($rate_from) 57 | $food->where('rate', '>=', $rate_from); 58 | 59 | if($rate_to) 60 | $food->where('rate', '<=', $rate_to); 61 | 62 | return ResponseFormatter::success( 63 | $food->paginate($limit), 64 | 'Data list produk berhasil diambil' 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.3", 12 | "fideloper/proxy": "^4.2", 13 | "fruitcake/laravel-cors": "^2.0", 14 | "guzzlehttp/guzzle": "^7.0.1", 15 | "laravel/framework": "^8.0", 16 | "laravel/jetstream": "^1.2", 17 | "laravel/sanctum": "^2.6", 18 | "laravel/tinker": "^2.0", 19 | "livewire/livewire": "^2.0", 20 | "midtrans/midtrans-php": "^2.3" 21 | }, 22 | "require-dev": { 23 | "facade/ignition": "^2.3.6", 24 | "fzaninotto/faker": "^1.9.1", 25 | "mockery/mockery": "^1.3.1", 26 | "nunomaduro/collision": "^5.0", 27 | "phpunit/phpunit": "^9.3" 28 | }, 29 | "config": { 30 | "optimize-autoloader": true, 31 | "preferred-install": "dist", 32 | "sort-packages": true 33 | }, 34 | "extra": { 35 | "laravel": { 36 | "dont-discover": [] 37 | } 38 | }, 39 | "autoload": { 40 | "psr-4": { 41 | "App\\": "app/", 42 | "Database\\Factories\\": "database/factories/", 43 | "Database\\Seeders\\": "database/seeders/" 44 | } 45 | }, 46 | "autoload-dev": { 47 | "psr-4": { 48 | "Tests\\": "tests/" 49 | } 50 | }, 51 | "minimum-stability": "dev", 52 | "prefer-stable": true, 53 | "scripts": { 54 | "post-autoload-dump": [ 55 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 56 | "@php artisan package:discover --ansi" 57 | ], 58 | "post-root-package-install": [ 59 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 60 | ], 61 | "post-create-project-cmd": [ 62 | "@php artisan key:generate --ansi" 63 | ] 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 'datetime', 58 | ]; 59 | 60 | /** 61 | * The accessors to append to the model's array form. 62 | * 63 | * @var array 64 | */ 65 | protected $appends = [ 66 | 'profile_photo_url', 67 | ]; 68 | 69 | public function getCreatedAtAttribute($created_at) 70 | { 71 | return Carbon::parse($created_at) 72 | ->getPreciseTimestamp(3); 73 | } 74 | public function getUpdatedAtAttribute($updated_at) 75 | { 76 | return Carbon::parse($updated_at) 77 | ->getPreciseTimestamp(3); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/modal.blade.php: -------------------------------------------------------------------------------- 1 | @props(['id', 'maxWidth']) 2 | 3 | @php 4 | $id = $id ?? md5($attributes->wire('model')); 5 | 6 | switch ($maxWidth ?? '2xl') { 7 | case 'sm': 8 | $maxWidth = 'sm:max-w-sm'; 9 | break; 10 | case 'md': 11 | $maxWidth = 'sm:max-w-md'; 12 | break; 13 | case 'lg': 14 | $maxWidth = 'sm:max-w-lg'; 15 | break; 16 | case 'xl': 17 | $maxWidth = 'sm:max-w-xl'; 18 | break; 19 | case '2xl': 20 | default: 21 | $maxWidth = 'sm:max-w-2xl'; 22 | break; 23 | } 24 | @endphp 25 | 26 | 51 | -------------------------------------------------------------------------------- /resources/views/profile/delete-user-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Delete Account') }} 4 | 5 | 6 | 7 | {{ __('Permanently delete your account.') }} 8 | 9 | 10 | 11 |
12 | {{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.') }} 13 |
14 | 15 |
16 | 17 | {{ __('Delete Account') }} 18 | 19 |
20 | 21 | 22 | 23 | 24 | {{ __('Delete Account') }} 25 | 26 | 27 | 28 | {{ __('Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.') }} 29 | 30 |
31 | 35 | 36 | 37 |
38 |
39 | 40 | 41 | 42 | {{ __('Nevermind') }} 43 | 44 | 45 | 46 | {{ __('Delete Account') }} 47 | 48 | 49 |
50 |
51 |
52 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 36 | \App\Http\Middleware\EncryptCookies::class, 37 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 38 | \Illuminate\Session\Middleware\StartSession::class, 39 | \Laravel\Jetstream\Http\Middleware\AuthenticateSession::class, 40 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 41 | \App\Http\Middleware\VerifyCsrfToken::class, 42 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 43 | ], 44 | 45 | 'api' => [ 46 | EnsureFrontendRequestsAreStateful::class, 47 | 'throttle:api', 48 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 49 | ], 50 | ]; 51 | 52 | /** 53 | * The application's route middleware. 54 | * 55 | * These middleware may be assigned to groups or used individually. 56 | * 57 | * @var array 58 | */ 59 | protected $routeMiddleware = [ 60 | 'auth' => \App\Http\Middleware\Authenticate::class, 61 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 62 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 63 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 64 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 65 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 66 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 67 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 68 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 69 | 'admin' => IsAdmin::class, 70 | ]; 71 | } 72 | -------------------------------------------------------------------------------- /resources/views/auth/two-factor-challenge.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 | {{ __('Please confirm access to your account by entering the authentication code provided by your authenticator application.') }} 10 |
11 | 12 |
13 | {{ __('Please confirm access to your account by entering one of your emergency recovery codes.') }} 14 |
15 | 16 | 17 | 18 |
19 | @csrf 20 | 21 |
22 | 23 | 24 |
25 | 26 |
27 | 28 | 29 |
30 | 31 |
32 | 40 | 41 | 49 | 50 | 51 | {{ __('Login') }} 52 | 53 |
54 |
55 |
56 |
57 |
58 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "sftp", "s3" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | 'url' => env('AWS_URL'), 65 | 'endpoint' => env('AWS_ENDPOINT'), 66 | ], 67 | 68 | ], 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Symbolic Links 73 | |-------------------------------------------------------------------------- 74 | | 75 | | Here you may configure the symbolic links that will be created when the 76 | | `storage:link` Artisan command is executed. The array keys should be 77 | | the locations of the links and the values should be their targets. 78 | | 79 | */ 80 | 81 | 'links' => [ 82 | public_path('storage') => storage_path('app/public'), 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | 'block_for' => 0, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => env('AWS_ACCESS_KEY_ID'), 55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 58 | 'suffix' => env('SQS_SUFFIX'), 59 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 60 | ], 61 | 62 | 'redis' => [ 63 | 'driver' => 'redis', 64 | 'connection' => 'default', 65 | 'queue' => env('REDIS_QUEUE', 'default'), 66 | 'retry_after' => 90, 67 | 'block_for' => null, 68 | ], 69 | 70 | ], 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Failed Queue Jobs 75 | |-------------------------------------------------------------------------- 76 | | 77 | | These options configure the behavior of failed queue job logging so you 78 | | can control which database and table are used to store the jobs that 79 | | have failed. You may change them to any database / table you wish. 80 | | 81 | */ 82 | 83 | 'failed' => [ 84 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 85 | 'database' => env('DB_CONNECTION', 'mysql'), 86 | 'table' => 'failed_jobs', 87 | ], 88 | 89 | ]; 90 | -------------------------------------------------------------------------------- /resources/views/users/index.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('User') }} 5 |

6 |
7 | 8 |
9 |
10 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | @forelse($user as $item) 28 | 29 | 30 | 31 | 32 | 33 | 44 | 45 | @empty 46 | 47 | 50 | 51 | @endforelse 52 | 53 |
IDNameEmailRolesAction
{{ $item->id }}{{ $item->name }}{{ $item->email }}{{ $item->roles }} 34 | 35 | Edit 36 | 37 |
38 | {!! method_field('delete') . csrf_field() !!} 39 | 42 |
43 |
48 | Data Tidak Ditemukan 49 |
54 |
55 |
56 | {{ $user->links() }} 57 |
58 |
59 |
60 |
61 | -------------------------------------------------------------------------------- /resources/views/transactions/index.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Transaction') }} 5 |

6 |
7 | 8 |
9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | @forelse($transaction as $item) 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 43 | 44 | @empty 45 | 46 | 49 | 50 | @endforelse 51 | 52 |
IDFoodUserQuantityTotalStatusAction
{{ $item->id }}{{ $item->food->name }}{{ $item->user->name }}{{ $item->quantity }}{{ number_format($item->total) }}{{ $item->status }} 33 | 34 | View 35 | 36 |
37 | {!! method_field('delete') . csrf_field() !!} 38 | 41 |
42 |
47 | Data Tidak Ditemukan 48 |
53 |
54 |
55 | {{ $transaction->links() }} 56 |
57 |
58 |
59 |
60 | -------------------------------------------------------------------------------- /app/Http/Controllers/TransactionController.php: -------------------------------------------------------------------------------- 1 | paginate(10); 18 | 19 | return view('transactions.index', [ 20 | 'transaction' => $transaction 21 | ]); 22 | } 23 | 24 | /** 25 | * Show the form for creating a new resource. 26 | * 27 | * @return \Illuminate\Http\Response 28 | */ 29 | public function create() 30 | { 31 | // 32 | } 33 | 34 | /** 35 | * Store a newly created resource in storage. 36 | * 37 | * @param \Illuminate\Http\Request $request 38 | * @return \Illuminate\Http\Response 39 | */ 40 | public function store(Request $request) 41 | { 42 | // 43 | } 44 | 45 | /** 46 | * Display the specified resource. 47 | * 48 | * @param \App\Models\Transaction $transaction 49 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\Response|\Illuminate\View\View 50 | */ 51 | public function show(Transaction $transaction) 52 | { 53 | return view('transactions.detail',[ 54 | 'item' => $transaction 55 | ]); 56 | } 57 | 58 | /** 59 | * Show the form for editing the specified resource. 60 | * 61 | * @param \App\Models\Transaction $transaction 62 | * @return \Illuminate\Http\Response 63 | */ 64 | public function edit(Transaction $transaction) 65 | { 66 | // 67 | } 68 | 69 | /** 70 | * Update the specified resource in storage. 71 | * 72 | * @param \Illuminate\Http\Request $request 73 | * @param \App\Models\Transaction $transaction 74 | * @return \Illuminate\Http\Response 75 | */ 76 | public function update(Request $request, Transaction $transaction) 77 | { 78 | // 79 | } 80 | 81 | /** 82 | * Remove the specified resource from storage. 83 | * 84 | * @param \App\Models\Transaction $transaction 85 | * @return \Illuminate\Http\RedirectResponse 86 | */ 87 | public function destroy(Transaction $transaction) 88 | { 89 | $transaction->delete(); 90 | 91 | return redirect()->route('transactions.index'); 92 | } 93 | 94 | /** 95 | * @param Request $request 96 | * @param $id 97 | * @param $status 98 | * @return \Illuminate\Http\RedirectResponse 99 | */ 100 | public function changeStatus(Request $request, $id, $status) 101 | { 102 | $transaction = Transaction::findOrFail($id); 103 | 104 | $transaction->status = $status; 105 | $transaction->save(); 106 | 107 | return redirect()->route('transactions.show', $id); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /resources/views/food/index.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Food') }} 5 |

6 |
7 | 8 |
9 |
10 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | @forelse($food as $item) 29 | 30 | 31 | 32 | 33 | 34 | 35 | 46 | 47 | @empty 48 | 49 | 52 | 53 | @endforelse 54 | 55 |
IDNamePriceRateTypesAction
{{ $item->id }}{{ $item->name }}{{ number_format($item->price) }}{{ $item->rate }}{{ $item->types }} 36 | 37 | Edit 38 | 39 |
40 | {!! method_field('delete') . csrf_field() !!} 41 | 44 |
45 |
50 | Data Tidak Ditemukan 51 |
56 |
57 |
58 | {{ $food->links() }} 59 |
60 |
61 |
62 |
63 | -------------------------------------------------------------------------------- /.idea/sonarlint/issuestore/index.pb: -------------------------------------------------------------------------------- 1 | 2 | > 3 | routes/api.php,b\3\b337d07ab0e7d54bf5547a0321a43ecafbd73ec1 4 | [ 5 | +app/Http/Controllers/API/UserController.php,f\3\f3cae797cbcb5410c34784294fca1a1cc4d472a8 6 | 4 7 | .env,3\c\3c84dcdc6bbe3d7817c49dcdc327b926fea1808a 8 | C 9 | config/services.php,6\7\67cde7ebf0c82e44eedc43a9b83d4fa13c684078 10 | _ 11 | /app/Http/Controllers/API/MidtransController.php,3\3\33cdd3b8c61fc209aab9e9b947a657801b4cfbb3 12 | b 13 | 2app/Http/Controllers/API/TransactionController.php,5\5\55744e70dd371f29fe5957f1d8fc8c5b46e0eda4 14 | Q 15 | !resources/views/welcome.blade.php,0\c\0c96dd63e07fb2e889aeaea5cbabd89d0d09f1fb 16 | Q 17 | !app/View/Components/AppLayout.php,e\e\ee5e43aa7800a963bda0a2f2c39b48510f315497 18 | S 19 | #app/View/Components/GuestLayout.php,3\d\3d96b2542cdd6d5d027c3ea024e758a90d39aef7 20 | E 21 | vendor/bin/carbon.bat,5\9\5932b15c86ec508a75aebc0396a793a7d18127b5 22 | U 23 | %resources/views/layouts/app.blade.php,4\e\4e52e2a63befd1dc69600001e78b80ebece1ac9b 24 | U 25 | %resources/views/food/create.blade.php,5\e\5eeed4fd16a93cc38da6eb0db54a5e82c989f78c 26 | S 27 | #resources/views/food/edit.blade.php,2\9\29a82e130f118dc2ad16835758180edb7e9bb247 28 | J 29 | app/Models/Transaction.php,2\a\2adc11cabd43939021607c926aaa4d2552020aec 30 | T 31 | $resources/views/food/index.blade.php,e\7\e7b30353b0883e36a48cdf12661e022846a1825c 32 | > 33 | routes/web.php,6\b\6b9a783d9b43fee50fd28f56dbd1856d2608f305 34 | ] 35 | -resources/views/navigation-dropdown.blade.php,1\5\151b70f7f76648b191ebb2f07ee6ec33da1f0602 36 | C 37 | app/Models/Food.php,9\c\9c83d933e0e74e6b95ad3b140ad5e17459dae8d5 38 | U 39 | %app/Actions/Fortify/CreateNewUser.php,f\6\f69b2ee373843e46136e7e6ba5b853389e33a93c 40 | d 41 | 4app/Actions/Fortify/UpdateUserProfileInformation.php,c\8\c8d913e95730061af3b4c5dd3a56da860d63e907 42 | l 43 | database/migrations/2020_09_22_105946_change_picture_field.php,d\6\d608a1d5244963954133981c9440ae3eb9bf8a34 46 | V 47 | &resources/views/users/create.blade.php,9\3\9354144e2eb7fb88420128a07f528c22bafb7605 48 | T 49 | $resources/views/users/edit.blade.php,8\e\8ece776971e3b2f05c17e0bcb278c3066385d29c 50 | U 51 | %resources/views/users/index.blade.php,1\b\1bd662ec649efed653d74a22571600f6a20ca818 52 | C 53 | app/Models/User.php,a\9\a90f2e50cb06863b54effced365aa5f1fe7d9c88 54 | W 55 | 'resources/views/auth/register.blade.php,8\6\8600e63b1d771a3b86abef40d1ef23e1ffb21feb 56 | Q 57 | !app/Http/Requests/UserRequest.php,7\d\7df1646f349e10e4141263c5f6499686c1a6ef65 58 | Q 59 | !app/Http/Requests/FoodRequest.php,b\b\bb9f6611d9d766e9c1bb4f0b50ed7b510dfb73de 60 | W 61 | 'app/Http/Controllers/FoodController.php,f\c\fce134949d5b1008dd9f1b897f6b69a73719c6c0 62 | W 63 | 'app/Http/Controllers/UserController.php,7\d\7de9f5d267d12a172eff77837bcb8fb2e88564c2 64 | S 65 | #resources/views/dashboard.blade.php,c\b\cb9b83605560606e98f1366cfe970597db7f6f83 66 | : 67 | 68 | .gitignore,a\5\a5cc2925ca8258af241be7e5b0381edf30266302 69 | X 70 | (resources/views/midtrans/error.blade.php,8\e\8e6f93637c9863e5b0fa246144b8af9ce0a0e945 71 | Z 72 | *resources/views/midtrans/success.blade.php,d\1\d1faf734fcce2afa5cee50c085f4d1612f85f3b7 73 | [ 74 | +resources/views/midtrans/unfinish.blade.php,8\8\886fde5af9c2846d4876694cf960f0638198b38e -------------------------------------------------------------------------------- /app/Http/Controllers/FoodController.php: -------------------------------------------------------------------------------- 1 | $food 23 | ]); 24 | } 25 | 26 | /** 27 | * Show the form for creating a new resource. 28 | * 29 | * @return \Illuminate\Http\Response 30 | */ 31 | public function create() 32 | { 33 | return view('food.create'); 34 | } 35 | 36 | /** 37 | * Store a newly created resource in storage. 38 | * 39 | * @param \Illuminate\Http\Request $request 40 | * @return \Illuminate\Http\RedirectResponse 41 | */ 42 | public function store(FoodRequest $request) 43 | { 44 | $data = $request->all(); 45 | 46 | $data['picturePath'] = $request->file('picturePath')->store('assets/food', 'public'); 47 | 48 | Food::create($data); 49 | 50 | return redirect()->route('food.index'); 51 | } 52 | 53 | /** 54 | * Display the specified resource. 55 | * 56 | * @param \App\Models\Food $food 57 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\Response|\Illuminate\View\View 58 | */ 59 | public function show(Food $food) 60 | { 61 | // 62 | } 63 | 64 | /** 65 | * Show the form for editing the specified resource. 66 | * 67 | * @param \App\Models\Food $food 68 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\Response|\Illuminate\View\View 69 | */ 70 | public function edit(Food $food) 71 | { 72 | return view('food.edit',[ 73 | 'item' => $food 74 | ]); 75 | } 76 | 77 | /** 78 | * Update the specified resource in storage. 79 | * 80 | * @param \Illuminate\Http\Request $request 81 | * @param \App\Models\Food $food 82 | * @return \Illuminate\Http\RedirectResponse 83 | */ 84 | public function update(Request $request, Food $food) 85 | { 86 | $data = $request->all(); 87 | 88 | if($request->file('picturePath')) 89 | { 90 | $data['picturePath'] = $request->file('picturePath')->store('assets/food', 'public'); 91 | } 92 | 93 | $food->update($data); 94 | 95 | return redirect()->route('food.index'); 96 | } 97 | 98 | /** 99 | * Remove the specified resource from storage. 100 | * 101 | * @param \App\Models\Food $food 102 | * @return \Illuminate\Http\RedirectResponse 103 | */ 104 | public function destroy(Food $food) 105 | { 106 | $food->delete(); 107 | 108 | return redirect()->route('food.index'); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/application-logo.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/Http/Controllers/UserController.php: -------------------------------------------------------------------------------- 1 | $user 22 | ]); 23 | } 24 | 25 | /** 26 | * Show the form for creating a new resource. 27 | * 28 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\Response|\Illuminate\View\View 29 | */ 30 | public function create() 31 | { 32 | return view('users.create'); 33 | } 34 | 35 | /** 36 | * Store a newly created resource in storage. 37 | * 38 | * @param \Illuminate\Http\Request $request 39 | * @return \Illuminate\Http\RedirectResponse 40 | */ 41 | public function store(UserRequest $request) 42 | { 43 | $data = $request->all(); 44 | 45 | $data['picturePath'] = $request->file('picturePath')->store('assets/user', 'public'); 46 | 47 | User::create($data); 48 | 49 | return redirect()->route('users.index'); 50 | } 51 | 52 | /** 53 | * Display the specified resource. 54 | * 55 | * @param \App\Models\User $user 56 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\Response|\Illuminate\View\View 57 | */ 58 | public function show(User $user) 59 | { 60 | // 61 | } 62 | 63 | /** 64 | * Show the form for editing the specified resource. 65 | * 66 | * @param \App\Models\User $user 67 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\Response|\Illuminate\View\View 68 | */ 69 | public function edit(User $user) 70 | { 71 | return view('users.edit',[ 72 | 'item' => $user 73 | ]); 74 | } 75 | 76 | /** 77 | * Update the specified resource in storage. 78 | * 79 | * @param \Illuminate\Http\Request $request 80 | * @param \App\Models\User $user 81 | * @return \Illuminate\Http\RedirectResponse 82 | */ 83 | public function update(Request $request, User $user) 84 | { 85 | $data = $request->all(); 86 | 87 | if($request->file('picturePath')) 88 | { 89 | $data['picturePath'] = $request->file('picturePath')->store('assets/user', 'public'); 90 | } 91 | 92 | $user->update($data); 93 | 94 | return redirect()->route('users.index'); 95 | } 96 | 97 | /** 98 | * Remove the specified resource from storage. 99 | * 100 | * @param \App\Models\User $user 101 | * @return \Illuminate\Http\RedirectResponse 102 | */ 103 | public function destroy(User $user) 104 | { 105 | $user->delete(); 106 | 107 | return redirect()->route('users.index'); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Log Channels 25 | |-------------------------------------------------------------------------- 26 | | 27 | | Here you may configure the log channels for your application. Out of 28 | | the box, Laravel uses the Monolog PHP logging library. This gives 29 | | you a variety of powerful log handlers / formatters to utilize. 30 | | 31 | | Available Drivers: "single", "daily", "slack", "syslog", 32 | | "errorlog", "monolog", 33 | | "custom", "stack" 34 | | 35 | */ 36 | 37 | 'channels' => [ 38 | 'stack' => [ 39 | 'driver' => 'stack', 40 | 'channels' => ['single'], 41 | 'ignore_exceptions' => false, 42 | ], 43 | 44 | 'single' => [ 45 | 'driver' => 'single', 46 | 'path' => storage_path('logs/laravel.log'), 47 | 'level' => 'debug', 48 | ], 49 | 50 | 'daily' => [ 51 | 'driver' => 'daily', 52 | 'path' => storage_path('logs/laravel.log'), 53 | 'level' => 'debug', 54 | 'days' => 14, 55 | ], 56 | 57 | 'slack' => [ 58 | 'driver' => 'slack', 59 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 60 | 'username' => 'Laravel Log', 61 | 'emoji' => ':boom:', 62 | 'level' => 'critical', 63 | ], 64 | 65 | 'papertrail' => [ 66 | 'driver' => 'monolog', 67 | 'level' => 'debug', 68 | 'handler' => SyslogUdpHandler::class, 69 | 'handler_with' => [ 70 | 'host' => env('PAPERTRAIL_URL'), 71 | 'port' => env('PAPERTRAIL_PORT'), 72 | ], 73 | ], 74 | 75 | 'stderr' => [ 76 | 'driver' => 'monolog', 77 | 'handler' => StreamHandler::class, 78 | 'formatter' => env('LOG_STDERR_FORMATTER'), 79 | 'with' => [ 80 | 'stream' => 'php://stderr', 81 | ], 82 | ], 83 | 84 | 'syslog' => [ 85 | 'driver' => 'syslog', 86 | 'level' => 'debug', 87 | ], 88 | 89 | 'errorlog' => [ 90 | 'driver' => 'errorlog', 91 | 'level' => 'debug', 92 | ], 93 | 94 | 'null' => [ 95 | 'driver' => 'monolog', 96 | 'handler' => NullHandler::class, 97 | ], 98 | 99 | 'emergency' => [ 100 | 'path' => storage_path('logs/laravel.log'), 101 | ], 102 | ], 103 | 104 | ]; 105 | -------------------------------------------------------------------------------- /config/fortify.php: -------------------------------------------------------------------------------- 1 | 'web', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Fortify Password Broker 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify which password broker Fortify can use when a user 27 | | is resetting their password. This configured value should match one 28 | | of your password brokers setup in your "auth" configuration file. 29 | | 30 | */ 31 | 32 | 'passwords' => 'users', 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Username 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This value defines which model attribute should be considered as your 40 | | application's "username" field. Typically, this might be the email 41 | | address of the users but you are free to change this value here. 42 | | 43 | */ 44 | 45 | 'username' => 'email', 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Home Path 50 | |-------------------------------------------------------------------------- 51 | | 52 | | Here you may configure the path where users will get redirected during 53 | | authentication or password reset when the operations are successful 54 | | and the user is authenticated. You are free to change this value. 55 | | 56 | */ 57 | 58 | 'home' => RouteServiceProvider::HOME, 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | Rate Limiting 63 | |-------------------------------------------------------------------------- 64 | | 65 | | By default, Fortify will throttle logins to five requests per minute for 66 | | every email and IP address combination. However, if you would like to 67 | | specify a custom rate limiter to call then you may specify it here. 68 | | 69 | */ 70 | 71 | 'limiters' => [ 72 | 'login' => null, 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Features 78 | |-------------------------------------------------------------------------- 79 | | 80 | | Some of the Fortify features are optional. You may disable the features 81 | | by removing them from this array. You're free to only remove some of 82 | | these features or you can even remove all of these if you need to. 83 | | 84 | */ 85 | 86 | 'features' => [ 87 | Features::registration(), 88 | Features::resetPasswords(), 89 | // Features::emailVerification(), 90 | Features::updateProfileInformation(), 91 | Features::updatePasswords(), 92 | Features::twoFactorAuthentication([ 93 | 'confirmPassword' => true, 94 | ]), 95 | ], 96 | 97 | ]; 98 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Cache Stores 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may define all of the cache "stores" for your application as 29 | | well as their drivers. You may even define multiple stores for the 30 | | same cache driver to group types of items stored in your caches. 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | ], 50 | 51 | 'file' => [ 52 | 'driver' => 'file', 53 | 'path' => storage_path('framework/cache/data'), 54 | ], 55 | 56 | 'memcached' => [ 57 | 'driver' => 'memcached', 58 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 59 | 'sasl' => [ 60 | env('MEMCACHED_USERNAME'), 61 | env('MEMCACHED_PASSWORD'), 62 | ], 63 | 'options' => [ 64 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 65 | ], 66 | 'servers' => [ 67 | [ 68 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 69 | 'port' => env('MEMCACHED_PORT', 11211), 70 | 'weight' => 100, 71 | ], 72 | ], 73 | ], 74 | 75 | 'redis' => [ 76 | 'driver' => 'redis', 77 | 'connection' => 'cache', 78 | ], 79 | 80 | 'dynamodb' => [ 81 | 'driver' => 'dynamodb', 82 | 'key' => env('AWS_ACCESS_KEY_ID'), 83 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 84 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 85 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 86 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 87 | ], 88 | 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Cache Key Prefix 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When utilizing a RAM based store such as APC or Memcached, there might 97 | | be other applications utilizing the same cache. So, we'll specify a 98 | | value to get prefixed to all our keys so we can avoid collisions. 99 | | 100 | */ 101 | 102 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 103 | 104 | ]; 105 | -------------------------------------------------------------------------------- /resources/views/profile/update-profile-information-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Profile Information') }} 4 | 5 | 6 | 7 | {{ __('Update your account\'s profile information and email address.') }} 8 | 9 | 10 | 11 | 12 | @if (Laravel\Jetstream\Jetstream::managesProfilePhotos()) 13 |
14 | 15 | 26 | 27 | 28 | 29 | 30 |
31 | {{ $this->user->name }} 32 |
33 | 34 | 35 |
36 | 38 | 39 |
40 | 41 | 42 | {{ __('Select A New Photo') }} 43 | 44 | 45 | @if ($this->user->picturePath) 46 | 47 | {{ __('Remove Photo') }} 48 | 49 | @endif 50 | 51 | 52 |
53 | @endif 54 | 55 | 56 |
57 | 58 | 59 | 60 |
61 | 62 | 63 |
64 | 65 | 66 | 67 |
68 |
69 | 70 | 71 | 72 | {{ __('Saved.') }} 73 | 74 | 75 | 76 | {{ __('Save') }} 77 | 78 | 79 |
80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | Build Status 5 | Total Downloads 6 | Latest Stable Version 7 | License 8 |

9 | 10 | ## About Laravel 11 | 12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: 13 | 14 | - [Simple, fast routing engine](https://laravel.com/docs/routing). 15 | - [Powerful dependency injection container](https://laravel.com/docs/container). 16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. 17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). 18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations). 19 | - [Robust background job processing](https://laravel.com/docs/queues). 20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting). 21 | 22 | Laravel is accessible, powerful, and provides tools required for large, robust applications. 23 | 24 | ## Learning Laravel 25 | 26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. 27 | 28 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. 29 | 30 | ## Laravel Sponsors 31 | 32 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell). 33 | 34 | ### Premium Partners 35 | 36 | - **[Vehikl](https://vehikl.com/)** 37 | - **[Tighten Co.](https://tighten.co)** 38 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** 39 | - **[64 Robots](https://64robots.com)** 40 | - **[Cubet Techno Labs](https://cubettech.com)** 41 | - **[Cyber-Duck](https://cyber-duck.co.uk)** 42 | - **[Many](https://www.many.co.uk)** 43 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)** 44 | - **[DevSquad](https://devsquad.com)** 45 | - **[OP.GG](https://op.gg)** 46 | 47 | ## Contributing 48 | 49 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). 50 | 51 | ## Code of Conduct 52 | 53 | In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). 54 | 55 | ## Security Vulnerabilities 56 | 57 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. 58 | 59 | ## License 60 | 61 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). 62 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'auth_mode' => null, 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | ], 59 | 60 | 'sendmail' => [ 61 | 'transport' => 'sendmail', 62 | 'path' => '/usr/sbin/sendmail -bs', 63 | ], 64 | 65 | 'log' => [ 66 | 'transport' => 'log', 67 | 'channel' => env('MAIL_LOG_CHANNEL'), 68 | ], 69 | 70 | 'array' => [ 71 | 'transport' => 'array', 72 | ], 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Global "From" Address 78 | |-------------------------------------------------------------------------- 79 | | 80 | | You may wish for all e-mails sent by your application to be sent from 81 | | the same address. Here, you may specify a name and address that is 82 | | used globally for all e-mails that are sent by your application. 83 | | 84 | */ 85 | 86 | 'from' => [ 87 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 88 | 'name' => env('MAIL_FROM_NAME', 'Example'), 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Markdown Mail Settings 94 | |-------------------------------------------------------------------------- 95 | | 96 | | If you are using Markdown based email rendering, you may configure your 97 | | theme and component paths here, allowing you to customize the design 98 | | of the emails. Or, you may simply stick with the Laravel defaults! 99 | | 100 | */ 101 | 102 | 'markdown' => [ 103 | 'theme' => 'default', 104 | 105 | 'paths' => [ 106 | resource_path('views/vendor/mail'), 107 | ], 108 | ], 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /resources/views/profile/two-factor-authentication-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Two Factor Authentication') }} 4 | 5 | 6 | 7 | {{ __('Add additional security to your account using two factor authentication.') }} 8 | 9 | 10 | 11 |

12 | @if ($this->enabled) 13 | {{ __('You have enabled two factor authentication.') }} 14 | @else 15 | {{ __('You have not enabled two factor authentication.') }} 16 | @endif 17 |

18 | 19 |
20 |

21 | {{ __('When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone\'s Google Authenticator application.') }} 22 |

23 |
24 | 25 | @if ($this->enabled) 26 | @if ($showingQrCode) 27 |
28 |

29 | {{ __('Two factor authentication is now enabled. Scan the following QR code using your phone\'s authenticator application.') }} 30 |

31 |
32 | 33 |
34 | {!! $this->user->twoFactorQrCodeSvg() !!} 35 |
36 | @endif 37 | 38 | @if ($showingRecoveryCodes) 39 |
40 |

41 | {{ __('Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.') }} 42 |

43 |
44 | 45 |
46 | @foreach (json_decode(decrypt($this->user->two_factor_recovery_codes), true) as $code) 47 |
{{ $code }}
48 | @endforeach 49 |
50 | @endif 51 | @endif 52 | 53 |
54 | @if (! $this->enabled) 55 | 56 | 57 | {{ __('Enable') }} 58 | 59 | 60 | @else 61 | @if ($showingRecoveryCodes) 62 | 63 | 64 | {{ __('Regenerate Recovery Codes') }} 65 | 66 | 67 | @else 68 | 69 | 70 | {{ __('Show Recovery Codes') }} 71 | 72 | 73 | @endif 74 | 75 | 76 | 77 | {{ __('Disable') }} 78 | 79 | 80 | @endif 81 |
82 |
83 |
84 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 44 | 'api' => [ 45 | 'driver' => 'token', 46 | 'provider' => 'users', 47 | 'hash' => false, 48 | ], 49 | ], 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | User Providers 54 | |-------------------------------------------------------------------------- 55 | | 56 | | All authentication drivers have a user provider. This defines how the 57 | | users are actually retrieved out of your database or other storage 58 | | mechanisms used by this application to persist your user's data. 59 | | 60 | | If you have multiple user tables or models you may configure multiple 61 | | sources which represent each model / table. These sources may then 62 | | be assigned to any extra authentication guards you have defined. 63 | | 64 | | Supported: "database", "eloquent" 65 | | 66 | */ 67 | 68 | 'providers' => [ 69 | 'users' => [ 70 | 'driver' => 'eloquent', 71 | 'model' => App\Models\User::class, 72 | ], 73 | 74 | // 'users' => [ 75 | // 'driver' => 'database', 76 | // 'table' => 'users', 77 | // ], 78 | ], 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Resetting Passwords 83 | |-------------------------------------------------------------------------- 84 | | 85 | | You may specify multiple password reset configurations if you have more 86 | | than one user table or model in the application and you want to have 87 | | separate password reset settings based on the specific user types. 88 | | 89 | | The expire time is the number of minutes that the reset token should be 90 | | considered valid. This security feature keeps tokens short-lived so 91 | | they have less time to be guessed. You may change this as needed. 92 | | 93 | */ 94 | 95 | 'passwords' => [ 96 | 'users' => [ 97 | 'provider' => 'users', 98 | 'table' => 'password_resets', 99 | 'expire' => 60, 100 | 'throttle' => 60, 101 | ], 102 | ], 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Password Confirmation Timeout 107 | |-------------------------------------------------------------------------- 108 | | 109 | | Here you may define the amount of seconds before a password confirmation 110 | | times out and the user is prompted to re-enter their password via the 111 | | confirmation screen. By default, the timeout lasts for three hours. 112 | | 113 | */ 114 | 115 | 'password_timeout' => 10800, 116 | 117 | ]; 118 | -------------------------------------------------------------------------------- /app/Http/Controllers/API/TransactionController.php: -------------------------------------------------------------------------------- 1 | input('id'); 18 | $limit = $request->input('limit', 6); 19 | $food_id = $request->input('food_id'); 20 | $status = $request->input('status'); 21 | 22 | if($id) 23 | { 24 | $transaction = Transaction::with(['food','user'])->find($id); 25 | 26 | if($transaction) 27 | return ResponseFormatter::success( 28 | $transaction, 29 | 'Data transaksi berhasil diambil' 30 | ); 31 | else 32 | return ResponseFormatter::error( 33 | null, 34 | 'Data transaksi tidak ada', 35 | 404 36 | ); 37 | } 38 | 39 | $transaction = Transaction::with(['food','user'])->where('user_id', Auth::user()->id); 40 | 41 | if($food_id) 42 | $transaction->where('food_id', $food_id); 43 | 44 | if($status) 45 | $transaction->where('status', $status); 46 | 47 | return ResponseFormatter::success( 48 | $transaction->paginate($limit), 49 | 'Data list transaksi berhasil diambil' 50 | ); 51 | } 52 | 53 | /** 54 | * @param Request $request 55 | * @return \Illuminate\Http\JsonResponse 56 | */ 57 | public function checkout(Request $request) 58 | { 59 | $request->validate([ 60 | 'food_id' => 'required|exists:food,id', 61 | 'user_id' => 'required|exists:users,id', 62 | 'quantity' => 'required', 63 | 'total' => 'required', 64 | 'status' => 'required', 65 | ]); 66 | 67 | $transaction = Transaction::create([ 68 | 'food_id' => $request->food_id, 69 | 'user_id' => $request->user_id, 70 | 'quantity' => $request->quantity, 71 | 'total' => $request->total, 72 | 'status' => $request->status, 73 | 'payment_url' => '' 74 | ]); 75 | 76 | // Konfigurasi midtrans 77 | Config::$serverKey = config('services.midtrans.serverKey'); 78 | Config::$isProduction = config('services.midtrans.isProduction'); 79 | Config::$isSanitized = config('services.midtrans.isSanitized'); 80 | Config::$is3ds = config('services.midtrans.is3ds'); 81 | 82 | $transaction = Transaction::with(['food','user'])->find($transaction->id); 83 | 84 | $midtrans = array( 85 | 'transaction_details' => array( 86 | 'order_id' => $transaction->id, 87 | 'gross_amount' => (int) $transaction->total, 88 | ), 89 | 'customer_details' => array( 90 | 'first_name' => $transaction->user->name, 91 | 'email' => $transaction->user->email 92 | ), 93 | 'enabled_payments' => array('gopay','bank_transfer'), 94 | 'vtweb' => array() 95 | ); 96 | 97 | try { 98 | // Ambil halaman payment midtrans 99 | $paymentUrl = Snap::createTransaction($midtrans)->redirect_url; 100 | 101 | $transaction->payment_url = $paymentUrl; 102 | $transaction->save(); 103 | 104 | // Redirect ke halaman midtrans 105 | return ResponseFormatter::success($transaction,'Transaksi berhasil'); 106 | } 107 | catch (Exception $e) { 108 | return ResponseFormatter::error($e->getMessage(),'Transaksi Gagal'); 109 | } 110 | } 111 | 112 | /** 113 | * @param Request $request 114 | * @param $id 115 | * @return \Illuminate\Http\JsonResponse 116 | */ 117 | public function update(Request $request, $id) 118 | { 119 | $transaction = Transaction::findOrFail($id); 120 | 121 | $transaction->update($request->all()); 122 | 123 | return ResponseFormatter::success($transaction,'Transaksi berhasil diperbarui'); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /config/datatables.php: -------------------------------------------------------------------------------- 1 | [ 8 | /* 9 | * Smart search will enclose search keyword with wildcard string "%keyword%". 10 | * SQL: column LIKE "%keyword%" 11 | */ 12 | 'smart' => true, 13 | 14 | /* 15 | * Multi-term search will explode search keyword using spaces resulting into multiple term search. 16 | */ 17 | 'multi_term' => true, 18 | 19 | /* 20 | * Case insensitive will search the keyword in lower case format. 21 | * SQL: LOWER(column) LIKE LOWER(keyword) 22 | */ 23 | 'case_insensitive' => true, 24 | 25 | /* 26 | * Wild card will add "%" in between every characters of the keyword. 27 | * SQL: column LIKE "%k%e%y%w%o%r%d%" 28 | */ 29 | 'use_wildcards' => false, 30 | 31 | /* 32 | * Perform a search which starts with the given keyword. 33 | * SQL: column LIKE "keyword%" 34 | */ 35 | 'starts_with' => false, 36 | ], 37 | 38 | /* 39 | * DataTables internal index id response column name. 40 | */ 41 | 'index_column' => 'DT_RowIndex', 42 | 43 | /* 44 | * List of available builders for DataTables. 45 | * This is where you can register your custom dataTables builder. 46 | */ 47 | 'engines' => [ 48 | 'eloquent' => Yajra\DataTables\EloquentDataTable::class, 49 | 'query' => Yajra\DataTables\QueryDataTable::class, 50 | 'collection' => Yajra\DataTables\CollectionDataTable::class, 51 | 'resource' => Yajra\DataTables\ApiResourceDataTable::class, 52 | ], 53 | 54 | /* 55 | * DataTables accepted builder to engine mapping. 56 | * This is where you can override which engine a builder should use 57 | * Note, only change this if you know what you are doing! 58 | */ 59 | 'builders' => [ 60 | //Illuminate\Database\Eloquent\Relations\Relation::class => 'eloquent', 61 | //Illuminate\Database\Eloquent\Builder::class => 'eloquent', 62 | //Illuminate\Database\Query\Builder::class => 'query', 63 | //Illuminate\Support\Collection::class => 'collection', 64 | ], 65 | 66 | /* 67 | * Nulls last sql pattern for PostgreSQL & Oracle. 68 | * For MySQL, use 'CASE WHEN :column IS NULL THEN 1 ELSE 0 END, :column :direction' 69 | */ 70 | 'nulls_last_sql' => ':column :direction NULLS LAST', 71 | 72 | /* 73 | * User friendly message to be displayed on user if error occurs. 74 | * Possible values: 75 | * null - The exception message will be used on error response. 76 | * 'throw' - Throws a \Yajra\DataTables\Exceptions\Exception. Use your custom error handler if needed. 77 | * 'custom message' - Any friendly message to be displayed to the user. You can also use translation key. 78 | */ 79 | 'error' => env('DATATABLES_ERROR', null), 80 | 81 | /* 82 | * Default columns definition of dataTable utility functions. 83 | */ 84 | 'columns' => [ 85 | /* 86 | * List of columns hidden/removed on json response. 87 | */ 88 | 'excess' => ['rn', 'row_num'], 89 | 90 | /* 91 | * List of columns to be escaped. If set to *, all columns are escape. 92 | * Note: You can set the value to empty array to disable XSS protection. 93 | */ 94 | 'escape' => '*', 95 | 96 | /* 97 | * List of columns that are allowed to display html content. 98 | * Note: Adding columns to list will make us available to XSS attacks. 99 | */ 100 | 'raw' => ['action'], 101 | 102 | /* 103 | * List of columns are are forbidden from being searched/sorted. 104 | */ 105 | 'blacklist' => ['password', 'remember_token'], 106 | 107 | /* 108 | * List of columns that are only allowed fo search/sort. 109 | * If set to *, all columns are allowed. 110 | */ 111 | 'whitelist' => '*', 112 | ], 113 | 114 | /* 115 | * JsonResponse header and options config. 116 | */ 117 | 'json' => [ 118 | 'header' => [], 119 | 'options' => 0, 120 | ], 121 | 122 | ]; 123 | -------------------------------------------------------------------------------- /app/Http/Controllers/API/MidtransController.php: -------------------------------------------------------------------------------- 1 | transaction_status; 31 | $type = $notification->payment_type; 32 | $fraud = $notification->fraud_status; 33 | $order_id = $notification->order_id; 34 | 35 | // Cari transaksi berdasarkan ID 36 | $transaction = Transaction::findOrFail($order_id); 37 | 38 | // Handle notification status midtrans 39 | if ($status == 'capture') { 40 | if ($type == 'credit_card'){ 41 | if($fraud == 'challenge'){ 42 | $transaction->status = 'PENDING'; 43 | } 44 | else { 45 | $transaction->status = 'SUCCESS'; 46 | } 47 | } 48 | } 49 | else if ($status == 'settlement'){ 50 | $transaction->status = 'SUCCESS'; 51 | } 52 | else if($status == 'pending'){ 53 | $transaction->status = 'PENDING'; 54 | } 55 | else if ($status == 'deny') { 56 | $transaction->status = 'CANCELLED'; 57 | } 58 | else if ($status == 'expire') { 59 | $transaction->status = 'CANCELLED'; 60 | } 61 | else if ($status == 'cancel') { 62 | $transaction->status = 'CANCELLED'; 63 | } 64 | 65 | // Simpan transaksi 66 | $transaction->save(); 67 | 68 | // Kirimkan email 69 | if ($transaction) 70 | { 71 | if($status == 'capture' && $fraud == 'accept' ) 72 | { 73 | // 74 | } 75 | else if ($status == 'settlement') 76 | { 77 | // 78 | } 79 | else if ($status == 'success') 80 | { 81 | // 82 | } 83 | else if($status == 'capture' && $fraud == 'challenge' ) 84 | { 85 | return response()->json([ 86 | 'meta' => [ 87 | 'code' => 200, 88 | 'message' => 'Midtrans Payment Challenge' 89 | ] 90 | ]); 91 | } 92 | else 93 | { 94 | return response()->json([ 95 | 'meta' => [ 96 | 'code' => 200, 97 | 'message' => 'Midtrans Payment not Settlement' 98 | ] 99 | ]); 100 | } 101 | 102 | return response()->json([ 103 | 'meta' => [ 104 | 'code' => 200, 105 | 'message' => 'Midtrans Notification Success' 106 | ] 107 | ]); 108 | } 109 | } 110 | 111 | /** 112 | * @param Request $request 113 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View 114 | */ 115 | public function success(Request $request) 116 | { 117 | return view('midtrans.success'); 118 | } 119 | 120 | /** 121 | * @param Request $request 122 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View 123 | */ 124 | public function unfinish(Request $request) 125 | { 126 | return view('midtrans.unfinish'); 127 | } 128 | 129 | /** 130 | * @param Request $request 131 | * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View 132 | */ 133 | public function error(Request $request) 134 | { 135 | return view('midtrans.error'); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /resources/views/midtrans/error.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 22 | 23 | 24 |
25 |

26 | Transaksi Gagal.
Silahkan Tutup Halaman Ini 27 |

28 |
29 | 30 | 31 | -------------------------------------------------------------------------------- /resources/views/midtrans/unfinish.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 22 | 23 | 24 |
25 |

26 | Transaksi Sedang Diproses.
Silahkan Tutup Halaman Ini 27 |

28 |
29 | 30 | 31 | --------------------------------------------------------------------------------