diff --git a/api-calls/app/Http/Controllers/AdminProductController.php b/api-calls/app/Http/Controllers/AdminProductController.php new file mode 100644 index 0000000..d0b3362 --- /dev/null +++ b/api-calls/app/Http/Controllers/AdminProductController.php @@ -0,0 +1,91 @@ + $product]); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + $validatedData = $this->validatedData($request); + Product::create($validatedData); + + return redirect()->route('admin.products.index')->with('success', 'Product created successfully!'); + } + + /** + * Display the specified resource. + */ + public function show(string $id) + { + $product = Product::findOrFail($id); + return view('admin.products.show', compact('product')); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(string $id) + { + $product = Product::findOrFail($id); + return view('admin.products.edit', compact('product')); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, string $id) + { + $product = Product::findOrFail($id); + $validatedData = $this->validatedData($request, $product); + $product->update($validatedData); + + return redirect()->route('admin.products.index')->with('success', 'Product updated successfully!'); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(string $id) + { + $product = Product::find($id); + $product->delete(); + return redirect()->route('admin.products.index')->with('success', 'Product deleted successfully!'); + } + + private function validatedData(Request $request, $product = null) + { + $rules = [ + 'name' => 'required|max:255', + 'price' => 'required|numeric', + 'description' => 'nullable', + 'item_number' => 'required|unique:products,item_number' . ($product ? ',' . $product->id : ''), + 'image' => 'nullable|url' + ]; + + return $request->validate($rules); + } +} diff --git a/api-calls/app/Http/Controllers/Auth/ConfirmPasswordController.php b/api-calls/app/Http/Controllers/Auth/ConfirmPasswordController.php new file mode 100644 index 0000000..3559954 --- /dev/null +++ b/api-calls/app/Http/Controllers/Auth/ConfirmPasswordController.php @@ -0,0 +1,39 @@ +middleware('auth'); + } +} diff --git a/api-calls/app/Http/Controllers/Auth/ForgotPasswordController.php b/api-calls/app/Http/Controllers/Auth/ForgotPasswordController.php new file mode 100644 index 0000000..465c39c --- /dev/null +++ b/api-calls/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -0,0 +1,22 @@ +middleware('guest')->except('logout'); + } +} diff --git a/api-calls/app/Http/Controllers/Auth/RegisterController.php b/api-calls/app/Http/Controllers/Auth/RegisterController.php new file mode 100644 index 0000000..961ea36 --- /dev/null +++ b/api-calls/app/Http/Controllers/Auth/RegisterController.php @@ -0,0 +1,72 @@ +middleware('guest'); + } + + /** + * Get a validator for an incoming registration request. + * + * @param array $data + * @return \Illuminate\Contracts\Validation\Validator + */ + protected function validator(array $data) + { + return Validator::make($data, [ + 'name' => ['required', 'string', 'max:255'], + 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], + 'password' => ['required', 'string', 'min:8', 'confirmed'], + ]); + } + + /** + * Create a new user instance after a valid registration. + * + * @param array $data + * @return \App\Models\User + */ + protected function create(array $data) + { + return User::create([ + 'name' => $data['name'], + 'email' => $data['email'], + 'password' => Hash::make($data['password']), + ]); + } +} diff --git a/api-calls/app/Http/Controllers/Auth/ResetPasswordController.php b/api-calls/app/Http/Controllers/Auth/ResetPasswordController.php new file mode 100644 index 0000000..fe965b2 --- /dev/null +++ b/api-calls/app/Http/Controllers/Auth/ResetPasswordController.php @@ -0,0 +1,29 @@ +middleware('auth'); + $this->middleware('signed')->only('verify'); + $this->middleware('throttle:6,1')->only('verify', 'resend'); + } +} diff --git a/api-calls/app/Http/Controllers/Controller.php b/api-calls/app/Http/Controllers/Controller.php index 8677cd5..77ec359 100644 --- a/api-calls/app/Http/Controllers/Controller.php +++ b/api-calls/app/Http/Controllers/Controller.php @@ -2,7 +2,11 @@ namespace App\Http\Controllers; -abstract class Controller +use Illuminate\Foundation\Auth\Access\AuthorizesRequests; +use Illuminate\Foundation\Validation\ValidatesRequests; +use Illuminate\Routing\Controller as BaseController; + +class Controller extends BaseController { - // + use AuthorizesRequests, ValidatesRequests; } diff --git a/api-calls/app/Http/Controllers/HomeController.php b/api-calls/app/Http/Controllers/HomeController.php new file mode 100644 index 0000000..7cbc2c3 --- /dev/null +++ b/api-calls/app/Http/Controllers/HomeController.php @@ -0,0 +1,28 @@ +middleware('auth'); + } + + /** + * Show the application dashboard. + * + * @return \Illuminate\Contracts\Support\Renderable + */ + public function index() + { + return view('home'); + } +} diff --git a/api-calls/app/Http/Controllers/ProductController.php b/api-calls/app/Http/Controllers/ProductController.php index f720e56..5a6beed 100644 --- a/api-calls/app/Http/Controllers/ProductController.php +++ b/api-calls/app/Http/Controllers/ProductController.php @@ -19,15 +19,16 @@ public function index() /** * Show the form for creating a new resource. */ - public function create() + /*public function create() { return view('products.create'); } + */ /** * Store a newly created resource in storage. */ - public function store(Request $request) + /* public function store(Request $request) { $validatedData = $request->validate([ 'name' => 'required|max:255', @@ -41,6 +42,7 @@ public function store(Request $request) return redirect('/products'); } + */ /** * Display the specified resource. @@ -53,15 +55,16 @@ public function show(Product $product) /** * Show the form for editing the specified resource. */ - public function edit(Product $product) + /*public function edit(Product $product) { return view('products.edit', compact('product')); } + /* /** * Update the specified resource in storage. */ - public function update(Request $request, Product $product) + /* public function update(Request $request, Product $product) { $validatedData = $request->validate([ 'name' => 'required|max:255', @@ -73,13 +76,15 @@ public function update(Request $request, Product $product) $product->update($validatedData); return redirect('/products'); } + */ /** * Remove the specified resource from storage. */ - public function destroy(Product $product) + /*public function destroy(Product $product) { $product->delete(); return redirect('/products'); } + */ } diff --git a/api-calls/composer.json b/api-calls/composer.json index 90c1344..d59213f 100644 --- a/api-calls/composer.json +++ b/api-calls/composer.json @@ -8,7 +8,8 @@ "php": "^8.2", "laravel/breeze": "^2.0", "laravel/framework": "^11.0", - "laravel/tinker": "^2.9" + "laravel/tinker": "^2.9", + "laravel/ui": "^4.5" }, "require-dev": { "fakerphp/faker": "^1.23", diff --git a/api-calls/composer.lock b/api-calls/composer.lock index d250b4b..7a27f4c 100644 --- a/api-calls/composer.lock +++ b/api-calls/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": "84c61af57b4c8d8b767caf42ec360a3d", + "content-hash": "64f31fa2e9f48bf15b1ffab05eb0463f", "packages": [ { "name": "brick/math", @@ -1493,6 +1493,69 @@ }, "time": "2024-01-04T16:10:04+00:00" }, + { + "name": "laravel/ui", + "version": "v4.5.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/ui.git", + "reference": "a3562953123946996a503159199d6742d5534e61" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/ui/zipball/a3562953123946996a503159199d6742d5534e61", + "reference": "a3562953123946996a503159199d6742d5534e61", + "shasum": "" + }, + "require": { + "illuminate/console": "^9.21|^10.0|^11.0", + "illuminate/filesystem": "^9.21|^10.0|^11.0", + "illuminate/support": "^9.21|^10.0|^11.0", + "illuminate/validation": "^9.21|^10.0|^11.0", + "php": "^8.0", + "symfony/console": "^6.0|^7.0" + }, + "require-dev": { + "orchestra/testbench": "^7.35|^8.15|^9.0", + "phpunit/phpunit": "^9.3|^10.4|^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Ui\\UiServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Ui\\": "src/", + "Illuminate\\Foundation\\Auth\\": "auth-backend/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel UI utilities and presets.", + "keywords": [ + "laravel", + "ui" + ], + "support": { + "source": "https://github.com/laravel/ui/tree/v4.5.1" + }, + "time": "2024-03-21T18:12:29+00:00" + }, { "name": "league/commonmark", "version": "2.4.2", diff --git a/api-calls/package-lock.json b/api-calls/package-lock.json index f9ba164..383b175 100644 --- a/api-calls/package-lock.json +++ b/api-calls/package-lock.json @@ -8,12 +8,16 @@ "bootstrap": "^5.3.3" }, "devDependencies": { + "@popperjs/core": "^2.11.6", "@tailwindcss/forms": "^0.5.2", + "@vitejs/plugin-vue": "^5.0.4", "alpinejs": "^3.4.2", "autoprefixer": "^10.4.2", "axios": "^1.6.4", + "bootstrap": "^5.2.3", "laravel-vite-plugin": "^1.0", "postcss": "^8.4.31", + "sass": "^1.75.0", "tailwindcss": "^3.1.0", "vite": "^5.0" } @@ -30,6 +34,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@babel/parser": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.5.tgz", + "integrity": "sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==", + "dev": true, + "peer": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", @@ -512,7 +529,7 @@ "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "peer": true, + "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -731,6 +748,101 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "node_modules/@vitejs/plugin-vue": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.0.4.tgz", + "integrity": "sha512-WS3hevEszI6CEVEx28F8RjTX97k3KsrcY6kvTg7+Whm5y3oYvcqzVeGCU3hxSAn4uY2CLCkeokkGKpoctccilQ==", + "dev": true, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.26.tgz", + "integrity": "sha512-N9Vil6Hvw7NaiyFUFBPXrAyETIGlQ8KcFMkyk6hW1Cl6NvoqvP+Y8p1Eqvx+UdqsnrnI9+HMUEJegzia3mhXmQ==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/parser": "^7.24.4", + "@vue/shared": "3.4.26", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-core/node_modules/@vue/shared": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.26.tgz", + "integrity": "sha512-Fg4zwR0GNnjzodMt3KRy2AWGMKQXByl56+4HjN87soxLNU9P5xcJkstAlIeEF3cU6UYOzmJl1tV0dVPGIljCnQ==", + "dev": true, + "peer": true + }, + "node_modules/@vue/compiler-dom": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.26.tgz", + "integrity": "sha512-4CWbR5vR9fMg23YqFOhr6t6WB1Fjt62d6xdFPyj8pxrYub7d+OgZaObMsoxaF9yBUHPMiPFK303v61PwAuGvZA==", + "dev": true, + "peer": true, + "dependencies": { + "@vue/compiler-core": "3.4.26", + "@vue/shared": "3.4.26" + } + }, + "node_modules/@vue/compiler-dom/node_modules/@vue/shared": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.26.tgz", + "integrity": "sha512-Fg4zwR0GNnjzodMt3KRy2AWGMKQXByl56+4HjN87soxLNU9P5xcJkstAlIeEF3cU6UYOzmJl1tV0dVPGIljCnQ==", + "dev": true, + "peer": true + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.26.tgz", + "integrity": "sha512-It1dp+FAOCgluYSVYlDn5DtZBxk1NCiJJfu2mlQqa/b+k8GL6NG/3/zRbJnHdhV2VhxFghaDq5L4K+1dakW6cw==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/parser": "^7.24.4", + "@vue/compiler-core": "3.4.26", + "@vue/compiler-dom": "3.4.26", + "@vue/compiler-ssr": "3.4.26", + "@vue/shared": "3.4.26", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.10", + "postcss": "^8.4.38", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/shared": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.26.tgz", + "integrity": "sha512-Fg4zwR0GNnjzodMt3KRy2AWGMKQXByl56+4HjN87soxLNU9P5xcJkstAlIeEF3cU6UYOzmJl1tV0dVPGIljCnQ==", + "dev": true, + "peer": true + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.26.tgz", + "integrity": "sha512-FNwLfk7LlEPRY/g+nw2VqiDKcnDTVdCfBREekF8X74cPLiWHUX6oldktf/Vx28yh4STNy7t+/yuLoMBBF7YDiQ==", + "dev": true, + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.4.26", + "@vue/shared": "3.4.26" + } + }, + "node_modules/@vue/compiler-ssr/node_modules/@vue/shared": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.26.tgz", + "integrity": "sha512-Fg4zwR0GNnjzodMt3KRy2AWGMKQXByl56+4HjN87soxLNU9P5xcJkstAlIeEF3cU6UYOzmJl1tV0dVPGIljCnQ==", + "dev": true, + "peer": true + }, "node_modules/@vue/reactivity": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.5.tgz", @@ -740,6 +852,74 @@ "@vue/shared": "3.1.5" } }, + "node_modules/@vue/runtime-core": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.26.tgz", + "integrity": "sha512-AFJDLpZvhT4ujUgZSIL9pdNcO23qVFh7zWCsNdGQBw8ecLNxOOnPcK9wTTIYCmBJnuPHpukOwo62a2PPivihqw==", + "dev": true, + "peer": true, + "dependencies": { + "@vue/reactivity": "3.4.26", + "@vue/shared": "3.4.26" + } + }, + "node_modules/@vue/runtime-core/node_modules/@vue/reactivity": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.26.tgz", + "integrity": "sha512-E/ynEAu/pw0yotJeLdvZEsp5Olmxt+9/WqzvKff0gE67tw73gmbx6tRkiagE/eH0UCubzSlGRebCbidB1CpqZQ==", + "dev": true, + "peer": true, + "dependencies": { + "@vue/shared": "3.4.26" + } + }, + "node_modules/@vue/runtime-core/node_modules/@vue/shared": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.26.tgz", + "integrity": "sha512-Fg4zwR0GNnjzodMt3KRy2AWGMKQXByl56+4HjN87soxLNU9P5xcJkstAlIeEF3cU6UYOzmJl1tV0dVPGIljCnQ==", + "dev": true, + "peer": true + }, + "node_modules/@vue/runtime-dom": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.26.tgz", + "integrity": "sha512-UftYA2hUXR2UOZD/Fc3IndZuCOOJgFxJsWOxDkhfVcwLbsfh2CdXE2tG4jWxBZuDAs9J9PzRTUFt1PgydEtItw==", + "dev": true, + "peer": true, + "dependencies": { + "@vue/runtime-core": "3.4.26", + "@vue/shared": "3.4.26", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/runtime-dom/node_modules/@vue/shared": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.26.tgz", + "integrity": "sha512-Fg4zwR0GNnjzodMt3KRy2AWGMKQXByl56+4HjN87soxLNU9P5xcJkstAlIeEF3cU6UYOzmJl1tV0dVPGIljCnQ==", + "dev": true, + "peer": true + }, + "node_modules/@vue/server-renderer": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.26.tgz", + "integrity": "sha512-xoGAqSjYDPGAeRWxeoYwqJFD/gw7mpgzOvSxEmjWaFO2rE6qpbD1PC172YRpvKhrihkyHJkNDADFXTfCyVGhKw==", + "dev": true, + "peer": true, + "dependencies": { + "@vue/compiler-ssr": "3.4.26", + "@vue/shared": "3.4.26" + }, + "peerDependencies": { + "vue": "3.4.26" + } + }, + "node_modules/@vue/server-renderer/node_modules/@vue/shared": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.26.tgz", + "integrity": "sha512-Fg4zwR0GNnjzodMt3KRy2AWGMKQXByl56+4HjN87soxLNU9P5xcJkstAlIeEF3cU6UYOzmJl1tV0dVPGIljCnQ==", + "dev": true, + "peer": true + }, "node_modules/@vue/shared": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.5.tgz", @@ -880,6 +1060,7 @@ "version": "5.3.3", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.3.tgz", "integrity": "sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg==", + "dev": true, "funding": [ { "type": "github", @@ -1077,6 +1258,13 @@ "node": ">=4" } }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dev": true, + "peer": true + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -1116,6 +1304,19 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/esbuild": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", @@ -1163,6 +1364,13 @@ "node": ">=6" } }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "peer": true + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -1344,6 +1552,12 @@ "node": ">= 0.4" } }, + "node_modules/immutable": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.5.tgz", + "integrity": "sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==", + "dev": true + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -1483,6 +1697,16 @@ "node": "14 || >=16.14" } }, + "node_modules/magic-string": { + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -1977,6 +2201,23 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/sass": { + "version": "1.75.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.75.0.tgz", + "integrity": "sha512-ShMYi3WkrDWxExyxSZPst4/okE9ts46xZmJDSawJQrnte7M1V9fScVB+uNXOVKRBt0PggHOwoZcn8mYX4trnBw==", + "dev": true, + "dependencies": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2326,6 +2567,35 @@ "picomatch": "^2.3.1" } }, + "node_modules/vue": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.26.tgz", + "integrity": "sha512-bUIq/p+VB+0xrJubaemrfhk1/FiW9iX+pDV+62I/XJ6EkspAO9/DXEjbDFoe8pIfOZBqfk45i9BMc41ptP/uRg==", + "dev": true, + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.4.26", + "@vue/compiler-sfc": "3.4.26", + "@vue/runtime-dom": "3.4.26", + "@vue/server-renderer": "3.4.26", + "@vue/shared": "3.4.26" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue/node_modules/@vue/shared": { + "version": "3.4.26", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.26.tgz", + "integrity": "sha512-Fg4zwR0GNnjzodMt3KRy2AWGMKQXByl56+4HjN87soxLNU9P5xcJkstAlIeEF3cU6UYOzmJl1tV0dVPGIljCnQ==", + "dev": true, + "peer": true + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/api-calls/package.json b/api-calls/package.json index f704628..e9f5e73 100644 --- a/api-calls/package.json +++ b/api-calls/package.json @@ -6,12 +6,16 @@ "build": "vite build" }, "devDependencies": { + "@popperjs/core": "^2.11.6", "@tailwindcss/forms": "^0.5.2", + "@vitejs/plugin-vue": "^5.0.4", "alpinejs": "^3.4.2", "autoprefixer": "^10.4.2", "axios": "^1.6.4", + "bootstrap": "^5.2.3", "laravel-vite-plugin": "^1.0", "postcss": "^8.4.31", + "sass": "^1.75.0", "tailwindcss": "^3.1.0", "vite": "^5.0" }, diff --git a/api-calls/resources/js/bootstrap.js b/api-calls/resources/js/bootstrap.js index 5f1390b..46f7a33 100644 --- a/api-calls/resources/js/bootstrap.js +++ b/api-calls/resources/js/bootstrap.js @@ -1,4 +1,34 @@ +import 'bootstrap'; + +/** + * We'll load the axios HTTP library which allows us to easily issue requests + * to our Laravel back-end. This library automatically handles sending the + * CSRF token as a header based on the value of the "XSRF" token cookie. + */ + import axios from 'axios'; window.axios = axios; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; + +/** + * Echo exposes an expressive API for subscribing to channels and listening + * for events that are broadcast by Laravel. Echo and event broadcasting + * allows your team to easily build robust real-time web applications. + */ + +// import Echo from 'laravel-echo'; + +// import Pusher from 'pusher-js'; +// window.Pusher = Pusher; + +// window.Echo = new Echo({ +// broadcaster: 'pusher', +// key: import.meta.env.VITE_PUSHER_APP_KEY, +// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1', +// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, +// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, +// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, +// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', +// enabledTransports: ['ws', 'wss'], +// }); diff --git a/api-calls/resources/sass/_variables.scss b/api-calls/resources/sass/_variables.scss new file mode 100644 index 0000000..172daaa --- /dev/null +++ b/api-calls/resources/sass/_variables.scss @@ -0,0 +1,7 @@ +// Body +$body-bg: #f8fafc; + +// Typography +$font-family-sans-serif: 'Nunito', sans-serif; +$font-size-base: 0.9rem; +$line-height-base: 1.6; diff --git a/api-calls/resources/sass/app.scss b/api-calls/resources/sass/app.scss new file mode 100644 index 0000000..1026a0b --- /dev/null +++ b/api-calls/resources/sass/app.scss @@ -0,0 +1,8 @@ +// Fonts +@import url('https://fonts.bunny.net/css?family=Nunito'); + +// Variables +@import 'variables'; + +// Bootstrap +@import 'bootstrap/scss/bootstrap'; diff --git a/api-calls/resources/views/admin/products/create.blade.php b/api-calls/resources/views/admin/products/create.blade.php new file mode 100644 index 0000000..ef4d94b --- /dev/null +++ b/api-calls/resources/views/admin/products/create.blade.php @@ -0,0 +1,16 @@ +@extends('layouts.admin') + +@section('title', 'Create Product') + +@section('content') +
Image | +Name | +Price | +Item Number | +Actions | +
---|---|---|---|---|
+ |
+ {{ $product->name }} | +${{ number_format($product->price, 2) }} | +{{ $product->item_number }} | ++ View + Edit + + | +
{{ $product->description }}
+Price: ${{ number_format($product->price, 2) }}
+Item Number: {{ $product->item_number }}
+ Go back +