laravel-nested-menu
Fetches menu items from a JSON URL specified in .env (MENU_ITEMS_URL
) on an hourly basis. You may also run a manual fetch using artisan fetch:menu-items
. Only items which are not currently stored in the database will be imported.
Setting Up
Laravel Sail is used for local development. Sail uses Docker so you will need to make sure you have that installed (specifically, Docker Desktop). The .env.example
is already configured for Laravel Sail.
- Clone the repo and navigate to it in your terminal.
- Run this in your terminal to pull in the composer dependencies:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/opt \
-w /opt \
laravelsail/php80-composer:latest \
composer install --ignore-platform-reqs
- Run
sail up
(add-d
for detached mode) - Run a frontend build using
sail yarn prod
- Run a manual fetch using
sail artisan fetch:menu-items
You'll need to run a queue worker in order to have the items be fetched hourly.