> For the complete documentation index, see [llms.txt](https://skaleptyltd.gitbook.io/build-solution/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://skaleptyltd.gitbook.io/build-solution/product-guides/system/logs.md).

# Logs

{% hint style="info" %}
Users have the ability to view the log of activities that the system maintains, which records all actions performed by each user.
{% endhint %}

{% tabs %}
{% tab title="Navigation to Logs" %}

* Login as an Admin > System > Logs\ <br>

  <figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2F8e900mgwCdzPH8Z4oSqv%2Fimage.png?alt=media&amp;token=a094bbcc-75da-4ed9-9946-fcb2d39802e6" alt=""><figcaption></figcaption></figure>

{% endtab %}

{% tab title="Functionality" %}

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FdIMHSJEFN3BV6e5Cpi1p%2Fimage.png?alt=media&amp;token=7e24bad0-d7b1-4f5b-afaa-c82ff242e18f" alt=""><figcaption></figcaption></figure>

If the toggle filter is enabled, users can filter the activity log specifically by the salesperson.&#x20;

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2Fg8kcViutXWarl9wpDAkQ%2Fimage.png?alt=media&amp;token=dedb0de0-d8e7-4d5d-b23a-98f643968277" alt=""><figcaption></figcaption></figure>

Additionally, users can search through the logs using a regular grid search function. Users have the ability to sort the logs based on each column.

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FuAnMpE82JtCRwGtErwGy%2Fimage.png?alt=media&amp;token=bdabec54-dc38-4a5c-8294-c34838041fcf" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Database tables & queries" %}
Here are the database tables related to logs:

* users
* activities
* jobs
* job\_types

### Queries

***Used left join query with above mention tables***

```sql
$logs = Activity::leftJoin('users', 'activities.user_id', '=', 'users.id')
->leftJoin('jobs', 'activities.job_id', '=', 'jobs.id')
->leftJoin('job_types', 'jobs.job_type_id', '=', 'job_types.id')
->select(['subject', 'activities.as_at', 'users.name as user', 'url', 'jobs.id as jobs_id', 'jobs.address as job_address' , 'job_types.name as job_type_name']);
```

{% endtab %}

{% tab title="Paths" %}

### Function Path&#x20;

```
app/Helpers/ActivityHelper.php -> log()
```

{% endtab %}
{% endtabs %}
