+ Add card rattachement
This commit is contained in:
parent
5d29d3e6b2
commit
cf9419b474
|
@ -121,6 +121,22 @@ class UserController extends Controller
|
|||
return $randomString;
|
||||
}
|
||||
|
||||
public function rattachCard(Request $request , $id_user){
|
||||
$this->validate($request, [
|
||||
// 'id_user' => 'required|integer|min:0|not_in:0',
|
||||
'numero_carte'=>'required',
|
||||
'expiration_date'=>'required_if:facade,front|date_format:m/y|after_or_equal:today',
|
||||
]);
|
||||
$user = User::findOrFail($id_user);
|
||||
$user->numero_carte = $request->numero_carte;
|
||||
$expiration_date = \DateTime::createFromFormat('m/y', $request->expiration_date);
|
||||
if (!$expiration_date)
|
||||
$expiration_date = new \DateTime();
|
||||
$user->expiration_date = $expiration_date;
|
||||
$user->save();
|
||||
return $this->successResponse(trans('messages.successful_card_attachment'));
|
||||
}
|
||||
|
||||
public function uploadImage(Request $request , $key , $imageCode, $folderName)
|
||||
{
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ class WalletController extends Controller
|
|||
|
||||
// Wallets users iLink
|
||||
public function showWalletUser($id_user){
|
||||
$wallet = collect(DB::select('SELECT wu.* , u.user_code from wallets_users wu
|
||||
$wallet = collect(DB::select('SELECT wu.* , u.user_code , u.numero_carte , u.expiration_date from wallets_users wu
|
||||
INNER JOIN users u ON u.id = wu.idUser WHERE wu.idUser = :id_user',['id_user' => $id_user]))->first();
|
||||
if($wallet){
|
||||
$wallet->country = 'Gabon';
|
||||
|
|
|
@ -20,6 +20,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @property string $phone
|
||||
* @property string $email
|
||||
* @property string $user_code
|
||||
* @property string $numero_carte
|
||||
* @property Carbon $expiration_date
|
||||
* @property string $adresse
|
||||
* @property float $solde
|
||||
* @property string $encrypted_password
|
||||
|
@ -37,50 +39,53 @@ use Illuminate\Database\Eloquent\Model;
|
|||
*/
|
||||
class User extends Model
|
||||
{
|
||||
protected $table = 'users';
|
||||
public $timestamps = false;
|
||||
protected $table = 'users';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'solde' => 'float',
|
||||
'active' => 'int',
|
||||
'network_id' => 'int'
|
||||
];
|
||||
protected $casts = [
|
||||
'solde' => 'float',
|
||||
'active' => 'int',
|
||||
'network_id' => 'int'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'date_modified',
|
||||
'date_created'
|
||||
];
|
||||
protected $dates = [
|
||||
'expiration_date',
|
||||
'date_modified',
|
||||
'date_created'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'encrypted_password'
|
||||
];
|
||||
protected $hidden = [
|
||||
'encrypted_password'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'uid',
|
||||
'firstname',
|
||||
'lastname',
|
||||
'phone',
|
||||
'email',
|
||||
protected $fillable = [
|
||||
'uid',
|
||||
'firstname',
|
||||
'lastname',
|
||||
'phone',
|
||||
'email',
|
||||
'user_code',
|
||||
'adresse',
|
||||
'solde',
|
||||
'encrypted_password',
|
||||
'salt',
|
||||
'validation_code',
|
||||
'active',
|
||||
'date_modified',
|
||||
'date_created'
|
||||
];
|
||||
'numero_carte',
|
||||
'expiration_date',
|
||||
'adresse',
|
||||
'solde',
|
||||
'encrypted_password',
|
||||
'salt',
|
||||
'validation_code',
|
||||
'active',
|
||||
'date_modified',
|
||||
'date_created'
|
||||
];
|
||||
|
||||
public function identifications()
|
||||
{
|
||||
return $this->hasMany(Identification::class, 'idUser');
|
||||
}
|
||||
public function identifications()
|
||||
{
|
||||
return $this->hasMany(Identification::class, 'id_user');
|
||||
}
|
||||
|
||||
public function wallets_users()
|
||||
{
|
||||
return $this->hasMany(WalletsUser::class, 'idUser');
|
||||
}
|
||||
public function wallets_users()
|
||||
{
|
||||
return $this->hasMany(WalletsUser::class, 'idUser');
|
||||
}
|
||||
|
||||
public function network()
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@ return [
|
|||
'user_not_identificated' => 'User is not identificated',
|
||||
'validated_identification'=>'Validated identification',
|
||||
'identification_already_validated'=>'Identification already validated',
|
||||
'successful_card_attachment' => 'Attachment of your card made',
|
||||
'successful_identification_message' => 'Hi :name,
|
||||
|
||||
Your identification has been taken into account. Contact an iLink World agent with your ID to validate your identity.
|
||||
|
|
|
@ -15,6 +15,7 @@ return [
|
|||
'user_identificated' => 'Utilisateur déjà identifié',
|
||||
'user_not_identificated' => 'Utilisateur non identifié',
|
||||
'identification_already_validated' => 'Identification deja validée',
|
||||
'successful_card_attachment' => 'Rattachement de votre carte effectuée',
|
||||
'successful_identification_message' => 'Salut :name,
|
||||
|
||||
Votre identification a été prise en compte . Rapprochez vous auprès d\'un agent iLink World muni de votre pièce d\'identité pour faire valider de votre identité.
|
||||
|
|
|
@ -62,5 +62,6 @@ $router->group(['prefix' => '/identifications'] , function () use ($router){
|
|||
$router->post('{id_identification}','UserController@validateIdentification');
|
||||
$router->get('{user_phone}','UserController@fetchIdentification');
|
||||
$router->get('verify/{user_phone}','UserController@verifyIdentification');
|
||||
$router->post('rattach_card/{id_user}', 'UserController@rattachCard');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue