1. Go to this page and download the library: Download andyantunes/helper-commands 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/ */
andyantunes / helper-commands example snippets
public function created(MyModel $myModel): void
{
$action = "Criou o myModel de ID: {$myModel->id}";
LogActivity::setAction($action)
->create();
}
public function updated(MyModel $myModel): void
{
$action = "Atualizou o myModel de ID: {$myModel->id}";
LogActivity::setAction($action)
->create();
}
public function deleted(MyModel $myModel): void
{
$action = "Deletou o myModel de ID: {$myModel->id}";
LogActivity::setAction($action)
->create();
}
public function restored(MyModel $myModel): void
{
$action = "Restaurou o myModel de ID: {$myModel->id}";
LogActivity::setAction($action)
->create();
}
public function forceDeleted(MyModel $myModel): void
{
$action = "Removeu o myModel de ID: {$myModel->id}";
LogActivity::setAction($action)
->create();
}