Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Phone Auth Laravel Package

lee-to/laravel-phone-auth

View on GitHub
Deep Wiki
Context7

laravel-phone-auth

https://youtu.be/UaYx2VgXMEY

Important

  • Need laravel livewire package
  • The default template uses tailwind classes (customize it if you want)

Install

  • install livewire

  • install doctrine/dbal

  • composer require lee-to/laravel-phone-auth

  • php artisan vendor:publish --provider="Leeto\PhoneAuth\Providers\PhoneAuthServiceProvider"

  • configure config/phone_auth.php

Usage

User Model

  • Add PhoneVerification Trait to User Model
use PhoneVerification;
  • Add phone cast to User Model
protected $casts = [
    'phone' => PhoneCast::class
];

Blade component

Auth/Phone verification form

  • Simple
@livewire('phone-verification')
  • Without form wrap
@livewire('phone-verification', ['formWrap' => false])
  • Register new or login if phone verified and exist
@livewire('phone-verification', ['loginAndRegister' => true])

Check phone confirmed

\Leeto\PhoneAuth\Models\ConfirmedPhone::confirmed($phone, $user_id = null);

Components properties (override config)

  • stopEvents (bool) = turn off emitBefore, emitAfter
  • customRedirectTo (bool|array) = redirect after success
  • emptyCustomFields (bool) = disable custom fields
  • customParams (array) = send custom properties to view
<livewire:phone-verification
    :stopEvents="true"
    :customRedirectTo="'/'"
    :emptyCustomFields="true"
    :customParams="['btn' => 'Login', 'title' => 'Login']"
    :formWrap="false"
    :loginAndRegister="true"
/>
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope