tastyigniter/ti-ext-user
The core TastyIgniter extension for managing customers and staff, handling authentication, registration, password resets, email verification, and impersonation. Adds automation events and conditions for customer registration and attributes.
Install or upgrade:
composer require tastyigniter/ti-ext-user
php artisan igniter:up
For v4.2.1, update with:
composer update tastyigniter/ti-ext-user
php artisan optimize:clear
v4.2.1 contains bug fixes and searchable-field additions; no new migration is called out in the release notes.
Publish config:
php artisan vendor:publish --provider="TastyIgniter\TiExtUser\Providers\TiExtUserServiceProvider"
Review config/ti-ext-user.php for registration defaults, email settings, password reset expiry, and permissions.
First use case — registration and login: Use the package Blade views or route users through the default auth routes:
@include('ti-ext-user::auth.register')
Check authentication with the package/auth guard:
use TastyIgniter\TiExtUser\Facades\Auth;
if (Auth::check()) {
// User is logged in
}
Admin access:
Log in to /admin and use Users > Customers or Users > Staff to manage accounts through the built-in UI. In v4.2.1, customer search/filtering can use first_name, last_name, email, and telephone where the model query modifier is used.
Quick search smoke test:
Confirm the new searchable fields work in the admin customer list or any package-backed list that uses the Customer query modifier:
use TastyIgniter\TiExtUser\Models\Customer;
$customers = Customer::query()
->search('jane')
->get();
src/Models/Customer.php for the newly declared searchable fields: first_name, last_name, email, telephone./resources/views/vendor/ti-ext-user/ for auth forms and email templates./src/Events/ for lifecycle hooks such as UserRegistered and UserLoggedIn./src/Http/Middleware/ for customer/admin auth behavior.sale_permission.Use the package Blade components or your own controllers with the package models:
@auth
<p>Welcome, {{ Auth::user()->name }}!</p>
@else
@include('ti-ext-user::auth.login')
@endauth
Custom validation can extend the package request:
namespace App\Http\Requests;
use TastyIgniter\TiExtUser\Http\Requests\CustomerRequest as BaseCustomerRequest;
class CustomerRequest extends BaseCustomerRequest
{
public function rules()
{
return array_merge(parent::rules(), [
'custom_field' => 'required|string',
]);
}
}
use TastyIgniter\TiExtUser\Models\Customer;
$customer = Customer::create([
'email' => '[email protected]',
'password' => bcrypt('password123'),
'first_name' => 'John',
'last_name' => 'Doe',
'status' => true,
]);
$customer->assignRole('customer');
The v4.2.1 Customer model declares searchable fields for the package query modifier:
use TastyIgniter\TiExtUser\Models\Customer;
$matches = Customer::query()
->search('555-0100')
->get();
This is most useful for admin customer lists and package-backed filters. For direct field lookups, plain Eloquent remains fine:
$customer = Customer::where('email', $email)->first();
v4.2.1 fixes guest order claiming for legacy rows where customer_id is 0. The claim lookup now scopes by email, preventing a legacy guest-order row from matching the wrong customer. When integrating registration/login with order history, keep the claim flow keyed to the same email address used on the order:
$customer = Customer::where('email', $request->email)->first();
// The package's claiming flow should now correctly handle legacy customer_id = 0 rows
// by matching on email, not by treating 0 as a wildcard.
Do not write custom blanket updates such as where('customer_id', 0)->update(...); scope legacy guest-order claiming by email.
sale_permissionv4.2.1 adds the missing sale_permission validation rule. If you override or replace the admin user form request, preserve that rule:
public function rules()
{
return array_merge(parent::rules(), [
// your custom rules
]);
}
Ensure the field is present in the submitted payload and allowed by your form. Without the rule, the permission value may not be validated or stored correctly.
Admins can impersonate users for debugging:
use TastyIgniter\TiExtUser\Facades\Auth;
$customer = \TastyIgniter\TiExtUser\Models\Customer::find(1);
Auth::impersonate($customer);
// Later
Auth::endImpersonation();
Hook into lifecycle events for onboarding or auditing:
use TastyIgniter\TiExtUser\Events\UserRegistered;
UserRegistered::listen(function (UserRegistered $event) {
\Log::info("New user registered: {$event->user->email}");
});
Use the package models with your API auth stack:
use Illuminate\Support\Facades\Hash;
use TastyIgniter\TiExtUser\Models\Customer;
$customer = Customer::where('email', $request->email)->first();
if ($customer && Hash::check($request->password, $customer->password)) {
$token = $customer->createToken('auth_token')->plainTextToken;
return response()->json(['token' => $token]);
}
/register.UserRegistered fires; send welcome email or trigger automation.customer_id = 0 are scoped by email, so a guest order is not claimed by an unrelated customer./admin/users/staff./forgot-password./reset-password.config/ti-ext-user.php.resources/views/ti-ext-user/emails/.namespace App\Models;
use TastyIgniter\TiExtUser\Models\Customer as BaseCustomer;
class Customer extends BaseCustomer
{
protected $casts = [
// merge or define custom casts carefully
];
}
resources/lang/.sale_permission along with your custom fields so permission changes are persisted.Searchable fields are not full-text search
first_name, last_name, email, and telephone as searchable fields for the package query modifier.where() queries still require explicit column names and matching strategy.Guest order claiming behavior changed for legacy rows
customer_id = 0 are now scoped by email during claiming.customer_id = 0 as “unclaimed for anyone,” update it to match the package’s email-scoped behavior.Missing sale_permission rule in custom user forms
sale_permission validation so permission changes are stored.Permission/role caching
php artisan cache:clear
php artisan optimize:clear
Impersonation session conflicts
Auth::impersonate($user);
// debug work
Auth::endImpersonation();
Email verification and mail configuration
failed_jobs, application logs, and .env mail settings:
MAIL_MAILER=smtp
MAIL_FROM_ADDRESS=...
Password reset token expiry
config/ti-ext-user.php:
'password_reset' => [
'expire' => 60,
],
Migration conflicts
php artisan igniter:up in an existing database, especially if you have custom user/customer columns.Overriding package requests/controllers
sale_permission rule or future validation changes.use Illuminate\Support\Facades\Event;
use TastyIgniter\TiExtUser\Events\UserRegistered;
Event::listen(UserRegistered::class, function (UserRegistered $event) {
logger()->debug('User registered', [
'id' => $event->user->id,
'email' => $event->user->email,
]);
});
customer_id and email, then confirm the customer email matches exactly. Legacy rows with customer_id = 0 should be claimed only through the email-scoped path.sale_permission is present, validated, and allowed by the form/configuration.php artisan optimize:clear
composer dump-autoload
storage/logs/laravel.log and queue failure tables when notifications or verification emails are not delivered.How can I help you explore Laravel packages today?