diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6549c6a Binary files /dev/null and b/.DS_Store differ diff --git a/.env.example b/.env.example index 36f580b..b5f72bf 100644 --- a/.env.example +++ b/.env.example @@ -5,9 +5,9 @@ APP_DEBUG=true APP_TIMEZONE=Asia/Taipei APP_URL=https://shop_12_wireui.test -APP_LOCALE=zh-TW -APP_FALLBACK_LOCALE=zh-TW -APP_FAKER_LOCALE=zh-TW +APP_LOCALE=zh-tw +APP_FALLBACK_LOCALE=zh-tw +APP_FAKER_LOCALE=zh_TW APP_MAINTENANCE_DRIVER=file # APP_MAINTENANCE_STORE=database diff --git a/app/Livewire/Admin/Dashboard.php b/app/Livewire/Admin/Dashboard.php index 5ac40e0..6f0b3bf 100644 --- a/app/Livewire/Admin/Dashboard.php +++ b/app/Livewire/Admin/Dashboard.php @@ -11,6 +11,6 @@ class Dashboard extends Component { $user = Auth::user(); - return view('livewire.admin.dashboard', compact('user'))->layout('layouts.admin'); + return view('livewire.admin.dashboard', compact('user')); } } diff --git a/bootstrap/app.php b/bootstrap/app.php index 7b162da..4455074 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -11,7 +11,11 @@ return Application::configure(basePath: dirname(__DIR__)) health: '/up', ) ->withMiddleware(function (Middleware $middleware) { - // + $middleware->alias([ + 'role' => \Spatie\Permission\Middleware\RoleMiddleware::class, + 'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class, + 'role_or_permission' => \Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class + ]); }) ->withExceptions(function (Exceptions $exceptions) { // diff --git a/composer.json b/composer.json index 694d0d8..462fb43 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "livewire/volt": "^1.7.0", "power-components/livewire-powergrid": "^6.3", "spatie/laravel-permission": "^6.17", + "wire-elements/modal": "^2.0", "wireui/wireui": "^2.4" }, "require-dev": { diff --git a/composer.lock b/composer.lock index db41121..d5d3c9c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7fca47874b86a18c0949dbf10c0850ec", + "content-hash": "5cb061b154b96e6a66433533af5de696", "packages": [ { "name": "brick/math", @@ -3512,6 +3512,67 @@ ], "time": "2024-04-27T21:32:50+00:00" }, + { + "name": "spatie/laravel-package-tools", + "version": "1.92.4", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-package-tools.git", + "reference": "d20b1969f836d210459b78683d85c9cd5c5f508c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/d20b1969f836d210459b78683d85c9cd5c5f508c", + "reference": "d20b1969f836d210459b78683d85c9cd5c5f508c", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^9.28|^10.0|^11.0|^12.0", + "php": "^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.5", + "orchestra/testbench": "^7.7|^8.0|^9.0|^10.0", + "pestphp/pest": "^1.23|^2.1|^3.1", + "phpunit/php-code-coverage": "^9.0|^10.0|^11.0", + "phpunit/phpunit": "^9.5.24|^10.5|^11.5", + "spatie/pest-plugin-test-time": "^1.1|^2.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\LaravelPackageTools\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "Tools for creating Laravel packages", + "homepage": "https://github.com/spatie/laravel-package-tools", + "keywords": [ + "laravel-package-tools", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-package-tools/issues", + "source": "https://github.com/spatie/laravel-package-tools/tree/1.92.4" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2025-04-11T15:27:14+00:00" + }, { "name": "spatie/laravel-permission", "version": "6.17.0", @@ -6094,6 +6155,70 @@ }, "time": "2022-06-03T18:03:27+00:00" }, + { + "name": "wire-elements/modal", + "version": "2.0.13", + "source": { + "type": "git", + "url": "https://github.com/wire-elements/modal.git", + "reference": "65d9db80a0befaa38ae99a47a26818e784aa7101" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wire-elements/modal/zipball/65d9db80a0befaa38ae99a47a26818e784aa7101", + "reference": "65d9db80a0befaa38ae99a47a26818e784aa7101", + "shasum": "" + }, + "require": { + "livewire/livewire": "^3.2.3", + "php": "^8.1", + "spatie/laravel-package-tools": "^1.9" + }, + "require-dev": { + "orchestra/testbench": "^8.5", + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LivewireUI\\Modal\\LivewireModalServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LivewireUI\\Modal\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Philo Hermans", + "email": "me@philohermans.com" + } + ], + "description": "Laravel Livewire modal component", + "keywords": [ + "laravel", + "livewire", + "modal" + ], + "support": { + "issues": "https://github.com/wire-elements/modal/issues", + "source": "https://github.com/wire-elements/modal/tree/2.0.13" + }, + "funding": [ + { + "url": "https://github.com/PhiloNL", + "type": "github" + } + ], + "time": "2025-02-20T13:07:12+00:00" + }, { "name": "wireui/heroicons", "version": "v2.9.0", diff --git a/config/livewire-powergrid.php b/config/livewire-powergrid.php index a318359..9d09d16 100644 --- a/config/livewire-powergrid.php +++ b/config/livewire-powergrid.php @@ -24,6 +24,8 @@ return [ // 'default' => 'resources/views/components/icons', // 'outline' => 'vendor/wireui/wireui/resources/views/components/icons/outline', // 'solid' => 'vendor/wireui/wireui/resources/views/components/icons/solid', + 'outline' => 'vendor/wireui/heroicons/src/views/components/outline', + 'solid' => 'vendor/wireui/heroicons/src/views/components/solid', ], 'allowed' => [ @@ -48,9 +50,9 @@ return [ */ 'flatpickr' => [ 'locales' => [ - 'pt_BR' => [ - 'locale' => 'pt', - 'dateFormat' => 'd/m/Y H:i', + 'zh_tw' => [ + 'locale' => 'zh_tw', + 'dateFormat' => 'Y-m-d H:i', 'enableTime' => true, 'time_24hr' => true, ], diff --git a/package-lock.json b/package-lock.json index 017055c..9fc056a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,9 @@ "requires": true, "packages": { "": { + "dependencies": { + "flatpickr": "^4.6.13" + }, "devDependencies": { "@tailwindcss/forms": "^0.5.2", "@tailwindcss/vite": "^4.0.0", @@ -1872,6 +1875,12 @@ "node": ">=8" } }, + "node_modules/flatpickr": { + "version": "4.6.13", + "resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.13.tgz", + "integrity": "sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw==", + "license": "MIT" + }, "node_modules/follow-redirects": { "version": "1.15.9", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", diff --git a/package.json b/package.json index 1506f66..e0e514e 100644 --- a/package.json +++ b/package.json @@ -15,5 +15,8 @@ "postcss": "^8.4.31", "tailwindcss": "^3.1.0", "vite": "^6.2.4" + }, + "dependencies": { + "flatpickr": "^4.6.13" } } diff --git a/resources/css/app.css b/resources/css/app.css index 5d33b9e..aef7fd4 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,5 +1,6 @@ /* 引入 PowerGrid 的樣式 */ @import './../../vendor/power-components/livewire-powergrid/dist/tailwind.css'; +@import "flatpickr/dist/flatpickr.min.css"; @tailwind base; @tailwind components; diff --git a/resources/js/app.js b/resources/js/app.js index e569f37..371364d 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,2 +1,7 @@ import './bootstrap'; -import './../../vendor/power-components/livewire-powergrid/dist/powergrid'; \ No newline at end of file +import './../../vendor/power-components/livewire-powergrid/dist/powergrid'; +import flatpickr from "flatpickr"; +import 'flatpickr/dist/flatpickr.min.css'; +import { Mandarin } from 'flatpickr/dist/l10n/zh.js'; + +flatpickr.localize(Mandarin); \ No newline at end of file diff --git a/resources/lang/en/datatable.php b/resources/lang/vendor/livewire-powergrid/en/datatable.php similarity index 100% rename from resources/lang/en/datatable.php rename to resources/lang/vendor/livewire-powergrid/en/datatable.php diff --git a/resources/lang/vendor/livewire-powergrid/zh-tw/datatable.php b/resources/lang/vendor/livewire-powergrid/zh-tw/datatable.php new file mode 100644 index 0000000..004e846 --- /dev/null +++ b/resources/lang/vendor/livewire-powergrid/zh-tw/datatable.php @@ -0,0 +1,75 @@ + [ + 'filter' => '篩選', + 'clear_all_filters' => '清除全部', + ], + 'labels' => [ + 'action' => '操作', + 'results_per_page' => '每頁記錄數', + 'clear_filter' => '清除篩選', + 'no_data' => '未找到任何記錄', + 'all' => '全部', + 'selected' => '選定', + 'filtered' => '已過濾', + ], + 'placeholders' => [ + 'search' => '搜尋...', + 'select' => '選擇時段', + ], + 'pagination' => [ + 'showing' => 'Showing', + 'to' => 'to', + 'of' => 'of', + 'results' => 'Results', + 'all' => '全部', + ], + 'multi_select' => [ + 'select' => 'Select', + 'all' => '全部', + ], + 'select' => [ + 'select' => 'Select', + 'all' => '全部', + ], + 'boolean_filter' => [ + 'all' => '全部', + ], + 'input_text_options' => [ + 'is' => 'Is', + 'is_not' => 'Is not', + 'contains' => 'Contains', + 'contains_not' => 'Does not contain', + 'starts_with' => 'Starts with', + 'ends_with' => 'Ends with', + 'is_empty' => 'Is empty', + 'is_not_empty' => 'Is not empty', + 'is_null' => 'Is null', + 'is_not_null' => 'Is not null', + 'is_blank' => 'Is blank', + 'is_not_blank' => 'Is not blank', + ], + 'export' => [ + 'exporting' => 'Please wait!', + 'completed' => 'Export completed! Your files are ready for download', + ], + 'soft_deletes' => [ + 'message_with_trashed' => 'Displaying all records, including deleted ones.', + 'message_only_trashed' => 'Displaying only deleted records.', + 'without_trashed' => 'Without deleted', + 'with_trashed' => 'With deleted', + 'only_trashed' => 'Only deleted', + ], + 'multi_sort' => [ + 'message' => 'Multiple sort is active', + ], + 'buttons_macros' => [ + 'confirm' => [ + 'message' => 'Are you sure you want to perform this action?', + ], + 'confirm_prompt' => [ + 'message' => "Are you sure you want to perform this action? \n\n Enter :confirmValue to confirm.", + ], + ], +]; diff --git a/resources/views/components/.DS_Store b/resources/views/components/.DS_Store new file mode 100644 index 0000000..a8ad673 Binary files /dev/null and b/resources/views/components/.DS_Store differ diff --git a/resources/views/components/layouts/.DS_Store b/resources/views/components/layouts/.DS_Store new file mode 100644 index 0000000..9796b12 Binary files /dev/null and b/resources/views/components/layouts/.DS_Store differ diff --git a/resources/views/layouts/admin.blade.php b/resources/views/components/layouts/admin.blade.php similarity index 63% rename from resources/views/layouts/admin.blade.php rename to resources/views/components/layouts/admin.blade.php index ef74e1d..c543901 100644 --- a/resources/views/layouts/admin.blade.php +++ b/resources/views/components/layouts/admin.blade.php @@ -16,29 +16,35 @@ @livewireStyles @wireUiScripts -
- @auth -