DB_ROOT_PASSWORD=secret
./xc install
DB_HOST
- your docker-compose database service name (mysql
by default)- other database-related variables
Without assets compiling and HMR:
./xc up
With automatic assets compiling and frontend hot reloading (see HMR setup instructions below):
./xc uphmr
You can use any of the docker compose commands parameters with ./xc
. For example, to run Laravel app in detached mode:
./xc up -d
You can run any artisan command with ./xc artisan {command}
, e.g.:
./xc artisan make:controller UploadController
Before you run artisan command, make sure that Laravel's service is running.
Run migrations
./xc artisan migrate
You can run any composer command with ./xc composer {command}
, e.g.:
./xc composer require nunomaduro/phpinsights --dev
Your can run any Node.js command witn ./xc node {command}
. Note that node
is a Docker Compose's service name, you shouls always preface Node.js commands with it. Examples:
Install dependencies:
./xc node npm install
Build assets:
./xc node npm run build
laravel/vite.config.js
// ...
export default defineConfig({
plugins: [
// ...
],
server: {
hmr: {
host: "localhost", // or "your-local-domain.test"
},
},
});
laravel/resources/vuews/layouts/main.blade.php
<!doctype html>
<head>
{{-- ... --}}
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>