From a4d49cd89bf87bde0823ab01ab8dd0d40ee84a00 Mon Sep 17 00:00:00 2001 From: hildaaaevs <149044919+hildaaaevs@users.noreply.github.com> Date: Sat, 24 May 2025 19:57:58 +0700 Subject: [PATCH] Initial commit --- .editorconfig | 18 + .env.example | 66 + .gitattributes | 11 + .gitignore | 23 + README.md | 66 + app/Filament/Resources/PaketFotoResource.php | 111 + .../Pages/CreatePaketFoto.php | 12 + .../PaketFotoResource/Pages/EditPaketFoto.php | 19 + .../Pages/ListPaketFotos.php | 19 + app/Filament/Resources/PromoResource.php | 96 + .../PromoResource/Pages/CreatePromo.php | 12 + .../PromoResource/Pages/EditPromo.php | 19 + .../PromoResource/Pages/ListPromos.php | 19 + app/Filament/Resources/ReservasiiResource.php | 294 + .../Pages/CreateReservasii.php | 12 + .../Pages/EditReservasii.php | 19 + .../Pages/ListReservasiis.php | 26 + .../Pages/ViewReservasii.php | 12 + .../Widgets/ReservasiiStats.php | 22 + app/Filament/Resources/UserResource.php | 102 + .../UserResource/Pages/CreateUser.php | 12 + .../Resources/UserResource/Pages/EditUser.php | 19 + .../UserResource/Pages/ListUsers.php | 19 + .../ReservasiiRelationManager.php | 73 + app/Filament/Widgets/CalendarWidget.php | 33 + app/Filament/Widgets/ReservasiTerbaru.php | 55 + app/Helpers/CartManagement.php | 111 + app/Http/Controllers/Controller.php | 8 + app/Livewire/Auth/ForgotPasswordPage.php | 32 + app/Livewire/Auth/LoginPage.php | 31 + app/Livewire/Auth/RegisterPage.php | 43 + app/Livewire/Auth/ResetPasswordPage.php | 13 + app/Livewire/BookingPage.php | 139 + app/Livewire/CancelPage.php | 13 + app/Livewire/CartPage.php | 13 + app/Livewire/DetailPaketFotoPage.php | 32 + app/Livewire/Histori.php | 13 + app/Livewire/HomePage.php | 20 + app/Livewire/PaketFotoPage.php | 44 + app/Livewire/Partials/Footer.php | 13 + app/Livewire/Partials/Navbar.php | 25 + app/Livewire/SuccesPage.php | 13 + app/Models/PaketFoto.php | 13 + app/Models/Promo.php | 22 + app/Models/ReservasiDetail.php | 32 + app/Models/Reservasii.php | 46 + app/Models/User.php | 57 + app/Providers/AppServiceProvider.php | 24 + app/Providers/Filament/AdminPanelProvider.php | 65 + artisan | 15 + bootstrap/app.php | 18 + bootstrap/cache/.gitignore | 2 + bootstrap/providers.php | 6 + composer.json | 75 + composer.lock | 9812 +++++++++++++++++ config/app.php | 126 + config/auth.php | 115 + config/cache.php | 108 + config/database.php | 173 + config/filesystems.php | 80 + config/logging.php | 132 + config/mail.php | 116 + config/queue.php | 112 + config/services.php | 38 + config/session.php | 217 + database/.gitignore | 1 + database/factories/UserFactory.php | 44 + .../0001_01_01_000000_create_users_table.php | 49 + .../0001_01_01_000001_create_cache_table.php | 35 + .../0001_01_01_000002_create_jobs_table.php | 57 + ..._02_17_125338_create_paket_fotos_table.php | 33 + .../2025_02_20_042326_create_promos_table.php | 31 + ..._02_20_043621_create_reservasiis_table.php | 34 + ..._172151_create_reservasi_details_table.php | 33 + database/seeders/DatabaseSeeder.php | 25 + database/seeders/PaketFotoSeeder.php | 60 + database/seeders/UserSeeder.php | 23 + package-lock.json | 2965 +++++ package.json | 21 + phpunit.xml | 33 + postcss.config.js | 6 + public/.htaccess | 25 + public/css/filament/filament/app.css | 1 + public/css/filament/forms/forms.css | 49 + public/css/filament/support/support.css | 1 + public/favicon.ico | 0 public/index.php | 17 + public/js/filament/filament/app.js | 1 + public/js/filament/filament/echo.js | 13 + .../filament/forms/components/color-picker.js | 1 + .../forms/components/date-time-picker.js | 1 + .../filament/forms/components/file-upload.js | 123 + .../js/filament/forms/components/key-value.js | 1 + .../forms/components/markdown-editor.js | 51 + .../filament/forms/components/rich-editor.js | 150 + public/js/filament/forms/components/select.js | 6 + .../filament/forms/components/tags-input.js | 1 + .../js/filament/forms/components/textarea.js | 1 + .../filament/notifications/notifications.js | 1 + public/js/filament/support/support.js | 46 + public/js/filament/tables/components/table.js | 1 + .../js/filament/widgets/components/chart.js | 37 + .../components/stats-overview/stat/chart.js | 29 + public/robots.txt | 2 + resources/css/app.css | 3 + resources/js/app.js | 5 + resources/js/bootstrap.js | 4 + .../views/components/layouts/app.blade.php | 22 + .../widgets/calendar-widget.blade.php | 65 + .../auth/forgot-password-page.blade.php | 58 + .../views/livewire/auth/login-page.blade.php | 75 + .../livewire/auth/register-page.blade.php | 87 + .../auth/reset-password-page.blade.php | 56 + .../views/livewire/booking-page.blade.php | 275 + .../views/livewire/cancel-page.blade.php | 11 + resources/views/livewire/cart-page.blade.php | 66 + .../livewire/detail-paket-foto-page.blade.php | 70 + resources/views/livewire/histori.blade.php | 58 + resources/views/livewire/home-page.blade.php | 185 + .../views/livewire/paket-foto-page.blade.php | 60 + .../views/livewire/partials/footer.blade.php | 85 + .../views/livewire/partials/navbar.blade.php | 94 + .../views/livewire/succes-page.blade.php | 83 + routes/console.php | 8 + routes/web.php | 46 + storage/app/.gitignore | 4 + storage/app/private/.gitignore | 2 + storage/app/public/.gitignore | 2 + storage/framework/.gitignore | 9 + storage/framework/cache/.gitignore | 3 + storage/framework/cache/data/.gitignore | 2 + storage/framework/sessions/.gitignore | 2 + storage/framework/testing/.gitignore | 2 + storage/framework/views/.gitignore | 2 + storage/logs/.gitignore | 2 + tailwind.config.js | 21 + tests/Feature/ExampleTest.php | 19 + tests/TestCase.php | 10 + tests/Unit/ExampleTest.php | 16 + vite.config.js | 11 + webpack.mix.js | 4 + 141 files changed, 18691 insertions(+) create mode 100644 .editorconfig create mode 100644 .env.example create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README.md create mode 100644 app/Filament/Resources/PaketFotoResource.php create mode 100644 app/Filament/Resources/PaketFotoResource/Pages/CreatePaketFoto.php create mode 100644 app/Filament/Resources/PaketFotoResource/Pages/EditPaketFoto.php create mode 100644 app/Filament/Resources/PaketFotoResource/Pages/ListPaketFotos.php create mode 100644 app/Filament/Resources/PromoResource.php create mode 100644 app/Filament/Resources/PromoResource/Pages/CreatePromo.php create mode 100644 app/Filament/Resources/PromoResource/Pages/EditPromo.php create mode 100644 app/Filament/Resources/PromoResource/Pages/ListPromos.php create mode 100644 app/Filament/Resources/ReservasiiResource.php create mode 100644 app/Filament/Resources/ReservasiiResource/Pages/CreateReservasii.php create mode 100644 app/Filament/Resources/ReservasiiResource/Pages/EditReservasii.php create mode 100644 app/Filament/Resources/ReservasiiResource/Pages/ListReservasiis.php create mode 100644 app/Filament/Resources/ReservasiiResource/Pages/ViewReservasii.php create mode 100644 app/Filament/Resources/ReservasiiResource/Widgets/ReservasiiStats.php create mode 100644 app/Filament/Resources/UserResource.php create mode 100644 app/Filament/Resources/UserResource/Pages/CreateUser.php create mode 100644 app/Filament/Resources/UserResource/Pages/EditUser.php create mode 100644 app/Filament/Resources/UserResource/Pages/ListUsers.php create mode 100644 app/Filament/Resources/UserResource/RelationManagers/ReservasiiRelationManager.php create mode 100644 app/Filament/Widgets/CalendarWidget.php create mode 100644 app/Filament/Widgets/ReservasiTerbaru.php create mode 100644 app/Helpers/CartManagement.php create mode 100644 app/Http/Controllers/Controller.php create mode 100644 app/Livewire/Auth/ForgotPasswordPage.php create mode 100644 app/Livewire/Auth/LoginPage.php create mode 100644 app/Livewire/Auth/RegisterPage.php create mode 100644 app/Livewire/Auth/ResetPasswordPage.php create mode 100644 app/Livewire/BookingPage.php create mode 100644 app/Livewire/CancelPage.php create mode 100644 app/Livewire/CartPage.php create mode 100644 app/Livewire/DetailPaketFotoPage.php create mode 100644 app/Livewire/Histori.php create mode 100644 app/Livewire/HomePage.php create mode 100644 app/Livewire/PaketFotoPage.php create mode 100644 app/Livewire/Partials/Footer.php create mode 100644 app/Livewire/Partials/Navbar.php create mode 100644 app/Livewire/SuccesPage.php create mode 100644 app/Models/PaketFoto.php create mode 100644 app/Models/Promo.php create mode 100644 app/Models/ReservasiDetail.php create mode 100644 app/Models/Reservasii.php create mode 100644 app/Models/User.php create mode 100644 app/Providers/AppServiceProvider.php create mode 100644 app/Providers/Filament/AdminPanelProvider.php create mode 100644 artisan create mode 100644 bootstrap/app.php create mode 100644 bootstrap/cache/.gitignore create mode 100644 bootstrap/providers.php create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 config/app.php create mode 100644 config/auth.php create mode 100644 config/cache.php create mode 100644 config/database.php create mode 100644 config/filesystems.php create mode 100644 config/logging.php create mode 100644 config/mail.php create mode 100644 config/queue.php create mode 100644 config/services.php create mode 100644 config/session.php create mode 100644 database/.gitignore create mode 100644 database/factories/UserFactory.php create mode 100644 database/migrations/0001_01_01_000000_create_users_table.php create mode 100644 database/migrations/0001_01_01_000001_create_cache_table.php create mode 100644 database/migrations/0001_01_01_000002_create_jobs_table.php create mode 100644 database/migrations/2025_02_17_125338_create_paket_fotos_table.php create mode 100644 database/migrations/2025_02_20_042326_create_promos_table.php create mode 100644 database/migrations/2025_02_20_043621_create_reservasiis_table.php create mode 100644 database/migrations/2025_02_24_172151_create_reservasi_details_table.php create mode 100644 database/seeders/DatabaseSeeder.php create mode 100644 database/seeders/PaketFotoSeeder.php create mode 100644 database/seeders/UserSeeder.php create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 phpunit.xml create mode 100644 postcss.config.js create mode 100644 public/.htaccess create mode 100644 public/css/filament/filament/app.css create mode 100644 public/css/filament/forms/forms.css create mode 100644 public/css/filament/support/support.css create mode 100644 public/favicon.ico create mode 100644 public/index.php create mode 100644 public/js/filament/filament/app.js create mode 100644 public/js/filament/filament/echo.js create mode 100644 public/js/filament/forms/components/color-picker.js create mode 100644 public/js/filament/forms/components/date-time-picker.js create mode 100644 public/js/filament/forms/components/file-upload.js create mode 100644 public/js/filament/forms/components/key-value.js create mode 100644 public/js/filament/forms/components/markdown-editor.js create mode 100644 public/js/filament/forms/components/rich-editor.js create mode 100644 public/js/filament/forms/components/select.js create mode 100644 public/js/filament/forms/components/tags-input.js create mode 100644 public/js/filament/forms/components/textarea.js create mode 100644 public/js/filament/notifications/notifications.js create mode 100644 public/js/filament/support/support.js create mode 100644 public/js/filament/tables/components/table.js create mode 100644 public/js/filament/widgets/components/chart.js create mode 100644 public/js/filament/widgets/components/stats-overview/stat/chart.js create mode 100644 public/robots.txt create mode 100644 resources/css/app.css create mode 100644 resources/js/app.js create mode 100644 resources/js/bootstrap.js create mode 100644 resources/views/components/layouts/app.blade.php create mode 100644 resources/views/filament/widgets/calendar-widget.blade.php create mode 100644 resources/views/livewire/auth/forgot-password-page.blade.php create mode 100644 resources/views/livewire/auth/login-page.blade.php create mode 100644 resources/views/livewire/auth/register-page.blade.php create mode 100644 resources/views/livewire/auth/reset-password-page.blade.php create mode 100644 resources/views/livewire/booking-page.blade.php create mode 100644 resources/views/livewire/cancel-page.blade.php create mode 100644 resources/views/livewire/cart-page.blade.php create mode 100644 resources/views/livewire/detail-paket-foto-page.blade.php create mode 100644 resources/views/livewire/histori.blade.php create mode 100644 resources/views/livewire/home-page.blade.php create mode 100644 resources/views/livewire/paket-foto-page.blade.php create mode 100644 resources/views/livewire/partials/footer.blade.php create mode 100644 resources/views/livewire/partials/navbar.blade.php create mode 100644 resources/views/livewire/succes-page.blade.php create mode 100644 routes/console.php create mode 100644 routes/web.php create mode 100644 storage/app/.gitignore create mode 100644 storage/app/private/.gitignore create mode 100644 storage/app/public/.gitignore create mode 100644 storage/framework/.gitignore create mode 100644 storage/framework/cache/.gitignore create mode 100644 storage/framework/cache/data/.gitignore create mode 100644 storage/framework/sessions/.gitignore create mode 100644 storage/framework/testing/.gitignore create mode 100644 storage/framework/views/.gitignore create mode 100644 storage/logs/.gitignore create mode 100644 tailwind.config.js create mode 100644 tests/Feature/ExampleTest.php create mode 100644 tests/TestCase.php create mode 100644 tests/Unit/ExampleTest.php create mode 100644 vite.config.js create mode 100644 webpack.mix.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8f0de65 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 + +[docker-compose.yml] +indent_size = 4 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6fb3de6 --- /dev/null +++ b/.env.example @@ -0,0 +1,66 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_TIMEZONE=UTC +APP_URL=http://localhost + +APP_LOCALE=en +APP_FALLBACK_LOCALE=en +APP_FAKER_LOCALE=en_US + +APP_MAINTENANCE_DRIVER=file +# APP_MAINTENANCE_STORE=database + +PHP_CLI_SERVER_WORKERS=4 + +BCRYPT_ROUNDS=12 + +LOG_CHANNEL=stack +LOG_STACK=single +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug + +DB_CONNECTION=sqlite +# DB_HOST=127.0.0.1 +# DB_PORT=3306 +# DB_DATABASE=laravel +# DB_USERNAME=root +# DB_PASSWORD= + +SESSION_DRIVER=database +SESSION_LIFETIME=120 +SESSION_ENCRYPT=false +SESSION_PATH=/ +SESSION_DOMAIN=null + +BROADCAST_CONNECTION=log +FILESYSTEM_DISK=local +QUEUE_CONNECTION=database + +CACHE_STORE=database +CACHE_PREFIX= + +MEMCACHED_HOST=127.0.0.1 + +REDIS_CLIENT=phpredis +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=log +MAIL_SCHEME=null +MAIL_HOST=127.0.0.1 +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_FROM_ADDRESS="hello@example.com" +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +VITE_APP_NAME="${APP_NAME}" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fcb21d3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +* text=auto eol=lf + +*.blade.php diff=html +*.css diff=css +*.html diff=html +*.md diff=markdown +*.php diff=php + +/.github export-ignore +CHANGELOG.md export-ignore +.styleci.yml export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c7cf1fa --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +/.phpunit.cache +/node_modules +/public/build +/public/hot +/public/storage +/storage/*.key +/storage/pail +/vendor +.env +.env.backup +.env.production +.phpactor.json +.phpunit.result.cache +Homestead.json +Homestead.yaml +npm-debug.log +yarn-error.log +/auth.json +/.fleet +/.idea +/.nova +/.vscode +/.zed diff --git a/README.md b/README.md new file mode 100644 index 0000000..1a4c26b --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +
+ + + +## About Laravel + +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: + +- [Simple, fast routing engine](https://laravel.com/docs/routing). +- [Powerful dependency injection container](https://laravel.com/docs/container). +- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. +- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). +- Database agnostic [schema migrations](https://laravel.com/docs/migrations). +- [Robust background job processing](https://laravel.com/docs/queues). +- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). + +Laravel is accessible, powerful, and provides tools required for large, robust applications. + +## Learning Laravel + +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. + +You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. + +If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of 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. + +## Laravel Sponsors + +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 Partners program](https://partners.laravel.com). + +### Premium Partners + +- **[Vehikl](https://vehikl.com/)** +- **[Tighten Co.](https://tighten.co)** +- **[WebReinvent](https://webreinvent.com/)** +- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** +- **[64 Robots](https://64robots.com)** +- **[Curotec](https://www.curotec.com/services/technologies/laravel/)** +- **[Cyber-Duck](https://cyber-duck.co.uk)** +- **[DevSquad](https://devsquad.com/hire-laravel-developers)** +- **[Jump24](https://jump24.co.uk)** +- **[Redberry](https://redberry.international/laravel/)** +- **[Active Logic](https://activelogic.com)** +- **[byte5](https://byte5.de)** +- **[OP.GG](https://op.gg)** + +## Contributing + +Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). + +## Code of Conduct + +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). + +## Security Vulnerabilities + +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. + +## License + +The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/app/Filament/Resources/PaketFotoResource.php b/app/Filament/Resources/PaketFotoResource.php new file mode 100644 index 0000000..1db0b82 --- /dev/null +++ b/app/Filament/Resources/PaketFotoResource.php @@ -0,0 +1,111 @@ +schema([ + Group::make()->schema([ + Section::make()->schema([ + TextInput::make('kode_paket_foto') + ->label('Kode Paket Foto') + ->maxLength(255), + TextInput::make('nama_paket_foto') + ->label('Nama Paket Foto') + ->maxLength(255), + TextInput::make('harga_paket_foto') + ->label('Harga') + ->maxLength(255), + MarkdownEditor::make('fasilitas') + ])->columnSpan(2), + Section::make()->schema([ + FileUpload::make('gambar'), + Toggle::make('status') + ->required() + ->default(true), + ]) + ]) + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + TextColumn::make('kode_paket_foto'), + TextColumn::make('nama_paket_foto'), + TextColumn::make('harga_paket_foto') + ->label('Harga'), + TextColumn::make('fasilitas'), + ImageColumn::make('gambar') + ->label('Preview') + ->size(100), // Ukuran thumbnail + IconColumn::make('status') + ->boolean() + ]) + ->filters([ + // + ]) + ->actions([ + ActionGroup::make([ + ViewAction::make(), + EditAction::make(), + DeleteAction::make() + ]) + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getRelations(): array + { + return [ + // + ]; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListPaketFotos::route('/'), + 'create' => Pages\CreatePaketFoto::route('/create'), + 'edit' => Pages\EditPaketFoto::route('/{record}/edit'), + ]; + } +} diff --git a/app/Filament/Resources/PaketFotoResource/Pages/CreatePaketFoto.php b/app/Filament/Resources/PaketFotoResource/Pages/CreatePaketFoto.php new file mode 100644 index 0000000..c910762 --- /dev/null +++ b/app/Filament/Resources/PaketFotoResource/Pages/CreatePaketFoto.php @@ -0,0 +1,12 @@ +schema([ + Section::make([ + Group::make() + ->schema([ + TextInput::make('kode') + ->label('Kode Promo'), + Select::make('tipe') + ->label('Tipe Promo') + ->options(['fix'=>'Fix','persen'=>'Persentase']), + TextInput::make('diskon'), + ]), + Toggle::make('aktif') + ->default(true), + ]) + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + TextColumn::make('kode') + ->label('Kode Promo'), + TextColumn::make('tipe') + ->label('Tipe Promo'), + TextColumn::make('diskon'), + BadgeColumn::make('aktif') + ->label('Status') + ->formatStateUsing(fn ($state) => $state ? 'Aktif' : 'Nonaktif') + ->colors([ + 'success' => fn ($state): bool => $state, // Warna hijau jika aktif + 'danger' => fn ($state): bool => !$state // Warna merah jika nonaktif + ]) + ]) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\EditAction::make(), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getRelations(): array + { + return [ + // + ]; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListPromos::route('/'), + 'create' => Pages\CreatePromo::route('/create'), + 'edit' => Pages\EditPromo::route('/{record}/edit'), + ]; + } +} diff --git a/app/Filament/Resources/PromoResource/Pages/CreatePromo.php b/app/Filament/Resources/PromoResource/Pages/CreatePromo.php new file mode 100644 index 0000000..bb86022 --- /dev/null +++ b/app/Filament/Resources/PromoResource/Pages/CreatePromo.php @@ -0,0 +1,12 @@ +schema([ + Grid::make(2) ->schema([ + Group::make()->schema([ + Section::make('Informasi Reservasi')->schema([ + Select::make('user_id') + ->label('Nama') + ->relationship('user', 'name') + ->searchable() + ->preload() + ->required(), + Select::make('metode_pembayaran') + ->label('Metode pembayaran') + ->options([ + 'tunai' => 'Tunai', + 'transfer' => 'Transfer Bank', + 'wallet' => 'E-Wallet', + ]) + ->required(), + Radio::make('tipe_pembayaran') + ->label('Tipe pembayaran') + ->options([ + 'full' => 'Full', + 'dp' => 'DP', + ]) + ->required(), + ]) + ])->columnSpan(1), + + Group::make()->schema([ + Section::make('Promo')->schema([ + Select::make('promo_id') + ->label('Promo') + ->relationship('promo', 'kode') + ->searchable() + ->preload() + ->nullable() + ->options(function() { + return \App\Models\Promo::where('aktif', true) + ->pluck('kode', 'id'); + }), + ]), + + Section::make('Jadwal Reservasi')->schema([ + DatePicker::make('tanggal') + ->label('Tanggal') + ->required(), + Select::make('waktu') + ->label('Pilih Jam') + ->options( + collect(range(8, 23))->mapWithKeys(function ($hour) { + $formatted = str_pad($hour, 2, '0', STR_PAD_LEFT) . ':00'; + return [$formatted => $formatted]; + })->toArray() + ) + ->required() + ]), + ])->columnSpan(1), + + + Section::make('Detail Reservasi')->schema([ + Repeater::make('detail') + ->relationship() + ->schema([ + Grid::make(12) + ->schema([ + Select::make('paket_foto_id') + ->relationship('paketFoto', 'nama_paket_foto') + ->searchable() + ->preload() + ->required() + ->distinct() + ->disableOptionsWhenSelectedInSiblingRepeaterItems() + ->columnSpan(3) + ->reactive() + ->afterStateUpdated(fn ($state, Set $set) => $set('harga', PaketFoto::find + ($state)?->harga_paket_foto ?? 0)) + ->afterStateUpdated(fn ($state, Set $set) => $set('total_harga', PaketFoto::find + ($state)?->harga_paket_foto ?? 0)), + + Select::make('warna') + ->label('Background') + ->required() + ->options([ + 'putih' => 'White', + 'abu' => 'Grey', + 'cream' => 'Cream', + 'spotlight' => 'Spotlight' + ]) + ->columnSpan(2), // Lebih kecil karena opsinya sedikit + + TextInput::make('jumlah') + ->numeric() + ->default(1) + ->required() + ->minValue(1) + ->columnSpan(2) + ->reactive() + ->afterStateUpdated(fn ($state, Set $set, Get $get) => $set('total_harga', + $state*$get('harga'))), + + TextInput::make('harga') + ->numeric() + ->required() + ->disabled() + ->dehydrated() + ->columnSpan(2), + + TextInput::make('total_harga') + ->numeric() + ->required() + ->dehydrated() + ->columnSpan(3), + ]), + ]) + ->columns(12), + Placeholder::make('total_placeholder') + ->label('Total') + ->content(function (Get $get, Set $set){ + $total = 0; + if (!$repeaters = $get('detail')){ + return $total; + } + foreach ($repeaters as $key => $repeater){ + $total += $get("detail.{$key}.total_harga"); + } + $set('total', $total); + return 'Rp ' . number_format($total, 0, ',', '.'); + }), + Hidden::make('total') + ->default(0) + ])->columnSpanFull(), + ]) + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + Tables\Columns\TextColumn::make('user.name') + ->label('Nama User') + ->searchable(), + + Tables\Columns\TextColumn::make('tanggal') + ->date('d F Y') + ->sortable(), + + Tables\Columns\TextColumn::make('waktu') + ->label('Jam'), + + + Tables\Columns\TextColumn::make('promo.kode') + ->label('Kode Promo') + ->searchable(), + + Tables\Columns\TextColumn::make('total') + ->money('IDR'), + + Tables\Columns\TextColumn::make('tipe_pembayaran') + ->badge() + ->color(fn (string $state): string => match (strtolower($state)) { + 'full' => 'success', + 'dp' => 'danger', + default => 'secondary', + }), + + Tables\Columns\TextColumn::make('metode_pembayaran') + ->badge(), + + Tables\Columns\TextColumn::make('created_at') + ->label('Tanggal Dibuat') + ->dateTime('d F Y - H:i') + ->sortable() + ->toggleable(isToggledHiddenByDefault: true), + ]) + ->filters([ + Tables\Filters\SelectFilter::make('tipe_pembayaran') + ->options([ + 'full' => 'Full Payment', + 'dp' => 'Down Payment', + ]) + ->label('Status Pembayaran'), + + Tables\Filters\Filter::make('tanggal') + ->form([ + Forms\Components\DatePicker::make('tanggal_from')->label('Dari Tanggal'), + Forms\Components\DatePicker::make('tanggal_until')->label('Sampai Tanggal'), + ]) + ->query(function (Builder $query, array $data): Builder { + return $query + ->when( + $data['tanggal_from'], + fn (Builder $query, $date): Builder => $query->whereDate('tanggal', '>=', $date), + ) + ->when( + $data['tanggal_until'], + fn (Builder $query, $date): Builder => $query->whereDate('tanggal', '<=', $date), + ); + }), + ]) + ->actions([ + ActionGroup::make([ + ViewAction::make(), + EditAction::make(), + DeleteAction::make() + ]) + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]) + ->defaultSort('created_at', 'desc'); + } + + public static function getRelations(): array + { + return [ + // + ]; + } + + public static function getNavigationBadge(): ?string + { + // Hitung jumlah reservasi dengan tipe pembayaran 'dp' + $dpCount = static::getModel()::where('tipe_pembayaran', 'dp')->count(); + + // Kembalikan jumlah jika ada, null jika tidak ada + return $dpCount > 0 ? (string) $dpCount : null; + } + + public static function getNavigationBadgeColor(): ?string + { + // Hitung jumlah reservasi dengan tipe pembayaran 'dp' + $dpCount = static::getModel()::where('tipe_pembayaran', 'dp')->count(); + + // Kembalikan warna merah jika ada reservasi DP + return $dpCount > 0 ? 'danger' : null; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListReservasiis::route('/'), + 'create' => Pages\CreateReservasii::route('/create'), + 'edit' => Pages\EditReservasii::route('/{record}/edit'), + 'view' => Pages\ViewReservasii::route('/{record}'), + ]; + } +} diff --git a/app/Filament/Resources/ReservasiiResource/Pages/CreateReservasii.php b/app/Filament/Resources/ReservasiiResource/Pages/CreateReservasii.php new file mode 100644 index 0000000..1a35e33 --- /dev/null +++ b/app/Filament/Resources/ReservasiiResource/Pages/CreateReservasii.php @@ -0,0 +1,12 @@ +whereDate('tanggal', Carbon::today()) + ->sum('total'); + return [ + Stat::make('Reservasi Hari Ini', Reservasii::query()->whereDate('tanggal', Carbon::today())->count()), + Stat::make('Pendapatan Hari Ini', 'Rp ' . number_format($todayEarnings, 0, ',', '.')) + + ]; + } +} diff --git a/app/Filament/Resources/UserResource.php b/app/Filament/Resources/UserResource.php new file mode 100644 index 0000000..cc7f7e2 --- /dev/null +++ b/app/Filament/Resources/UserResource.php @@ -0,0 +1,102 @@ +schema([ + TextInput::make('name') + ->label('Nama') + ->required(), + TextInput::make('email') + ->required() + ->unique(ignoreRecord: true) + ->maxLength(255), + DateTimePicker::make('eemail_verified_at') + ->label('Email Veririfikasi') + ->default(now()), + TextInput::make('password') + ->password() + ->dehydrated(fn ($state) => filled($state)) + ->required(fn ($livewire): bool => $livewire instanceof CreateRecord) + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + TextColumn::make('name') + ->label('Nama') + ->searchable(), + TextColumn::make('email') + ->label('Email'), + TextColumn::make('email_verified_at') + ->label('Email Verifikasi') + ->dateTime() + ->sortable(), + TextColumn::make('created_at') + ->dateTime() + ->sortable() + ]) + ->filters([ + // + ]) + ->actions([ + ActionGroup::make([ + ViewAction::make(), + EditAction::make(), + DeleteAction::make() + ]) + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getRelations(): array + { + return [ + ReservasiiRelationManager::class + ]; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListUsers::route('/'), + 'create' => Pages\CreateUser::route('/create'), + 'edit' => Pages\EditUser::route('/{record}/edit'), + ]; + } +} diff --git a/app/Filament/Resources/UserResource/Pages/CreateUser.php b/app/Filament/Resources/UserResource/Pages/CreateUser.php new file mode 100644 index 0000000..73aa46d --- /dev/null +++ b/app/Filament/Resources/UserResource/Pages/CreateUser.php @@ -0,0 +1,12 @@ +schema([ + // + ]); + } + + public function table(Table $table): Table + { + return $table + ->recordTitleAttribute('id') + ->columns([ + TextColumn::make('id') + ->label('ID Reservasi') + ->searchable(), + TextColumn::make('tanggal') + ->label('Tanggal') + ->sortable(), + TextColumn::make('waktu') + ->label('Jam'), + TextColumn::make('tipe_pembayaran') + ->label('Tipe Pembayaran') + ->badge() + ->color(fn (string $state): String => match ($state){ + 'full' => 'succes', + 'DP' => 'danger' + }), + TextColumn::make('metode_pembayaran') + ->label('Metode Pembayaran') + ->badge(), + TextColumn::make('created_at') + ->label('Waktu Reservasi') + ]) + ->filters([ + // + ]) + ->headerActions([ + ]) + ->actions([ + Action::make('Lihat Reservasi') + ->url(fn (Reservasii $record):string => ReservasiiResource::getUrl('view', ['record' => $record])) + ->color('info') + ->icon('heroicon-o-eye'), + Tables\Actions\DeleteAction::make(), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } +} diff --git a/app/Filament/Widgets/CalendarWidget.php b/app/Filament/Widgets/CalendarWidget.php new file mode 100644 index 0000000..61c7efb --- /dev/null +++ b/app/Filament/Widgets/CalendarWidget.php @@ -0,0 +1,33 @@ +select('tanggal', 'waktu') + ->get() + ->groupBy(function($item) { + return Carbon::parse($item->tanggal)->format('Y-m-d'); + }) + ->map(function ($items) { + return $items->pluck('waktu')->toArray(); + }); + + return $data; + } +} diff --git a/app/Filament/Widgets/ReservasiTerbaru.php b/app/Filament/Widgets/ReservasiTerbaru.php new file mode 100644 index 0000000..27fea0b --- /dev/null +++ b/app/Filament/Widgets/ReservasiTerbaru.php @@ -0,0 +1,55 @@ +query(ReservasiiResource::getEloquentQuery()) + ->defaultPaginationPageOption(5) + ->defaultSort('created_at', 'desc') + ->columns([ + TextColumn::make('id') + ->label('ID Reservasi') + ->searchable(), + TextColumn::make('user.name') + ->label('Nama') + ->searchable(), + TextColumn::make('tanggal') + ->label('Tanggal') + ->sortable(), + TextColumn::make('waktu') + ->label('Jam'), + TextColumn::make('tipe_pembayaran') + ->label('Tipe Pembayaran') + ->badge() + ->color(fn (string $state): String => match ($state){ + 'full' => 'succes', + 'DP' => 'danger' + }), + TextColumn::make('metode_pembayaran') + ->label('Metode Pembayaran') + ->badge(), + TextColumn::make('created_at') + ->label('Waktu Reservasi') + ]) + ->actions([ + Action::make('Lihat Reservasi') + ->url(fn (Reservasii $record): string => ReservasiiResource::getUrl('view', ['record' => $record])) + ->icon('heroicon-m-eye') + ]); + + } +} diff --git a/app/Helpers/CartManagement.php b/app/Helpers/CartManagement.php new file mode 100644 index 0000000..1149e11 --- /dev/null +++ b/app/Helpers/CartManagement.php @@ -0,0 +1,111 @@ + $item){ + if ($item['paketfoto_id'] == $paketfoto_id) { + $existing_item = $key; + break; + } + } + + if ($existing_item !== null) { + $cart_items[$existing_item]['jumlah']++; + $cart_items[$existing_item]['total_harga'] = $cart_items[$existing_item]['jumlah'] * + $cart_items[$existing_item]['harga']; + } else { + $paketfoto = PaketFoto::where('id', $paketfoto_id)->first(); + if($paketfoto){ + $cart_items[] = [ + 'paketfoto_id' => $paketfoto_id, + 'nama' => $paketfoto->nama_paket_foto, + 'gambar' => $paketfoto->gambar, + 'jumlah' => 1, + 'harga' => $paketfoto->harga_paket_foto, + 'total_harga' => $paketfoto->harga_paket_foto + ]; + } + } + self::addCartItemsToCookie($cart_items); + return count($cart_items); + } + + // remove item to cart + static public function removeCartItem($paketfoto_id){ + $cart_items = self::getCartItemsFromCookie(); + + foreach ($cart_items as $key => $item) { + if ($item['paketfoto_id'] == $paketfoto_id) { + unset($cart_items[$key]); + } + } + + self::addCartItemsToCookie($cart_items); + return $cart_items; + } + + // add cart items to cookie + static public function addCartItemsToCookie($cart_items){ + Cookie::queue('cart_items', json_encode($cart_items), 60*24*30); + } + + // clear cart items from cookie + static public function clearCartItems(){ + Cookie::queue(Cookie::forget('cart_items')); + } + + // get all cart items from cookie + static public function getCartItemsFromCookie() { + $cart_items = json_decode(Cookie::get('cart_items'), true); + if (!$cart_items) { + $cart_items = []; + } + return $cart_items; + } + + // increment item quantity + static public function incrementQuantityCartItems($paketfoto_id) { + $cart_items = self::getCartItemsFromCookie(); + + foreach($cart_items as $key => $item) { + if ($item ['paketfoto_id'] == $paketfoto_id){ + $cart_items[$key]['jumlah']++; + $cart_items[$key]['total_harga'] = $cart_items[$key]['jumlah'] * $cart_items[$key]['harga']; + } + } + self::addCartItemsToCookie($cart_items); + return $cart_items; + } + + // decrement item quantity + static public function decrementQuantityCartItems($paketfoto_id) { + $cart_items = self::getCartItemsFromCookie(); + foreach ($cart_items as $key => $item) { + if ($item['paketfoto_id'] == $paketfoto_id) { + if ($cart_items[$key]['jumlah'] > 1) { + $cart_items[$key]['jumlah']--; + $cart_items[$key]['total_harga'] = $cart_items[$key]['jumlah'] * $cart_items[$key]['harga']; + } + } + self::addCartItemsToCookie($cart_items); + return $cart_items; + } + } + + // calculate grand total + static public function calculateGrandTotal($items){ + return array_sum(array_column($items, 'total_harga')); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php new file mode 100644 index 0000000..8677cd5 --- /dev/null +++ b/app/Http/Controllers/Controller.php @@ -0,0 +1,8 @@ +validate([ + 'email' => 'required|email|exists:users,email|max:255' + ]); + + $status = Password::sendResetLink(['email' => $this->email]); + + if ($status == Password::RESET_LINK_SENT){ + session()->flash('success', 'Password reset link terkirim'); + $this->email = ''; + } else { + session()->flash('error', 'Gagal mengirim link reset password'); + } + } + public function render() + { + return view('livewire.auth.forgot-password-page'); + } +} diff --git a/app/Livewire/Auth/LoginPage.php b/app/Livewire/Auth/LoginPage.php new file mode 100644 index 0000000..98d2709 --- /dev/null +++ b/app/Livewire/Auth/LoginPage.php @@ -0,0 +1,31 @@ +validate([ + 'email' => 'required|email|max:255|exists:users,email', + 'password' => 'required|min:6|max:255', + ]); + + if (!auth()->attempt(['email'=>$this->email, 'password'=>$this->password])) { + session()->flash('error', 'Invalid credentials'); + return; + } + + return redirect()->intended(); + } + public function render() + { + return view('livewire.auth.login-page'); + } +} diff --git a/app/Livewire/Auth/RegisterPage.php b/app/Livewire/Auth/RegisterPage.php new file mode 100644 index 0000000..5af52d8 --- /dev/null +++ b/app/Livewire/Auth/RegisterPage.php @@ -0,0 +1,43 @@ +validate([ + 'name' => 'required|max:255', + 'email' => 'required|email|unique:users|max:255', + 'password' => 'required|min:6|max:255' + ]); + + // save to database + $user = User::create([ + 'name' => $this->name, + 'email' => $this->email, + 'password' => Hash::make($this->password) + ]); + + // login user + auth()->login($user); + + // redirect to home page + return redirect()->intended(); + + } + public function render() + { + return view('livewire.auth.register-page'); + } +} diff --git a/app/Livewire/Auth/ResetPasswordPage.php b/app/Livewire/Auth/ResetPasswordPage.php new file mode 100644 index 0000000..5866742 --- /dev/null +++ b/app/Livewire/Auth/ResetPasswordPage.php @@ -0,0 +1,13 @@ +paketfoto = PaketFoto::findOrFail($id); + } else { + $this->paketfoto = PaketFoto::first(); + } + + // Set tanggal default ke hari ini + $this->tanggal = now()->format('Y-m-d'); + $this->updateUnavailableTimes(); + } + + public function updatedTanggal() + { + $this->waktu = ''; // Reset waktu yang dipilih + $this->updateUnavailableTimes(); + } + + public function updateUnavailableTimes() + { + if ($this->tanggal) { + // Ambil waktu yang sudah dipesan dari database untuk tanggal yang dipilih + // dan paket foto yang sama + $this->bookedTimes = Reservasii::where('tanggal', $this->tanggal) + ->whereHas('detail', function($query) { + $query->where('paket_foto_id', $this->paketfoto->id); + }) + ->pluck('waktu') + ->map(function($time) { + return $time->format('H:i'); + }) + ->toArray(); + + // Daftar semua waktu yang tersedia dari jam 8 pagi sampai 8 malam + $allTimes = collect(range(8, 20))->map(function($hour) { + return str_pad($hour, 2, '0', STR_PAD_LEFT) . ':00'; + })->toArray(); + + // Jika hari ini, tambahkan waktu yang sudah lewat + if ($this->tanggal == now()->format('Y-m-d')) { + $currentTime = now()->format('H:i'); + $pastTimes = array_filter($allTimes, function($time) use ($currentTime) { + return $time <= $currentTime; + }); + $this->unavailableTimes = array_merge($this->bookedTimes, $pastTimes); + } else { + $this->unavailableTimes = $this->bookedTimes; + } + } + } + + public function getUnavailableTimesProperty() + { + return $this->unavailableTimes; + } + + public function getBookedTimesProperty() + { + return $this->bookedTimes; + } + + public function placeOrder() + { + $this->validate([ + 'nama' => 'required|min:3', + 'tanggal' => 'required|date|after_or_equal:today', + 'waktu' => 'required', + 'warna' => 'required', + 'promo' => '', + 'tipe_pembayaran' => 'required', + ], [ + 'nama.required' => 'Nama lengkap harus diisi', + 'nama.min' => 'Nama lengkap minimal 3 karakter', + 'tanggal.required' => 'Tanggal booking harus diisi', + 'tanggal.after_or_equal' => 'Tanggal booking tidak boleh sebelum hari ini', + 'waktu.required' => 'Waktu booking harus dipilih', + 'warna.required' => 'Background harus dipilih', + 'tipe_pembayaran.required' => 'Tipe pembayaran harus dipilih', + ]); + + // Validasi waktu yang dipilih + if (in_array($this->waktu, $this->unavailableTimes)) { + $this->addError('waktu', 'Waktu yang dipilih tidak tersedia'); + return; + } + + // Membuat reservasi baru + $reservasi = Reservasii::create([ + 'user_id' => auth()->id(), + 'tanggal' => $this->tanggal, + 'waktu' => $this->waktu, + 'promo_id' => null, // Logika promo bisa ditambahkan di sini + 'total' => $this->paketfoto->harga_paket_foto, + 'tipe_pembayaran' => $this->tipe_pembayaran, + 'metode_pembayaran' => 'transfer', // Default transfer, bisa diubah sesuai pilihan + ]); + + // Membuat detail reservasi + $reservasi->detail()->create([ + 'paket_foto_id' => $this->paketfoto->id, + 'warna' => $this->warna, + 'jumlah' => 1, + 'harga' => $this->paketfoto->harga_paket_foto, + 'total_harga' => $this->paketfoto->harga_paket_foto, + ]); + + // Tampilkan pesan sukses dan redirect + session()->flash('message', 'Booking berhasil dibuat! Silahkan lakukan pembayaran sesuai metode yang dipilih.'); + return redirect()->route('booking.success'); + } + + public function render() + { + // Update unavailable times setiap kali halaman di-render + $this->updateUnavailableTimes(); + return view('livewire.booking-page'); + } +} diff --git a/app/Livewire/CancelPage.php b/app/Livewire/CancelPage.php new file mode 100644 index 0000000..380f8f1 --- /dev/null +++ b/app/Livewire/CancelPage.php @@ -0,0 +1,13 @@ +nama_paket_foto = $nama_paket_foto; + } + + public function addToCart($paketfoto_id) { + $total_count = CartManagement::addItemToCart($paketfoto_id); + $this->dispatch('update-cart-count', total_count: $total_count)->to(Navbar::class); + } + + public function render() + { + return view('livewire.detail-paket-foto-page', [ + 'paketfoto' => PaketFoto::where('nama_paket_foto', $this->nama_paket_foto)->firstOrFail(), + ]); + } +} diff --git a/app/Livewire/Histori.php b/app/Livewire/Histori.php new file mode 100644 index 0000000..75a01ab --- /dev/null +++ b/app/Livewire/Histori.php @@ -0,0 +1,13 @@ +get(); + return view('livewire.home-page', [ + 'paketfoto' => $paketfoto + ]); + } +} + \ No newline at end of file diff --git a/app/Livewire/PaketFotoPage.php b/app/Livewire/PaketFotoPage.php new file mode 100644 index 0000000..d06c285 --- /dev/null +++ b/app/Livewire/PaketFotoPage.php @@ -0,0 +1,44 @@ +dispatch('update-cart-count', total_count: $total_count)->to(Navbar::class); + //} + + public function render() + { + $paketfotoQuery = PaketFoto::query()->where('status', 1); + + if($this->sort == 'latest') { + $paketfotoQuery->latest(); + } + + if($this->sort == 'price') { + $paketfotoQuery->orderBy('harga_paket_foto'); + } + + return view('livewire.paket-foto-page', [ + 'paketfoto' => $paketfotoQuery->paginate(6), + ]); + } +} diff --git a/app/Livewire/Partials/Footer.php b/app/Livewire/Partials/Footer.php new file mode 100644 index 0000000..2f9eaeb --- /dev/null +++ b/app/Livewire/Partials/Footer.php @@ -0,0 +1,13 @@ +total_count = count(CartManagement::getCartItemsFromCookie()); + } + + #[On('update-cart-count')] + public function updateCartCount($total_count) { + $this->total_count = $total_count; + } + public function render() + { + return view('livewire.partials.navbar'); + } +} diff --git a/app/Livewire/SuccesPage.php b/app/Livewire/SuccesPage.php new file mode 100644 index 0000000..b774779 --- /dev/null +++ b/app/Livewire/SuccesPage.php @@ -0,0 +1,13 @@ + 'boolean', + ]; +} diff --git a/app/Models/ReservasiDetail.php b/app/Models/ReservasiDetail.php new file mode 100644 index 0000000..a887dd7 --- /dev/null +++ b/app/Models/ReservasiDetail.php @@ -0,0 +1,32 @@ +belongsTo(Reservasii::class, 'reservasii_id'); + } + + public function paketFoto() + { + return $this->belongsTo(PaketFoto::class, 'paket_foto_id'); + } +} diff --git a/app/Models/Reservasii.php b/app/Models/Reservasii.php new file mode 100644 index 0000000..29311b3 --- /dev/null +++ b/app/Models/Reservasii.php @@ -0,0 +1,46 @@ + 'date', + 'waktu' => 'datetime', + 'total' => 'decimal:2' + ]; + + public function user() + { + return $this->belongsTo(User::class); + } + public function detail() + { + return $this->hasMany(ReservasiDetail::class); + } + public function promo() + { + return $this->belongsTo(Promo::class); + } + public function paketFoto() + { + return $this->belongsTo(PaketFoto::class); + } +} + + diff --git a/app/Models/User.php b/app/Models/User.php new file mode 100644 index 0000000..25b984e --- /dev/null +++ b/app/Models/User.php @@ -0,0 +1,57 @@ + */ + use HasFactory, Notifiable; + + /** + * The attributes that are mass assignable. + * + * @var list1?u.getGridIndex():u.getColIndex();e.dispatch("MOVE_ITEM",{query:o,index:f});let g=a.getIndex();if(g===void 0||g!==f){if(a.setIndex(f),g===void 0)return;e.dispatch("DID_REORDER_ITEMS",{items:e.query("GET_ACTIVE_ITEMS"),origin:r,target:f})}},Ic=ge({DID_ADD_ITEM:gc,DID_REMOVE_ITEM:Ec,DID_DRAG_ITEM:Tc}),vc=({root:e,props:t,actions:i,shouldOptimize:a})=>{Ic({root:e,props:t,actions:i});let{dragCoordinates:n}=t,o=e.rect.element.width,l=e.childViews.filter(T=>T.rect.element.height),r=e.query("GET_ACTIVE_ITEMS").map(T=>l.find(v=>v.id===T.id)).filter(T=>T),s=n?Ji(e,r,n):null,p=e.ref.addIndex||null;e.ref.addIndex=null;let c=0,d=0,m=0;if(r.length===0)return;let u=r[0].rect.element,f=u.marginTop+u.marginBottom,g=u.marginLeft+u.marginRight,h=u.width+g,I=u.height+f,E=Ki(o,h);if(E===1){let T=0,v=0;r.forEach((y,b)=>{if(s){let _=b-s;_===-2?v=-f*.25:_===-1?v=-f*.75:_===0?v=f*.75:_===1?v=f*.25:v=0}a&&(y.translateX=null,y.translateY=null),y.markedForRemoval||ln(y,0,T+v);let x=(y.rect.element.height+f)*(y.markedForRemoval?y.opacity:1);T+=x})}else{let T=0,v=0;r.forEach((y,b)=>{b===s&&(c=1),b===p&&(m+=1),y.markedForRemoval&&y.opacity<.5&&(d-=1);let w=b+m+c+d,x=w%E,_=Math.floor(w/E),P=x*h,O=_*I,M=Math.sign(P-T),N=Math.sign(O-v);T=P,v=O,!y.markedForRemoval&&(a&&(y.translateX=null,y.translateY=null),ln(y,P,O,M,N))})}},xc=(e,t)=>t.filter(i=>i.data&&i.data.id?e.id===i.data.id:!0),yc=ne({create:fc,write:vc,tag:"ul",name:"list",didWriteView:({root:e})=>{e.childViews.filter(t=>t.markedForRemoval&&t.opacity===0&&t.resting).forEach(t=>{t._destroy(),e.removeChildView(t)})},filterFrameActionsForChild:xc,mixins:{apis:["dragCoordinates"]}}),_c=({root:e,props:t})=>{e.ref.list=e.appendChildView(e.createChildView(yc)),t.dragCoordinates=null,t.overflowing=!1},Rc=({root:e,props:t,action:i})=>{e.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(t.dragCoordinates={left:i.position.scopeLeft-e.ref.list.rect.element.left,top:i.position.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},wc=({props:e})=>{e.dragCoordinates=null},Sc=ge({DID_DRAG:Rc,DID_END_DRAG:wc}),Lc=({root:e,props:t,actions:i})=>{if(Sc({root:e,props:t,actions:i}),e.ref.list.dragCoordinates=t.dragCoordinates,t.overflowing&&!t.overflow&&(t.overflowing=!1,e.element.dataset.state="",e.height=null),t.overflow){let a=Math.round(t.overflow);a!==e.height&&(t.overflowing=!0,e.element.dataset.state="overflow",e.height=a)}},Ac=ne({create:_c,write:Lc,name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),Oe=(e,t,i,a="")=>{i?se(e,t,a):e.removeAttribute(t)},Mc=e=>{if(!(!e||e.value==="")){try{e.value=""}catch{}if(e.value){let t=ke("form"),i=e.parentNode,a=e.nextSibling;t.appendChild(e),t.reset(),a?i.insertBefore(e,a):i.appendChild(e)}}},Oc=({root:e,props:t})=>{e.element.id=`filepond--browser-${t.id}`,se(e.element,"name",e.query("GET_NAME")),se(e.element,"aria-controls",`filepond--assistant-${t.id}`),se(e.element,"aria-labelledby",`filepond--drop-label-${t.id}`),Gn({root:e,action:{value:e.query("GET_ACCEPTED_FILE_TYPES")}}),Un({root:e,action:{value:e.query("GET_ALLOW_MULTIPLE")}}),Wn({root:e,action:{value:e.query("GET_ALLOW_DIRECTORIES_ONLY")}}),ki({root:e}),Hn({root:e,action:{value:e.query("GET_REQUIRED")}}),jn({root:e,action:{value:e.query("GET_CAPTURE_METHOD")}}),e.ref.handleChange=i=>{if(!e.element.value)return;let a=Array.from(e.element.files).map(n=>(n._relativePath=n.webkitRelativePath,n));setTimeout(()=>{t.onload(a),Mc(e.element)},250)},e.element.addEventListener("change",e.ref.handleChange)},Gn=({root:e,action:t})=>{e.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&Oe(e.element,"accept",!!t.value,t.value?t.value.join(","):"")},Un=({root:e,action:t})=>{Oe(e.element,"multiple",t.value)},Wn=({root:e,action:t})=>{Oe(e.element,"webkitdirectory",t.value)},ki=({root:e})=>{let t=e.query("GET_DISABLED"),i=e.query("GET_ALLOW_BROWSE"),a=t||!i;Oe(e.element,"disabled",a)},Hn=({root:e,action:t})=>{t.value?e.query("GET_TOTAL_ITEMS")===0&&Oe(e.element,"required",!0):Oe(e.element,"required",!1)},jn=({root:e,action:t})=>{Oe(e.element,"capture",!!t.value,t.value===!0?"":t.value)},rn=({root:e})=>{let{element:t}=e;if(e.query("GET_TOTAL_ITEMS")>0){Oe(t,"required",!1),Oe(t,"name",!1);let i=e.query("GET_ACTIVE_ITEMS"),a=!1;for(let n=0;n