PHP code example of jooservices / laravel-activities

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

    

jooservices / laravel-activities example snippets


use App\Models\Post;
use JOOservices\LaravelActivities\Facades\Activity;

$subject = Post::query()->firstOrFail();

Activity::recordFor(
    subject: $subject,
    activity: 'post.updated',
);
bash
php artisan vendor:publish --tag=activities-config
bash
php artisan activities:ensure-indexes