Logo Beartropy Tables

Beartropy Tables

Table State Handler
Save and restore table configuration state.

About State Handler

The State Handler allows storing the user's table configuration (like visible columns) in the database, ensuring their preferences persist across sessions.

Note: This requires a database table yat_user_table_config to exist.

1use Illuminate\Support\Facades\Auth;
2 
3$this->useStateHandler(Auth::check());

Enable State Handler

useStateHandler(bool $bool): Enable the state handler.

1$this->useStateHandler(true);

Warning: Auth required

The state handler requires authentication to work since it stores the user's configuration in the database. You can set the handler to check for auth in order to intialize it.

1use Illuminate\Support\Facades\Auth;
2 
3$this->useStateHandler(Auth::check());

Custom Prefix

By default the prefix is the table name. You can change it with setHandlerPrefix(string $prefix).

1$this->setHandlerPrefix('my_table_prefix');