From ef55ed2ca0713aba5c38eedc494c6ee7c25b454d Mon Sep 17 00:00:00 2001 From: latthisit <152863025+latthisit@users.noreply.github.com> Date: Sun, 31 Mar 2024 19:10:17 +0700 Subject: [PATCH 1/2] edit edit --- .env.example | 64 ------------- app/Http/Controllers/user_C.php | 65 +++++++++++++ composer.lock | 141 +++++++++++++++-------------- resources/views/homepage.blade.php | 28 +++--- routes/web.php | 10 +- 5 files changed, 153 insertions(+), 155 deletions(-) delete mode 100644 .env.example create mode 100644 app/Http/Controllers/user_C.php diff --git a/.env.example b/.env.example deleted file mode 100644 index 7b49625a..00000000 --- a/.env.example +++ /dev/null @@ -1,64 +0,0 @@ -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 - -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_HOST=127.0.0.1 -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=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/app/Http/Controllers/user_C.php b/app/Http/Controllers/user_C.php new file mode 100644 index 00000000..0ff6111a --- /dev/null +++ b/app/Http/Controllers/user_C.php @@ -0,0 +1,65 @@ +get(); + return view('homepage',compact('users')); + } + + function add() + { + return view('addpage'); + } + + // function insert(Request $request) + // { //เพิ่ม + // $request->validate( + // [ + // 'name' => 'required | max:50', + // ], + // [ + // 'name.required' => 'กรุณาป้อมชื่อของคุณ', + // 'name.max' => 'ชื่อของคุณไม่ควรเกิน 50 ตัวอักษร', + // ] + // ); + // $data = ['name' => $request->name]; + // DB::table('uesr')->insert($data); + // return redirect('/user'); + // } + // function delete($id) + // { //ลบ + // DB::table('uesr')->where('id', $id)->delete(); + // return redirect('/user'); + // } + + // function edit($id){ + // $user = DB::table('uesr')->where('id',$id)->first(); + // return view('edit', compact('user')); + // } + + + + // function update(Request $request, $id) + // { + // $request->validate( + // [ + // 'name' => 'required | max:50', + // ], + // [ + // 'name.required' => 'กรุณาป้อมชื่อของคุณ', + // 'name.max' => 'ชื่อของคุณไม่ควรเกิน 50 ตัวอักษร', + // ] + // ); + // $data = ['name' => $request->name]; + // DB::table('uesr')->where('id', $id)->update($data); + // return redirect('/user'); + // } +} diff --git a/composer.lock b/composer.lock index ca60c2a8..070dbd31 100644 --- a/composer.lock +++ b/composer.lock @@ -1047,16 +1047,16 @@ }, { "name": "laravel/framework", - "version": "v11.0.7", + "version": "v11.1.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "28eabe9dcdcb017a21ce226eda4538c5c8c93b1c" + "reference": "1437cea6d2b04cbc83743fbb208e1a01efccd9ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/28eabe9dcdcb017a21ce226eda4538c5c8c93b1c", - "reference": "28eabe9dcdcb017a21ce226eda4538c5c8c93b1c", + "url": "https://api.github.com/repos/laravel/framework/zipball/1437cea6d2b04cbc83743fbb208e1a01efccd9ec", + "reference": "1437cea6d2b04cbc83743fbb208e1a01efccd9ec", "shasum": "" }, "require": { @@ -1159,7 +1159,7 @@ "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.6", "nyholm/psr7": "^1.2", - "orchestra/testbench-core": "^9.0", + "orchestra/testbench-core": "^9.0.6", "pda/pheanstalk": "^5.0", "phpstan/phpstan": "^1.4.7", "phpunit/phpunit": "^10.5|^11.0", @@ -1248,20 +1248,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-03-15T23:17:58+00:00" + "time": "2024-03-28T15:07:18+00:00" }, { "name": "laravel/prompts", - "version": "v0.1.16", + "version": "v0.1.17", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "ca6872ab6aec3ab61db3a61f83a6caf764ec7781" + "reference": "8ee9f87f7f9eadcbe21e9e72cd4176b2f06cd5b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/ca6872ab6aec3ab61db3a61f83a6caf764ec7781", - "reference": "ca6872ab6aec3ab61db3a61f83a6caf764ec7781", + "url": "https://api.github.com/repos/laravel/prompts/zipball/8ee9f87f7f9eadcbe21e9e72cd4176b2f06cd5b5", + "reference": "8ee9f87f7f9eadcbe21e9e72cd4176b2f06cd5b5", "shasum": "" }, "require": { @@ -1303,9 +1303,9 @@ ], "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.1.16" + "source": "https://github.com/laravel/prompts/tree/v0.1.17" }, - "time": "2024-02-21T19:25:27+00:00" + "time": "2024-03-13T16:05:43+00:00" }, { "name": "laravel/serializable-closure", @@ -1623,16 +1623,16 @@ }, { "name": "league/flysystem", - "version": "3.25.1", + "version": "3.26.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "abbd664eb4381102c559d358420989f835208f18" + "reference": "072735c56cc0da00e10716dd90d5a7f7b40b36be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/abbd664eb4381102c559d358420989f835208f18", - "reference": "abbd664eb4381102c559d358420989f835208f18", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/072735c56cc0da00e10716dd90d5a7f7b40b36be", + "reference": "072735c56cc0da00e10716dd90d5a7f7b40b36be", "shasum": "" }, "require": { @@ -1697,7 +1697,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.25.1" + "source": "https://github.com/thephpleague/flysystem/tree/3.26.0" }, "funding": [ { @@ -1709,7 +1709,7 @@ "type": "github" } ], - "time": "2024-03-16T12:53:19+00:00" + "time": "2024-03-25T11:49:53+00:00" }, { "name": "league/flysystem-local", @@ -1929,16 +1929,16 @@ }, { "name": "nesbot/carbon", - "version": "3.1.1", + "version": "3.2.3", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "34ccf6f6b49c915421c7886c88c0cb77f3ebbfd2" + "reference": "4d599a6e2351d6b6bf21737accdfe1a4ce3fdbb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/34ccf6f6b49c915421c7886c88c0cb77f3ebbfd2", - "reference": "34ccf6f6b49c915421c7886c88c0cb77f3ebbfd2", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4d599a6e2351d6b6bf21737accdfe1a4ce3fdbb1", + "reference": "4d599a6e2351d6b6bf21737accdfe1a4ce3fdbb1", "shasum": "" }, "require": { @@ -1956,14 +1956,14 @@ "require-dev": { "doctrine/dbal": "^3.6.3 || ^4.0", "doctrine/orm": "^2.15.2 || ^3.0", - "friendsofphp/php-cs-fixer": "^3.18.0", - "kylekatarnls/multi-tester": "^2.2.0", - "ondrejmirtes/better-reflection": "^6.11.0.0", - "phpmd/phpmd": "^2.13.0", - "phpstan/extension-installer": "^1.3.0", - "phpstan/phpstan": "^1.10.20", - "phpunit/phpunit": "^10.2.2", - "squizlabs/php_codesniffer": "^3.7.2" + "friendsofphp/php-cs-fixer": "^3.52.1", + "kylekatarnls/multi-tester": "^2.5.3", + "ondrejmirtes/better-reflection": "^6.25.0.4", + "phpmd/phpmd": "^2.15.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.65", + "phpunit/phpunit": "^10.5.15", + "squizlabs/php_codesniffer": "^3.9.0" }, "bin": [ "bin/carbon" @@ -2031,7 +2031,7 @@ "type": "tidelift" } ], - "time": "2024-03-13T12:42:37+00:00" + "time": "2024-03-30T18:22:00+00:00" }, { "name": "nette/schema", @@ -5872,16 +5872,16 @@ }, { "name": "laravel/pint", - "version": "v1.14.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "6b127276e3f263f7bb17d5077e9e0269e61b2a0e" + "reference": "c52de679b3ac01207016c179d7ce173e4be128c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/6b127276e3f263f7bb17d5077e9e0269e61b2a0e", - "reference": "6b127276e3f263f7bb17d5077e9e0269e61b2a0e", + "url": "https://api.github.com/repos/laravel/pint/zipball/c52de679b3ac01207016c179d7ce173e4be128c4", + "reference": "c52de679b3ac01207016c179d7ce173e4be128c4", "shasum": "" }, "require": { @@ -5934,20 +5934,20 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-02-20T17:38:05+00:00" + "time": "2024-03-26T16:40:24+00:00" }, { "name": "laravel/sail", - "version": "v1.29.0", + "version": "v1.29.1", "source": { "type": "git", "url": "https://github.com/laravel/sail.git", - "reference": "e40cc7ffb5186c45698dbd47e9477e0e429396d0" + "reference": "8be4a31150eab3b46af11a2e7b2c4632eefaad7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sail/zipball/e40cc7ffb5186c45698dbd47e9477e0e429396d0", - "reference": "e40cc7ffb5186c45698dbd47e9477e0e429396d0", + "url": "https://api.github.com/repos/laravel/sail/zipball/8be4a31150eab3b46af11a2e7b2c4632eefaad7e", + "reference": "8be4a31150eab3b46af11a2e7b2c4632eefaad7e", "shasum": "" }, "require": { @@ -5955,6 +5955,7 @@ "illuminate/contracts": "^9.52.16|^10.0|^11.0", "illuminate/support": "^9.52.16|^10.0|^11.0", "php": "^8.0", + "symfony/console": "^6.0|^7.0", "symfony/yaml": "^6.0|^7.0" }, "require-dev": { @@ -5996,20 +5997,20 @@ "issues": "https://github.com/laravel/sail/issues", "source": "https://github.com/laravel/sail" }, - "time": "2024-03-08T16:32:33+00:00" + "time": "2024-03-20T20:09:31+00:00" }, { "name": "mockery/mockery", - "version": "1.6.10", + "version": "1.6.11", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "47065d1be1fa05def58dc14c03cf831d3884ef0b" + "reference": "81a161d0b135df89951abd52296adf97deb0723d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/47065d1be1fa05def58dc14c03cf831d3884ef0b", - "reference": "47065d1be1fa05def58dc14c03cf831d3884ef0b", + "url": "https://api.github.com/repos/mockery/mockery/zipball/81a161d0b135df89951abd52296adf97deb0723d", + "reference": "81a161d0b135df89951abd52296adf97deb0723d", "shasum": "" }, "require": { @@ -6079,7 +6080,7 @@ "security": "https://github.com/mockery/mockery/security/advisories", "source": "https://github.com/mockery/mockery" }, - "time": "2024-03-19T16:15:45+00:00" + "time": "2024-03-21T18:34:15+00:00" }, { "name": "myclabs/deep-copy", @@ -6678,16 +6679,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.13", + "version": "10.5.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "20a63fc1c6db29b15da3bd02d4b6cf59900088a7" + "reference": "18f8d4a5f52b61fdd9370aaae3167daa0eeb69cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/20a63fc1c6db29b15da3bd02d4b6cf59900088a7", - "reference": "20a63fc1c6db29b15da3bd02d4b6cf59900088a7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/18f8d4a5f52b61fdd9370aaae3167daa0eeb69cd", + "reference": "18f8d4a5f52b61fdd9370aaae3167daa0eeb69cd", "shasum": "" }, "require": { @@ -6759,7 +6760,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.13" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.16" }, "funding": [ { @@ -6775,7 +6776,7 @@ "type": "tidelift" } ], - "time": "2024-03-12T15:37:41+00:00" + "time": "2024-03-28T10:08:10+00:00" }, { "name": "sebastian/cli-parser", @@ -7149,16 +7150,16 @@ }, { "name": "sebastian/environment", - "version": "6.0.1", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { @@ -7173,7 +7174,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -7201,7 +7202,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -7209,7 +7210,7 @@ "type": "github" } ], - "time": "2023-04-11T05:39:26+00:00" + "time": "2024-03-23T08:47:14+00:00" }, { "name": "sebastian/exporter", @@ -7826,16 +7827,16 @@ }, { "name": "spatie/ignition", - "version": "1.12.0", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/spatie/ignition.git", - "reference": "5b6f801c605a593106b623e45ca41496a6e7d56d" + "reference": "889bf1dfa59e161590f677728b47bf4a6893983b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ignition/zipball/5b6f801c605a593106b623e45ca41496a6e7d56d", - "reference": "5b6f801c605a593106b623e45ca41496a6e7d56d", + "url": "https://api.github.com/repos/spatie/ignition/zipball/889bf1dfa59e161590f677728b47bf4a6893983b", + "reference": "889bf1dfa59e161590f677728b47bf4a6893983b", "shasum": "" }, "require": { @@ -7905,20 +7906,20 @@ "type": "github" } ], - "time": "2024-01-03T15:49:39+00:00" + "time": "2024-03-29T14:03:47+00:00" }, { "name": "spatie/laravel-ignition", - "version": "2.4.2", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ignition.git", - "reference": "351504f4570e32908839fc5a2dc53bf77d02f85e" + "reference": "e23f4e8ce6644dc3d68b9d8a0aed3beaca0d6ada" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/351504f4570e32908839fc5a2dc53bf77d02f85e", - "reference": "351504f4570e32908839fc5a2dc53bf77d02f85e", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/e23f4e8ce6644dc3d68b9d8a0aed3beaca0d6ada", + "reference": "e23f4e8ce6644dc3d68b9d8a0aed3beaca0d6ada", "shasum": "" }, "require": { @@ -7928,7 +7929,7 @@ "illuminate/support": "^10.0|^11.0", "php": "^8.1", "spatie/flare-client-php": "^1.3.5", - "spatie/ignition": "^1.9", + "spatie/ignition": "^1.13", "symfony/console": "^6.2.3|^7.0", "symfony/var-dumper": "^6.2.3|^7.0" }, @@ -7997,7 +7998,7 @@ "type": "github" } ], - "time": "2024-02-09T16:08:40+00:00" + "time": "2024-03-29T14:14:55+00:00" }, { "name": "symfony/yaml", diff --git a/resources/views/homepage.blade.php b/resources/views/homepage.blade.php index 095e34cf..ca0a58cf 100644 --- a/resources/views/homepage.blade.php +++ b/resources/views/homepage.blade.php @@ -1,10 +1,8 @@ @extends('layouts.default') - @section('page_name', 'Users Data') @section('content') -
- Add User + Add User
@@ -13,22 +11,22 @@ - - - - - - - - - + @foreach ($users as $item) + + + + + + + + @endforeach
name email avatarTitle Tools
1nameemailavatarTitle - Edit - -
{{ $item->id }}{{ $item->name }}{{ $item->email }}{{ $item->avatar }} + Edit + Delete +
@endsection diff --git a/routes/web.php b/routes/web.php index a0109981..84ceeac0 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,15 +1,13 @@ name('user');//หน้ารายชื่อทั้งหมด -Route::get('/edit-user', function () { -return view('editpage'); -}); +Route::get('add',[user_C::class,'add'])->name('add');//หน้าเพิ่มชื่อ From 282a75c42bf2a6ad36d5f4168b2276841489f127 Mon Sep 17 00:00:00 2001 From: latthisit <152863025+latthisit@users.noreply.github.com> Date: Sun, 31 Mar 2024 22:06:26 +0700 Subject: [PATCH 2/2] 65160352 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 65160352 ลัทธสิทธิ์ ยิ้มเกียรติ --- app/Http/Controllers/user_C.php | 65 +++++++++++------------------- resources/views/addpage.blade.php | 28 +++++++++++-- resources/views/editpage.blade.php | 21 +++++++++- resources/views/homepage.blade.php | 39 ++++++++++++------ routes/web.php | 7 +++- 5 files changed, 100 insertions(+), 60 deletions(-) diff --git a/app/Http/Controllers/user_C.php b/app/Http/Controllers/user_C.php index 0ff6111a..2109b1c2 100644 --- a/app/Http/Controllers/user_C.php +++ b/app/Http/Controllers/user_C.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; @@ -10,8 +11,8 @@ class user_C extends Controller { function user() { - $users = DB::table('users')->get(); - return view('homepage',compact('users')); + $users = User::all(); + return view('homepage', compact('users')); } function add() @@ -19,47 +20,29 @@ function add() return view('addpage'); } - // function insert(Request $request) - // { //เพิ่ม - // $request->validate( - // [ - // 'name' => 'required | max:50', - // ], - // [ - // 'name.required' => 'กรุณาป้อมชื่อของคุณ', - // 'name.max' => 'ชื่อของคุณไม่ควรเกิน 50 ตัวอักษร', - // ] - // ); - // $data = ['name' => $request->name]; - // DB::table('uesr')->insert($data); - // return redirect('/user'); - // } - // function delete($id) - // { //ลบ - // DB::table('uesr')->where('id', $id)->delete(); - // return redirect('/user'); - // } + function insert(Request $request) + { //เพิ่ม + $data = ['name' => $request->name]; + DB::table('uesrs')->insert($data); + return redirect('/homepage'); + } + function delete($id) + { //ลบ + DB::table('uesrs')->where('id', $id)->delete(); + return redirect('/homepage'); + } - // function edit($id){ - // $user = DB::table('uesr')->where('id',$id)->first(); - // return view('edit', compact('user')); - // } + function edit($id){ + $user = DB::table('uesrs')->where('id',$id)->first(); + return view('editpage', compact('user')); + } - // function update(Request $request, $id) - // { - // $request->validate( - // [ - // 'name' => 'required | max:50', - // ], - // [ - // 'name.required' => 'กรุณาป้อมชื่อของคุณ', - // 'name.max' => 'ชื่อของคุณไม่ควรเกิน 50 ตัวอักษร', - // ] - // ); - // $data = ['name' => $request->name]; - // DB::table('uesr')->where('id', $id)->update($data); - // return redirect('/user'); - // } + function update(Request $request, $id) + { + $data = ['name' => $request->name]; + DB::table('uesrs')->where('id', $id)->update($data); + return redirect('/homepage'); + } } diff --git a/resources/views/addpage.blade.php b/resources/views/addpage.blade.php index cf7cef57..c85e0166 100644 --- a/resources/views/addpage.blade.php +++ b/resources/views/addpage.blade.php @@ -11,16 +11,38 @@
@csrf
-
- +
+ + +
+ +
+ + +
+ +
+ +
+ + +
+ +
+ + +
+ +
+
diff --git a/resources/views/editpage.blade.php b/resources/views/editpage.blade.php index 634c6a6d..8e7be970 100644 --- a/resources/views/editpage.blade.php +++ b/resources/views/editpage.blade.php @@ -12,15 +12,32 @@ @csrf
- +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
diff --git a/resources/views/homepage.blade.php b/resources/views/homepage.blade.php index ca0a58cf..5ed66085 100644 --- a/resources/views/homepage.blade.php +++ b/resources/views/homepage.blade.php @@ -8,6 +8,7 @@ # + Title name email avatar @@ -15,18 +16,32 @@ - @foreach ($users as $item) - - {{ $item->id }} - {{ $item->name }} - {{ $item->email }} - {{ $item->avatar }} - - Edit - Delete - - - @endforeach + + @foreach ($user as $item) + + {{$item->id}} + คุณ + {{$item->name}} + {{$item->email}} + ไม่มีรูป + + Edit + Delete + + + @endforeach + {{-- + 1 + คุณ + latthisit + 65160352@gmail.com + ไม่มีรูป + + Edit + Delete + + --}} + @endsection diff --git a/routes/web.php b/routes/web.php index 84ceeac0..848cd5d1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -9,5 +9,8 @@ }); Route::get('user',[user_C::class,'user'])->name('user');//หน้ารายชื่อทั้งหมด - -Route::get('add',[user_C::class,'add'])->name('add');//หน้าเพิ่มชื่อ +Route::get('/add',[user_C::class,'add'])->name('add');//หน้าเพิ่มชื่อ +Route::post('/insert',[user_C::class,'insert']);//เพิ่มข้อมูลในฐานข้อมูล +Route::get('delete/{id}',[user_C::class,'delete'])->name('delete');//ลบ +Route::get('edit{id}',[user_C::class,'edit'])->name('edit');//แก้ไข +Route::post('update/{id}',[user_C::class, 'update'])->name('update');//อัพเดต