百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

laravel-apz

> 后端框架
开源

从头到尾构建 Laravel 5.2 应用程序的指南。

316 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

从头到尾构建 Laravel 5.2 应用程序的指南。

Laravel Apz

The guide to build a Laravel app from a to z.

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.

Step-by-Step Tutorial

https://github.com/jp7io/laravel-apz/wiki

Screencast

https://www.youtube.com/watch?v=AKFoJ2YDPmI&list=PLFEMeqXSeh3xpnSCvL66t87_LcTNYOoFL (portuguese only)

Includes

  • Laravel 13 on PHP 8.4.1+
  • Restful CRUD and associations, API first (the same routes answer HTML and JSON)
  • Blade components, form requests and a custom validation rule
  • Ajax CRUD in a native ``, over fetch, with no frontend framework
  • Tailwind 4 built by Vite
  • Queued mailable
  • Scheduled command feeding a cached weather widget
  • Feature and unit tests with PHPUnit, browser tests with Playwright (a full-site sweep plus one script per journey)
  • Pint and PHPStan (level 8) in CI

Getting started

bash
composer setup
php artisan serve

composer 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:

bash
php artisan db:seed

Two 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

Working on it

bash
composer dev               # serve + queue worker + vite, together
composer test              # PHPUnit
composer analyse           # PHPStan
composer format            # Pint

npm run e2e:all            # Playwright, boots the app itself

Browser 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.

Deploy

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.

bash
APP_KEY=$(php artisan key:generate --show) docker compose up -d --build

The 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.

Notes

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· 1 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPlaravelphp

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类后端框架
定价开源

> 相关工具

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架