diff --git a/docs/start/commands.md b/docs/start/commands.md index 606b57dfc..0529abd06 100644 --- a/docs/start/commands.md +++ b/docs/start/commands.md @@ -1,6 +1,6 @@ --- title: Commands -weight: 5 +weight: 6 --- ## Generating Datatable Components diff --git a/docs/start/configuration.md b/docs/start/configuration.md index 75aef5083..3e264c578 100644 --- a/docs/start/configuration.md +++ b/docs/start/configuration.md @@ -1,6 +1,6 @@ --- title: Configuration -weight: 4 +weight: 5 --- ## Publishing Assets diff --git a/docs/start/including-assets.md b/docs/start/including-assets.md index cbc25cb70..b0c782fe8 100644 --- a/docs/start/including-assets.md +++ b/docs/start/including-assets.md @@ -1,6 +1,6 @@ --- title: Including Assets -weight: 3 +weight: 4 --- ## Package Specific Code diff --git a/docs/start/installation.md b/docs/start/installation.md index d09a68879..11d07fa01 100644 --- a/docs/start/installation.md +++ b/docs/start/installation.md @@ -1,6 +1,6 @@ --- title: Installation -weight: 2 +weight: 3 --- You can install the package via composer: diff --git a/docs/start/recommended.md b/docs/start/recommended.md new file mode 100644 index 000000000..e0b1ca3ff --- /dev/null +++ b/docs/start/recommended.md @@ -0,0 +1,90 @@ +--- +title: Recommended +weight: 2 +--- + +While the package is very customisable, and supports a number of different approaches. The below is the recommended approach, that gives the best performance for the tables: + +## Installation +``` +composer require rappasoft/laravel-livewire-tables +``` + +## Publish the Tables Config +``` +php artisan vendor:publish --tag="livewire-tables-config" +``` + +## Livewire Tables Config Updates +Update the published Livewire Tables Config (config/livewire-tables.php) and set the following to false: +```php + /** + * Cache Rappasoft Frontend Assets + */ + 'cache_assets' => false, + + /** + * Enable or Disable automatic injection of core assets + */ + 'inject_core_assets_enabled' => false, + + /** + * Enable or Disable automatic injection of third-party assets + */ + 'inject_third_party_assets_enabled' => false, + + /** + * Enable Blade Directives (Not required if automatically injecting or using bundler approaches) + */ + 'enable_blade_directives' => false, +``` + +## Bundling the Assets +As you have now told the package not to inject the assets, add the following to your resources/js/app.js file: + +```js +import '../../vendor/rappasoft/laravel-livewire-tables/resources/imports/laravel-livewire-tables-all.js'; +``` + +## Update Layouts +Ensure that your layouts do not reference any of the following blade directives, as these are not required with the above approach +``` + + @rappasoftTableStyles + + + @rappasoftTableThirdPartyStyles + + + @rappasoftTableScripts + + + @rappasoftTableThirdPartyScripts +``` + +## Tailwind Specific +If using Tailwind, you should update your tailwind.config.js file, adding the following to the "content" section under module.exports. This ensures that the Livewire Tables specific core classes are included. + +```js + './vendor/rappasoft/laravel-livewire-tables/resources/views/*.blade.php', + './vendor/rappasoft/laravel-livewire-tables/resources/views/**/*.blade.php', +``` + +It is also recommended to add the paths to any Livewire Tables components, for example: +```js + './app/Livewire/*.php', + './app/Livewire/**/*.php', +``` +So that any classes used in setTdAttributes or similar are included! + +## Run your build process +``` +npm run build +``` + +## Clear Cached Views +``` +php artisan view:clear +``` + +You may of course run view:cache at this point. \ No newline at end of file diff --git a/docs/start/rendering.md b/docs/start/rendering.md index 5931502d1..4e9e1e4fe 100644 --- a/docs/start/rendering.md +++ b/docs/start/rendering.md @@ -1,6 +1,6 @@ --- title: Rendering -weight: 6 +weight: 7 --- ## Rendering Components