> ## Documentation Index
> Fetch the complete documentation index at: https://docs.advancedtables.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Requirements, purchasing a license, and step-by-step Composer installation instructions for Advanced Tables v3.

Thank you for purchasing Advanced Tables!

Below you'll find extensive documentation on installing and using this plugin. Of course, if you have any questions, find a bug, need support, or have a feature request, please don't hesitate to reach out to me at [advancedtables@gmail.com](mailto:advancedtables@gmail.com).

## Requirements

Advanced Tables requires `PHP 8.1+`, `MySQL 5.7.8+` or `Postgres`, `Filament 3.2.133+`, and `Laravel 10+`.

> Advanced Tables v1 is fully compatible with `Filament v2`. After purchasing a license here, please refer to the [Filter Sets v1](https://filamentphp.com.test/plugins/kenneth-sese-advanced-tables?v=v1#documentation) documentation for installation and usage instructions.

## New Installation

### Purchasing a license

Advanced Tables has partnered with [Privato](https://privato.pub/) to handle payment, licensing, and distribution. After purchase, you will receive an email from Privato with your license key.

### Installing with Composer

To install Advanced Tables you'll need to add the package to your `composer.json` file:

```bash theme={null}
composer config repositories.archilex composer https://advancedtables.privato.pub/composer
```

or

```bash theme={null}
{
    "repositories": [
        {
            "type": "composer",
            "url": "https://advancedtables.privato.pub/composer"
        }
    ],
}
```

Then configure authentication:

```bash theme={null}
composer config --auth http-basic.advancedtables.privato.pub "[license-email]" "[license-key]"
```

Finally, install the package

```bash theme={null}
composer require archilex/filament-filter-sets
```

## Setting up Advanced Tables in Filament Panels (including Relation Managers, Table Widgets, and Panel Pages)

*If using Filament's standalone Table Builder, please refer to the [Filament Table Builder setup instructions](/v3/get-started/installation#setting-up-advanced-tables-in-filament-table-builder)*

1. Publish and run the migrations

   > Important: If you are using a User class other than Laravel's default `User::class` or a user's table other than Laravel's default `users` you should [update these configurations](/v3/configuration/additional-configurations#configuring-the-userclass) **before** migrating.

   ```bash theme={null}
   php artisan vendor:publish --tag="advanced-tables-migrations"
   php artisan migrate
   ```

2. Publish the language files

   Optionally, you may publish the language files:

   ```bash theme={null}
   php artisan vendor:publish --tag="advanced-tables-translations"
   ```

3. Add Advanced Tables to your Filament Panel

   Add Advanced Tables to a panel by instantiating the plugin class and passing it to the `plugin()` method of the configuration:

   ```php theme={null}
   use Archilex\AdvancedTables\Plugin\AdvancedTablesPlugin;

   public function panel(Panel $panel): Panel
   {
       return $panel
           ->plugins([
               AdvancedTablesPlugin::make()
           ])
   }
   ```

4. Add the `HasViews` trait to your `User::class`

   ```php theme={null}
   use Archilex\AdvancedTables\Concerns\HasViews;

   class User
   {
       use HasViews;
   }
   ```

5. Integrate Filter Set's Tailwind and css files

   Filament v3 recommends developers [create a custom theme](https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme) to better support a plugin's additional Tailwind classes. After you have created your custom theme, add Advanced Tables' views to your *new theme's* `tailwind.config.js` file usually located in `resources/css/filament/admin/tailwind.config.js`:

   ```js theme={null}
   content: [
       ...
       './vendor/archilex/filament-filter-sets/**/*.php',
   ],
   ```

   Next, import Advanced Tables's custom stylesheet into your theme's css file:

   ```css theme={null}
   @import '../../../../vendor/archilex/filament-filter-sets/resources/css/plugin.css';
   ```

6. Compile

   Next, compile your theme:

   ```bash theme={null}
   npm run build
   ```

   Finally, run the Filament upgrade command:

   ```bash theme={null}
   php artisan filament:upgrade
   ```

7. Setting up tenancy

   If you are installing Advanced Tables into a multi-tenancy application, please refer to the separate instructions to [set up multi-tenancy](/v3/multi-tenancy/multi-tenancy).

After you've successfully installed Advanced Tables, you may review the [Getting Started guide](/v3/table-builder/getting-started) to learn how to add Advanced Tables to your resources, relation managers, pages, and/or table widgets.

## Setting up Advanced Tables in Filament Table Builder

> If using Filament Panels, please refer to the [Filament Panels setup instructions](#setting-up-advanced-tables-in-filament-panels-including-relation-managers-table-widgets-and-panel-pages).

> Important: Beyond the [normal requirements](/v3/get-started/installation#requirements), using Advanced Tables with Filament Table Builder requires you have some type of user authentication system such as [Laravel Breeze](https://laravel.com/docs/10.x/starter-kits#laravel-breeze) since each view belongs to the currently authenticated user.

1. Publish the config files

   While optional, it is recommended you publish the config file to be able to fully customize Advanced Table. However, If you are using a User class other than Laravel's default `User::class` or a user's table other than Laravel's default `users` you should publish the config file and update these configurations **before** migrating.

   ```bash theme={null}
   php artisan vendor:publish --tag="advanced-tables-config"
   ```

2. Publish the language files

   Optionally, publish the language files:

   ```bash theme={null}
   php artisan vendor:publish --tag="advanced-tables-translations"
   ```

3. Publish and run the migrations

   ```bash theme={null}
   php artisan vendor:publish --tag="advanced-tables-migrations"
   php artisan migrate
   ```

4. Add the `HasViews` trait to your `User::class`

   ```php theme={null}
   use Archilex\AdvancedTables\Concerns\HasViews;

   class User
   {
       use HasViews;
   }
   ```

5. Integrate Advanced Tables's custom css file

   Add the following line to the top of your `app.css` file:

   ```css theme={null}
   @import '../../vendor/archilex/filament-filter-sets/resources/dist/advanced-tables.css';
   ```

6. Compile

   Next, compile your theme:

   ```bash theme={null}
   npm run build
   ```

   Finally, run the Filament upgrade command:

   ```bash theme={null}
   php artisan filament:upgrade
   ```

7. Setting up tenancy

   If you are installing Advanced Tables into a multi-tenancy application, please refer to the separate instructions to [set up multi-tenancy](/v3/multi-tenancy/multi-tenancy).

After you've successfully installed Advanced Tables, you may review the [Getting Started guide](/v3/table-builder/getting-started) to learn how to add Advanced Tables to your tables.

## Deploying

When deploying, it is not advised to store your \`auth.json\`\` file inside your project's version control repository. To store your credentials on your deployment server you may create a [Composer auth.json file](https://getcomposer.org/doc/articles/http-basic-authentication.md) in your project directory using the following command:

```bash theme={null}
composer config http-basic.filament-filter-sets.composer.sh your_account_email your_license_key_including_your_fingerprint_domain
```

> Important: Don't forget to append a colon (:) and your fingerprint domain to your password.

You can see your credentials in your [Anystack account](https://account.anystack.sh/transactions): `Anystack > Transactions > View details` next to Filament Filter Sets.

> Tip: Make sure the `auth.json` file is in `.gitignore` to avoid leaking credentials into your git history.

If you are using Laravel Forge, you don't need to create the `auth.json` file manually. Instead, you can set the credentials on the `Composer Package Authentication` screen of your server.

### Fixing deployment errors

1. The most common mistake when deploying, is not adding the colon (:) followed by the domain you registered. `license_key:domain`. Please review the instructions above.

2. If you have set up everything correctly and are getting the error: `../advanced-tables-for-filament-3.7.29.zip' URL required authentication (HTTP 401). You must be using the interactive console to authenticate` error, you may need to ssh into your server and clear your composer global cache with `composer clear-cache`
