Giter Club home page Giter Club logo

laravel-nova-algolia's Introduction

Laravel Nova Algolia

Local setup

  1. copy .env.example to .env
  2. add auth.json for Laravel Nova
  3. setup local mysql db called novatest
  4. setup local domain (nova.test) - cd public and valet link nova
  5. add both .env values for Algolia
  6. run composer install
  7. run php artisan migrate:fresh --seed
  8. Login to nova http://nova.test/nova

Username: [email protected] Password: password

DB Design

We have three main models related to the problem:

  • Product
  • Ingredient
  • Merchant

And one pivot table for IngredientProduct

The pivot table has three columns: ingredient_id, product_id, merchant_id The merchant_id is needed for an additional column order_column that will be needed for custom sorting later

Goal

When attaching a product to an ingredient, we need to include the selected merchant from the filter to algolia query, so we only get products from the selected merchant.

  1. Visit http://nova.test/nova/resources/ingredients/1
  2. Select a merchant from the filter e.g. Superstore
  3. Click Attach Product
  4. The searchable product field should only show products from the selected merchant

Possible ways to solve the problem

  • Pass merchant_id from the filter to the attach screen through a query parameter and change the scoutQuery
  • Perfect would be to pass the selected merchant and also replace the search dropdown/select with a custom component, so we could implement Algolias Vue InstantSearch and add all the facet filters in the custom component.

laravel-nova-algolia's People

Contributors

goellner avatar

Watchers

 avatar

Forkers

hspotorno

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.