PHP code example of rorikurniadi / laravel-activator

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

    

rorikurniadi / laravel-activator example snippets

 php
    'providers' => [
        #...
        Rorikurn\Activator\ActivatorServiceProvider::class
    ],

    'aliases' => [
        #...
        'Activator' => 'Rorikurn\Activator\Facades\Activator'
    ]
 bash
php artisan migrate --path="vendor/rorikurniadi/laravel-activator/database/migrations"
 bash
php artisan vendor:publish --force
 php
    # app/Http/Controllers/Auth/RegisterController

    protected function create(array $data)
    {
        // Create User
        $user = User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);

        return Activator::activate($user);
    }