This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Models\User; | |
use Fouladgar\OTP\Exceptions\InvalidOTPTokenException; | |
use Fouladgar\OTP\OTPBroker as OTPService; | |
use Illuminate\Http\Request; | |
use Throwable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use App\Http\Controllers\AuthController; | |
use Illuminate\Support\Facades\Route; | |
Route::controller(AuthController::class)->group(function () { | |
Route::post('/send-otp', 'sendOTP'); | |
Route::post('/validate-otp', 'verifyOTPAndLogin'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Fouladgar\OTP\Contracts\SMSClient; | |
use Fouladgar\OTP\Notifications\Messages\MessagePayload; | |
class SampleSMSClient implements SMSClient | |
{ | |
public function __construct(protected SampleSMSService $SMSService) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use Fouladgar\OTP\Concerns\HasOTPNotify; | |
use Fouladgar\OTP\Contracts\OTPNotifiable; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
use Illuminate\Notifications\Notifiable; | |
class User extends Authenticatable implements OTPNotifiable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
#-------------------------------------------------------------------------- | |
# Image Setup | |
#-------------------------------------------------------------------------- | |
# | |
FROM php:7.4.11-fpm-alpine | |
LABEL maintainer="Fouladgar < [email protected] >" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Auth\Events\Registered; | |
// Register user | |
event(new Registered($user)); | |
//... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
'sms_client' => App\SampleSMSClient::class, | |
//... | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Fouladgar\MobileVerification\Contracts\SMSClient; | |
use Fouladgar\MobileVerification\Notifications\Messages\Payload; | |
class SampleSMSClient implements SMSClient | |
{ | |
protected $SMSService; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Fouladgar\MobileVerification\Contracts\MustVerifyMobile as IMustVerifyMobile; | |
use Fouladgar\MobileVerification\Concerns\MustVerifyMobile; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
use Illuminate\Notifications\Notifiable; | |
class User extends Authenticatable implements IMustVerifyMobile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Fouladgar\EloquentBuilder\EloquentBuilder; | |
use App\Models\User; | |
$users = app(EloquentBuilder) | |
->setFilterNamespace('Domains\\User\\Filters') | |
->model(User::class) | |
->filters(request()->filters) | |
->thenApply() |
NewerOlder