PHP code example of lcloss / simple-auth

1. Go to this page and download the library: Download lcloss/simple-auth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lcloss / simple-auth example snippets


    // app\Providers\FortifyServiceProvider.php
    public function boot(): void
    {
        /* Login */
        Fortify::loginView(function () {
            return view( config('simple-auth.views.login') );
        });

        /* Register */
        Fortify::registerView(function () {
            return view(config('simple-auth.views.register'));
        });

        // Forgot Password view
        Fortify::requestPasswordResetLinkView(function () {
            return view(config('simple-auth.views.forgot-password'));
        });

        // Reset password view
        Fortify::resetPasswordView(function ($request) {
            return view(config('simple-auth.views.reset-password'), ['request' => $request]);
        });

        // Verify email view
        Fortify::verifyEmailView(function () {
            return view(config('simple-auth.views.verify-email'));
        });

        // Confirm password view
        Fortify::confirmPasswordView(function () {
            return view(config('simple-auth.views.confirm-password'));
        });
   
    

    // app/Actions/Fortify/CreateNewUser.php
        Validator::make($input, [
            'first_name' => ['ired',
                'string',
                'email',
                'max:255',
                Rule::unique(User::class),
            ],
            'password' => $this->passwordRules(),
            'password_confirmation' => ['

    // config/app.php
    'providers' => [
        // ...
        App\Providers\FortifyServiceProvider::class,
    ],
    
bash
    php artisan vendor:publish --provider="Lcloss\SimpleAuth\SimpleAuthServiceProvider"
    
bash
    php artisan vendor:publish --provider="Laravel\Fortify\FortifyServiceProvider"
    
bash
    php artisan migrate --seed