Skip to content

Instantly share code, notes, and snippets.

View launch.json
{
"name": "Listen for XDebug on Docker App",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceFolder}"
},
"hostname": "localhost",
"xdebugSettings": {
View docker-compose.yml
laravel.test:
build:
context: ./docker/8.0
dockerfile: Dockerfile
args:
WWWGROUP: "${WWWGROUP}"
XDEBUG: ${SAIL_DEBUG}
image: sail-8.0/app
ports:
- "${APP_PORT:-80}:80"
View php.ini
[XDebug]
zend_extension = xdebug.so
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.discover_client_host = true
xdebug.idekey = VSC
xdebug.client_host = host.docker.internal
xdebug.client_port = 9003
View Dockerfile
FROM ubuntu:20.04
LABEL maintainer="Taylor Otwell"
ARG WWWGROUP
ARG XDEBUG
WORKDIR /var/www/html
ENV DEBIAN_FRONTEND noninteractive
View FormElement.vue
<template>
<div class="form-element">
<div>{{ field.title }}</div>
<slot :field="field"></slot>
<div v-if="empty" class="empty">Must not be empty</div>
</div>
</template>
View CustomForm.vue
<template>
<div>
<FormElement :field="name">
<template v-slot="{field}">
<input v-model="field.value">
</template>
</FormElement>
<FormElement :field="description">
<template v-slot="{field}">
<textarea v-model="field.value"/>
View FormElement.vue
<template>
<div class="form-element">
<div>{{ field.title }}</div>
<slot :value="field.value" :update="update"></slot>
<div v-if="empty" class="empty">Must not be empty</div>
</div>
</template>
View CustomForm.vue
<template>
<div>
<FormElement :field="name">
<template v-slot="{value, update}">
<input :value="value" @input="update">
</template>
</FormElement>
<FormElement :field="description">
<template v-slot="{value, update}">
<textarea :value="value" @input="update"/>
View CustomForm.vue
<template>
<div>
<FormElement :field="name">
<template v-slot="{value}">
<input v-model="value">
</template>
</FormElement>
<FormElement :field="description">
<template v-slot="{value}">
<textarea v-model="value"/>
View FormElement.vue
<template>
<div class="form-element">
<div>{{ field.title }}</div>
<slot :value="field.value"></slot>
<div v-if="empty" class="empty">Must not be empty</div>
</div>
</template>