diff --git a/app/Http/Middleware/Admin/AdminMiddleware.php b/app/Http/Middleware/Admin/AdminMiddleware.php index 85b7581..90f049d 100644 --- a/app/Http/Middleware/Admin/AdminMiddleware.php +++ b/app/Http/Middleware/Admin/AdminMiddleware.php @@ -15,6 +15,6 @@ class AdminMiddleware if (Auth::check() && Auth::user()->role == config('constants.ROLE_ADMIN') && Auth::user()->status == config('constants.STATUS_ACTIVE')) { return $next($request); } - return redirect()->route('login'); + abort(404); } } diff --git a/package-lock.json b/package-lock.json index c8659ae..6d82e3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,8 @@ "": { "dependencies": { "@fontsource/roboto": "^5.2.10", - "puppeteer": "^25.2.1" + "puppeteer": "^25.2.1", + "tom-select": "^2.2.2" }, "devDependencies": { "@tailwindcss/vite": "^4.0.0", @@ -518,6 +519,21 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@orchidjs/sifter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@orchidjs/sifter/-/sifter-1.1.0.tgz", + "integrity": "sha512-mYwHCfr736cIWWdhhSZvDbf90AKt2xyrJspKFC3qyIJG1LtrJeJunYEqCGG4Aq2ijENbc4WkOjszcvNaIAS/pQ==", + "license": "Apache-2.0", + "dependencies": { + "@orchidjs/unicode-variants": "^1.1.2" + } + }, + "node_modules/@orchidjs/unicode-variants": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@orchidjs/unicode-variants/-/unicode-variants-1.1.2.tgz", + "integrity": "sha512-5DobW1CHgnBROOEpFlEXytED5OosEWESFvg/VYmH0143oXcijYTprRYJTs+55HzGM4IqxiLFSuqEzu9mPNwVsA==", + "license": "Apache-2.0" + }, "node_modules/@puppeteer/browsers": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-3.0.5.tgz", @@ -2553,6 +2569,23 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tom-select": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tom-select/-/tom-select-2.6.2.tgz", + "integrity": "sha512-eiXIkk82XzzUTOVQDFpy+ZGejuqdTvMukyUyeZBQaKnqW42UoTiTZnrod/eX0rkqJEc4rZY9DZ3zdjV07i29wQ==", + "license": "Apache-2.0", + "dependencies": { + "@orchidjs/sifter": "^1.1.0", + "@orchidjs/unicode-variants": "^1.1.2" + }, + "engines": { + "node": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tom-select" + } + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", diff --git a/package.json b/package.json index 64a26c6..128c032 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@fontsource/roboto": "^5.2.10", - "puppeteer": "^25.2.1" + "puppeteer": "^25.2.1", + "tom-select": "^2.2.2" } } diff --git a/public/fonts/Caveat-700.woff b/public/fonts/Caveat-700.woff new file mode 100644 index 0000000..3228e9c Binary files /dev/null and b/public/fonts/Caveat-700.woff differ diff --git a/public/fonts/Caveat-700.woff2 b/public/fonts/Caveat-700.woff2 new file mode 100644 index 0000000..3228e9c Binary files /dev/null and b/public/fonts/Caveat-700.woff2 differ diff --git a/resources/css/app.css b/resources/css/app.css index 9b2e200..65f4285 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,9 +1,3 @@ -@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&display=swap'); - -@font-face { - font-family: 'SVN-Poppins-Regular'; - src: url('/fonts/FZ Poppins-Regular.ttf') format('truetype'); - font-weight: 400; font-style: normal; } @@ -54,6 +48,7 @@ @import "@fontsource/roboto/500.css"; @import "@fontsource/roboto/700.css"; @import 'tailwindcss'; +@import 'tom-select/dist/css/tom-select.css'; @source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php'; @source '../../storage/framework/views/*.php'; diff --git a/resources/css/fonts.css b/resources/css/fonts.css new file mode 100644 index 0000000..8870a22 --- /dev/null +++ b/resources/css/fonts.css @@ -0,0 +1,7 @@ +@font-face { + font-family: 'Caveat'; + src: url('/fonts/Caveat-700.woff2') format('woff2'); + font-weight: 700; + font-style: normal; + font-display: swap; +} diff --git a/resources/js/app.js b/resources/js/app.js index edcbd0c..459b6d9 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -3,6 +3,9 @@ import { AjaxTable } from './AjaxTable'; window.AjaxTable = AjaxTable; +import TomSelect from 'tom-select'; +window.TomSelect = TomSelect; + document.addEventListener('DOMContentLoaded', () => { if (document.getElementById('filterForm') && document.querySelector('.bg-white.shadow-sm')) { new AjaxTable(); diff --git a/resources/views/components/user-filter-form.blade.php b/resources/views/components/user-filter-form.blade.php index 9fe8243..445e9e2 100644 --- a/resources/views/components/user-filter-form.blade.php +++ b/resources/views/components/user-filter-form.blade.php @@ -57,3 +57,38 @@ + +@push('styles') + +@endpush + +@push('scripts') + +@endpush diff --git a/resources/views/components/user-form.blade.php b/resources/views/components/user-form.blade.php index 4876554..6058391 100644 --- a/resources/views/components/user-form.blade.php +++ b/resources/views/components/user-form.blade.php @@ -226,3 +226,32 @@ @endif + +@if($isCreate) + @push('styles') + + @endpush + + @push('scripts') + + @endpush +@endif diff --git a/resources/views/user/send.blade.php b/resources/views/user/send.blade.php index ef3350a..b74ffe5 100644 --- a/resources/views/user/send.blade.php +++ b/resources/views/user/send.blade.php @@ -1,6 +1,13 @@ @extends('layouts.app') @section('title', 'Gửi Thank Card') +@push('styles') + +@endpush + @section('content')
@@ -91,6 +98,20 @@ @push('scripts')