Update create user route

This commit is contained in:
Dayamond
2025-10-21 16:48:18 +02:00
parent c691f81ebb
commit 42a98f3435
3 changed files with 9 additions and 3 deletions
+4
View File
@@ -13,6 +13,10 @@ class UserController extends Controller
"name" => $request["name"], "name" => $request["name"],
"email" => $request["email"], "email" => $request["email"],
"password" => Hash::make($request["password"]), "password" => Hash::make($request["password"]),
"lastname" => $request["lastname"],
"validate" => 0,
]); ]);
return response()->json(['message' => 'User created successfully']);
} }
} }
@@ -19,7 +19,7 @@ return new class extends Migration
$table->string('password'); $table->string('password');
$table->string('phone')->nullable(); $table->string('phone')->nullable();
$table->integer('validate'); $table->integer('validate');
$table->integer('role'); $table->integer('role')->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }
+4 -2
View File
@@ -1,11 +1,11 @@
meta { meta {
name: Create user name: Create user
type: http type: http
seq: 2 seq: 4
} }
post { post {
url: http://localhost:8000/api/user/create url: http://localhost:8000/api/users/register
body: json body: json
auth: inherit auth: inherit
} }
@@ -17,6 +17,7 @@ headers {
body:json { body:json {
{ {
"name": "{{name}}", "name": "{{name}}",
"lastname": "{{lastname}}",
"email": "{{email}}", "email": "{{email}}",
"password": "{{password}}" "password": "{{password}}"
} }
@@ -26,6 +27,7 @@ vars:pre-request {
name: name name: name
email: test@test.com email: test@test.com
password: test password: test
lastname: NAME
} }
assert { assert {