从头到尾构建 Laravel 5.2 应用程序的指南。
A small CRUD application kept current with the framework: articles, authors, a recommendation mailer and a weather widget, wired the way a Laravel 13 app is wired today.
https://github.com/jp7io/laravel-apz/wiki
https://www.youtube.com/watch?v=AKFoJ2YDPmI&list=PLFEMeqXSeh3xpnSCvL66t87_LcTNYOoFL (portuguese only)
fetch, with no frontend frameworkcomposer setup
php artisan servecomposer setup installs both dependency sets, writes a .env, creates the sqlite database,
migrates it and builds the assets. The app answers on http://localhost:8011.
Seed it with something to look at:
php artisan db:seedTwo optional keys in .env. Without either one the app works and the feature it drives stays out
of the way, rather than failing:
| Key | What it turns on |
|---|---|
OPENWEATHER_KEY |
the temperature in the navbar |
RECAPTCHA_SITE_KEY / RECAPTCHA_SECRET_KEY |
reCAPTCHA v2 on every form |
composer dev # serve + queue worker + vite, together
composer test # PHPUnit
composer analyse # PHPStan
composer format # Pint
npm run e2e:all # Playwright, boots the app itselfBrowser tests need Chromium once: npx playwright install chromium. .npmrc sets
ignore-scripts=true, so npm will not fetch it for you.
Testing is documented in tests/README.md.
One image, three roles: the web server, a queue worker and the scheduler. FrankenPHP serves
public/ itself, so there is no php-fpm and no nginx.
APP_KEY=$(php artisan key:generate --show) docker compose up -d --buildThe app answers on http://localhost:8012 (APP_PORT to move it). APP_KEY is required and comes
from the environment, never from a file in the image; the sqlite database lives on a named volume
outside /app, because a volume mounted over /app/database would shadow migrations/.
The image installs --no-dev, so db:seed will not run there: factories need fakerphp/faker.
That is the point of a production image, not a limitation to work around.
The queue is database by default. predis/predis ships with the app, so switching to Redis is
QUEUE_CONNECTION=redis in .env and a worker.
php artisan serve is pinned to 8011 through SERVER_PORT and fails rather than sliding onto a
neighbouring port, which would otherwise shadow another application on the same machine.
暂无开放 Issues,或尚未同步最近议题。