PHP code example of creode / laravel-account-approval

1. Go to this page and download the library: Download creode/laravel-account-approval 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/ */

    

creode / laravel-account-approval example snippets


protected $middlewareGroups = [
    'web' => [
        // ...
        \Creode\LaravelAccountApproval\Http\Middleware\AccountActivated::class,
    ],
    // ...
];

namespace App\Http\Middleware;

use Closure;
use Creode\LaravelAccountApproval\Http\Middleware\AccountActivated as BaseAccountActivated;

class AccountActivated extends BaseAccountActivated
{
    /**
     * Handle a failed activation.
     *
     * @param \Illuminate\Http\Request  $request
     * @param \Closure  $next
     *
     * @return mixed
     */
    protected function accountNotActivated(Request $request, Closure $next)
    {
        // Your custom functionality here
    }

    /**
     * Redirect which will happen if the user is not activated.
     *
     * Return null to continue with the request.
     *
     * @param Request $request
     * @param Closure $next
     *
     * @return Response|null
     */
    protected function unverifiedAccountRedirect(Request $request, Closure $next): ?Response
    {
        // Your custom functionality here
    }
}
bash
php artisan vendor:publish --tag="account-approval-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="account-approval-config"
bash
php artisan db:seed --class="Creode\LaravelAccountApproval\Database\Seeders\AccountApprovalSeeder"