Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 30 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ To get started, require the package via Composer:
composer require wire-elements/spotlight
```

Spotlight ships its JavaScript and CSS as static files that need to be published to your `public` directory, similar
to how FilamentPHP publishes its assets. Run the following command after installing (and again after every package
update):

```shell
php artisan spotlight:assets
```

You can also publish them via the standard `vendor:publish` command using the `livewire-ui-spotlight-assets` tag:

```shell
php artisan vendor:publish --tag=livewire-ui-spotlight-assets
```

To avoid forgetting this step after every `composer update`, add the command to the `post-autoload-dump` script in your
application's `composer.json`:

```json
"scripts": {
"post-autoload-dump": [
"@php artisan spotlight:assets"
]
}
```

## Livewire directive

Add the Livewire directive `@livewire('livewire-ui-spotlight')`:
Expand Down Expand Up @@ -322,7 +347,7 @@ class CreateUser extends SpotlightCommand

## Configuration

You can customize Spotlight via the `livewire-ui-spotlight.php` config file. This includes some additional options like including CSS if you don't use TailwindCSS for your application. To publish the config run the `vendor:publish` command:
You can customize Spotlight via the `livewire-ui-spotlight.php` config file. To publish the config run the `vendor:publish` command:

```shell
php artisan vendor:publish --tag=livewire-ui-spotlight-config
Expand Down Expand Up @@ -365,27 +390,14 @@ return [

/*
|--------------------------------------------------------------------------
| Include CSS
|--------------------------------------------------------------------------
|
| Spotlight uses TailwindCSS, if you don't use TailwindCSS you will need
| to set this parameter to true. This includes the modern-normalize css.
|
*/
'include_css' => false,

/*
|--------------------------------------------------------------------------
| Include JS
| Show results without input
|--------------------------------------------------------------------------
|
| Spotlight will inject the required Javascript in your blade template.
| If you want to bundle the required Javascript you can set this to false
| run `npm install --save fuse.js` and add `require('vendor/wire-elements/spotlight/resources/js/spotlight');`
| to your script bundler like webpack.
| Whether to show command search results without
| having to type anything in the search input.
|
*/
'include_js' => true,
'show_results_without_input' => false,
];
```

Expand Down
27 changes: 0 additions & 27 deletions config/livewire-ui-spotlight.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,6 @@
\LivewireUI\Spotlight\Commands\Logout::class
],

/*
|--------------------------------------------------------------------------
| Include CSS
|--------------------------------------------------------------------------
|
| Spotlight uses TailwindCSS, if you don't use TailwindCSS you will need
| to set this parameter to true. This includes the modern-normalize css.
|
*/
'include_css' => false,


/*
|--------------------------------------------------------------------------
| Include JS
|--------------------------------------------------------------------------
|
| Spotlight will inject the required Javascript in your blade template.
| If you want to bundle the required Javascript you can set this to false,
| call 'npm install fuse.js' or 'yarn add fuse.js',
| then add `require('vendor/wire-elements/spotlight/resources/js/spotlight');`
| to your script bundler like webpack.
|
*/
'include_js' => true,

/*
|--------------------------------------------------------------------------
| Show results without input
Expand All @@ -68,5 +42,4 @@
|
*/
'show_results_without_input' => false,

];
4 changes: 0 additions & 4 deletions mix-manifest.json

This file was deleted.

Loading