+ Update fetch identification
This commit is contained in:
parent
d6ac8c0e5e
commit
9fe2fcdcf0
|
@ -78,10 +78,18 @@ class UserController extends Controller
|
|||
return $this->successResponse(trans('messages.validated_identification'));
|
||||
}
|
||||
|
||||
public function fetchIdentification($user_phone)
|
||||
public function fetchIdentification($id_user)
|
||||
{
|
||||
$user = User::where('phone', $user_phone)->firstOrFail();
|
||||
return Identification::where('id_user', $user->id)->firstOrFail();
|
||||
// return Identification::where('id_user', $id_user)->firstOrFail();
|
||||
$identification = Identification::where('id_user', $id_user)->first();
|
||||
$data['isIdentified'] = false;
|
||||
$data['isIdentifiedValidated'] = false;
|
||||
$data['data'] = $identification;
|
||||
if($identification){
|
||||
$data['isIdentified'] = true;
|
||||
$data['isIdentifiedValidated'] = $identification->status == 1 ;
|
||||
}
|
||||
return $this->successResponse($data);
|
||||
}
|
||||
|
||||
public function verifyIdentification($user_phone)
|
||||
|
|
|
@ -10,6 +10,7 @@ return [
|
|||
'canceled_transaction' => 'Canceled transaction',
|
||||
'successful_identification'=>'User :name has been successfully identified.',
|
||||
'user_identificated' => 'User already identificated',
|
||||
'user_not_identificated' => 'User is not identificated',
|
||||
'validated_identification'=>'Validated identification',
|
||||
'identification_already_validated'=>'Identification already validated',
|
||||
'successful_identification_message' => 'Hi :name,
|
||||
|
|
|
@ -11,6 +11,7 @@ return [
|
|||
'successful_identification' => 'L\'utilisateur :name a été identifié avec succes',
|
||||
'validated_identification' => 'Identification validée',
|
||||
'user_identificated' => 'Utilisateur déjà identifié',
|
||||
'user_not_identificated' => 'Utilisateur non identifié',
|
||||
'identification_already_validated' => 'Identification deja validée',
|
||||
'successful_identification_message' => 'Salut :name,
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ $router->group(['prefix' => '/wallets'] , function () use ($router){
|
|||
$router->group(['prefix' => '/identifications'] , function () use ($router){
|
||||
$router->post('','UserController@identification');
|
||||
$router->post('{id_identification}','UserController@validateIdentification');
|
||||
$router->get('{user_phone}','UserController@fetchIdentification');
|
||||
$router->get('{id_user}','UserController@fetchIdentification');
|
||||
$router->get('verify/{user_phone}','UserController@verifyIdentification');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue