PHP code example of alifcoder / activity-log
1. Go to this page and download the library: Download alifcoder/activity-log 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/ */
alifcoder / activity-log example snippets
ActivityLogger::log(new ActivityLogCreateDTO(
log_type: 'custom', // optional: log type
user_id: 1, // optional: user_id
url: 'http://example.com', // optional: URL
method: 'GET', // optional: HTTP method
request_body: '{}', // optional: request body
response_body: '{}', // optional: response body
... // other parameters
));
Route::post('/example', ExampleController::class)->middleware('activity_log');
use Alif\ActivityLog\Facades\FileStorage;
$content = FileStorage::readEncrypted($this->request_body);
$schedule->command('model:prune', [
'--model' => [Alif\ActivityLog\Models\ActivityLog::class],
])->daily();
protected $middleware = [
// ...
\Alif\ActivityLog\Http\Middleware\ActivityLogMiddleware::class,
];
use Illuminate\Support\Facades\Http;
$response = Http::loggable()->get('https://example.com/api/data');
bash
php artisan vendor:publish --tag=activity-log
bash
php artisan migrate
bash
php artisan activity-log:generate-key
bash
php artisan activity-log:sync-ip-details
bash
php artisan activity-log:uninstall