telephone field unique
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- VirtualSpy
- Advanced
- Posts: 122
- Joined: 05 Jul 2022, 07:55
telephone field unique
laravel version 9.36.4 , Aimeos version 2022.10.3 and PHP version 8.1.3 (Win)
I have made mandatory to telephone in billing & delivery address so, i want to know how to make telephone field unique like email from address form , means i want every user have diifferent telephone for order booking
I have made mandatory to telephone in billing & delivery address so, i want to know how to make telephone field unique like email from address form , means i want every user have diifferent telephone for order booking
Re: telephone field unique
You can make the telephone field in the users table unique when a new user account is created in the ./setup/default/schema/customer.php of your own Aimeos extension:
During checkout, the customer needs to be logged in to be able to check that. Then, it's done by the database when the customer record is updated after the address step.
Code: Select all
return [
'table' => [
'users' => function ( \Aimeos\Upscheme\Schema\Table $table ) {
$table->unique( ['telephone'], 'unq_usr_telephone' );
},
],
];
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star