Partial Reloads
Introduction
The Table component leverages the Partial Reload feature of Inertia.js to reload only the Table data when the state changes, not all other props of the page. This should lead to less data transfer and faster response times.
Include props to reload
If you want to override this behavior and include other props in the partial reload, you can do so by calling the reloadProps()
method on the Table instance. You may pass a string or an array of strings to include additional props in the partial reload.
public function render()
{
return inertia('Users', [
'users' => Users::make()->reloadProps('roles'),
'roles' => Role::all(),
]);
}
If you have more than one prop and you want to include all of them in the reload, you can use the reloadAllProps
method.
Users::make()->reloadAllProps();
Always reload all props
If you want to always reload all props when a Table state changes, you can use the static alwaysReloadAllProps
method on the Table class. For example, in your AppServiceProvider
:
use InertiaUI\Table\Table;
Table::alwaysReloadAllProps();