PHPackages                             revosystems/sidecar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. revosystems/sidecar

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

revosystems/sidecar
===================

Laravel report tool

4.1.14(1y ago)026.5k2[1 PRs](https://github.com/revosystems/sidecar/pulls)MITPHPPHP ^8.0

Since Nov 19Pushed 1y ago3 watchersCompare

[ Source](https://github.com/revosystems/sidecar)[ Packagist](https://packagist.org/packages/revosystems/sidecar)[ RSS](/packages/revosystems-sidecar/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (3)Versions (132)Used By (0)

Sidecar
=======

[](#sidecar)

Install
-------

[](#install)

`composer require revosystems/sidecar`

> You need to have `tailwind 2.x` and `apline 3.x` in you main template

Add the blades path to the tailwindcss config file

```
purge: [
    ...
    './vendor/revosystems/sidecar/**/*.blade.php',
  ],

```

And define your brand color like so:

```
theme: {
    extend: {
      colors: {
        'brand': '#F2653A',
      }
    },
  },

```

You should also include the chart.js and choices.js to your main template's header with this line:

```
{!! \Revo\Sidecar\Sidecar::dependencies() !!}

```

### Configuration

[](#configuration)

Publish the configuration tot adapt it to you project

`php artisan vendor:publish`

In `config/sidecar.php` you will find the following parameters that can be adapted for your project

PARAMETERDefault valueDescriptiontranslationsPrefixadminThe prefix it will use for the translations withing the packageroutePrefixsidecarSidecar provides some routes (for the widgets, search, etc..) by default it will be `yourproject.com/sidecar/xxx` you can update the prefix hererouteMiddleware\['web', 'auth', 'reports'\] The middlewares to use in the the custom sidecar routes (for widgets, search, etc...)indexLayoutadmin.reports.layoutThe layout the report view will extend (this one needs to have tailwind and jquery imported)reportsPath\\App\\Reports\\The path where `sidecar` will search for the reportsscripts-stackscriptsSince `sidecar` does some javascript, it will push it to the scripts stack `https://laravel.com/docs/8.x/blade` you layout needs to have the @stack('scripts') definedexportRoutesidecar.report.exportWhen exporting, `sidecar` provides its own route, however if you want to customeize it (for example to use it in a job) you can change the route that will be calledIn `assets/css/sidecar.css` you will find the default styles

You should add those files to your assets compilation.

### Global Variables

[](#global-variables)

You can customize some runtime variables implementing the `serving callback`

```
class AppServiceProvider extends ServiceProvider
    public function boot() {
        Sidecar::$usesMultitenant = true;	// When true, all the caches and jobs will use the `auth()->user()->id` as prefix
	    Sidecar::serving(function(){
	            \Revo\Sidecar\ExportFields\Date::$timezone = auth()->user()->timezone;							// The timezone to display the dates
	            \Revo\Sidecar\ExportFields\Date::$openingTime = auth()->user()->getBusiness()->openingTime;		// To define a day change time instead of 00:00
	            \Revo\Sidecar\ExportFields\Currency::setFormatter('es_ES', auth()->user()->currency ?? 'EUR');	// For the currency field
        });
    }

```

Reports
-------

[](#reports)

To create your report you should create a new file caled `WathereverYouWantReport` (note it needs to end with Report) in the folder you defined in the `reportsPath` of the config file This report class needs to extend the main `Revo\Sidecar\Report` class

And define the main model class and implement the fields method

```
