Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Fix route of apiResource of user #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Http/Controllers/API/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ public function store(Request $request)
'password' => 'required|string|min:6'
]);

return User::create([
return User::create(array_filter([
'name' => $request['name'],
'email' => $request['email'],
'type' => $request['type'],
'bio' => $request['bio'],
'photo' => $request['photo'],
'password' => Hash::make($request['password']),
]);
]));


}
Expand Down
2 changes: 1 addition & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
return $request->user();
});

Route::apiResources(['user' => 'API\UserController']);
Route::apiResource('user', 'API\UserController');
Route::get('profile', 'API\UserController@profile');
Route::get('findUser', 'API\UserController@search');
Route::put('profile', 'API\UserController@updateProfile');
Expand Down