PHP code example of lancodev / laravel-logging

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

    

lancodev / laravel-logging example snippets


$model->logs()->create([
    'type' => 'Info',
    'log' => 'lorem ipsum',
]);

$model->logs;

$model->logs()->where('type', 'Info')->get();

Lancodev\LaravelLogging\Models\Log {
  id: 1,
  loggable_type: "App\Models\{SOME_MODEL}",
  loggable_id: 1,
  type: "Info",
  log: "lorem ipsum",
  created_at: "2023-01-01 00:00:00",
  updated_at: "2023-01-01 00:00:00",
},

$log->loggable;****
bash
php artisan vendor:publish --tag="laravel-logging-migrations"
php artisan migrate