PHP code example of kim / activity

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

    

kim / activity example snippets


php artisan session:table

php artisan migrate

php artisan vendor:publish --provider="Kim\Activity\ActivityServiceProvider" --tag="migrations"

php artisan migrate

// Import at the top
use Activity;


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

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