PHP code example of asksnbb / active-users

1. Go to this page and download the library: Download asksnbb/active-users 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/ */

    

asksnbb / active-users example snippets


php artisan session:table

php artisan migrate

// Import at the top
use Active;


// Find latest users
$users = Active::users()->get();

// Loop through and echo user's name
foreach ($users as $activity) {
    echo $activity->user->name . '<br>';
}