basketin/customers
Composer 安装命令:
composer require basketin/customers
包简介
README 文档
README
Basketin Customers
The customers' module lets you register and manage customers and support Filament.
Documentation
Installation
Install via composer.
composer require basketin/customers
You need to migrate the package tables.
php artisan migrate
How to use
Create New Customer
You can create a new customer using the following code.
<?php use Basketin\Component\Customers\Facades\Customer; $customer = Customer::createNewCustomer( first_name: 'Karim', last_name: 'Mohamed', email: 'karim@mail.com', phone: '01234567899', password: 'password', ); // Return Customer Profile;
Customer Login
<?php use Basketin\Component\Customers\Facades\Customer; $customer = Customer::login('karim@mail.com', 'password') // Return Customer Profile;
Get Customer Via Sanctum
Using the following code, you can get a customer profile by sanctum token from $request.
$customer = $request->customerProfile();
Get Model
$customer->getModel();
Customer Update Data
$customer->updateData( phone: '01234567809', );
Customer Change Password
$customer->changePassword($password, $confirmPassword);
Customer Addresses
$customer->addresses()->all();
Customer Create New Address
$customer->addresses()->create( $label, $countryCode, $cityId, $postcode, $streetLine1, $phoneNumber, $streetLine2 = null, $isMain = null );
Filament Support
You can add customer management to the Filament panel using the following code.
use Basketin\Filament\Customers\BasketinCustomerPlugin; ... ->plugins([ ... new BasketinCustomerPlugin(), ... ]), ...
Contributing
Thank you for considering contributing to this package! Be one of the Store team.
License
This package is an open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 2.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-02