Skip to content

Installation

Before installing Scoutify, ensure your application meets these requirements:

  • PHP ^8.1
  • Laravel ^10 | ^11 | ^12
  • Livewire ^3 | ^4
  • Laravel Scout ^11

Install the package via Composer:

Terminal window
composer require matheusmarnt/scoutify

Run the installation command to set up the necessary configuration and dependencies:

Terminal window
php artisan scoutify:install

This command will:

  1. Prompt you to choose a Scout driver (Meilisearch, Algolia, or Typesense).
  2. Install the required Composer packages for the chosen driver.
  3. Publish the configuration files (config/scoutify.php and config/scout.php).
  4. Set the SCOUT_DRIVER in your .env file.

If you need to publish the configuration file manually:

Terminal window
php artisan vendor:publish --tag=scoutify-config

The scoutify:install command automatically adds the necessary @import to your resources/css/app.css file.

If you’re setting up manually or using a different CSS file, ensure you have the following import:

@import 'tailwindcss';
@import "../../vendor/matheusmarnt/scoutify/resources/css/scoutify.css";

Add the global search modal component to your root layout (usually layouts/app.blade.php), preferably at the end of the <body> tag, after the main content slot:

{{-- resources/views/layouts/app.blade.php --}}
{{ $slot }}
<livewire:scoutify::modal />
@livewireScripts