Skip to content

Commit 0485210

Browse files
committed
profile
1 parent 03c6545 commit 0485210

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

app/Http/Controllers/Api/UserController.php

+4-11
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ class UserController extends Controller
1111
{
1212
public function index()
1313
{
14-
1514
}
1615

1716

1817
public function createUser(Request $request)
1918
{
20-
2119
}
2220

2321

@@ -26,7 +24,6 @@ public function createUser(Request $request)
2624

2725
public function showUser($id)
2826
{
29-
3027
}
3128

3229

@@ -147,20 +144,16 @@ public function editUser(Request $request, $id)
147144
$user->imageUrl = "images/users/$imagePath";
148145
}
149146

150-
// No changes to update
151-
return $this->errorMessage([], 'No changes to update', 422);
147+
152148

153149
// Save the updated user profile to the database if there are changes
154150
if ($changes) {
155151
$user->save();
156-
return $this->successMessage('UserProfile updated successfully', 200,[]);
152+
return $this->successMessage('UserProfile updated successfully', 200, []);
157153
}
158154

159-
160-
161-
162-
163-
155+
// No changes to update
156+
return $this->errorMessage([], 'No changes to update', 422);
164157
}
165158

166159

app/Models/User.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ class User extends Authenticatable
3434
'behanceUrl',
3535
'twitterUrl',
3636
'facebookUrl',
37+
'imageUrl',
3738
'Address',
3839
'education',
3940
'date_of_birth',
40-
'imageUrl',
4141
'code',
42-
4342
'remember_token',
4443
'code_expired_at',
4544
'email_verified_at',

database/migrations/2014_10_12_000000_create_users_table.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public function up()
3232
$table->integer('years_of_experience')->nullable();
3333
$table->string('imageUrl')->nullable();
3434
$table->string('cvUrl')->nullable();
35+
$table->string('behanceUrl')->nullable();
3536
$table->string('githubUrl')->nullable();
3637
$table->string('facebookUrl')->nullable();
37-
$table->string('behanceUrl')->nullable();
3838
$table->string('twitterUrl')->nullable();
3939
$table->string('linkedinUrl')->nullable();
4040
$table->dateTime('date_of_birth')->nullable();

0 commit comments

Comments
 (0)