1. Go to this page and download the library: Download dekate/model-logger 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/ */
dekate / model-logger example snippets
namespace App\Models;
use Dekate\ModelLogger\LogModel;
use Illuminate\Database\Eloquent\Model;
class MyModel extends Model
{
use LogModel;
/** The rest of the code */
}
class YourModel extends Model
{
use LogModel;
// disable Create log
protected $disableLog = "C";
}
class YourModel extends Model
{
use LogModel;
// disable Create Delete
protected $disableLog = "CD";
}
/** You can change */
$myModel->myRelation()->sync([])
/** To */
$myModel->syncWithRelation('myRelation', []);