Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation for your next big idea — freeing you to create without sweating the small things.
📊 Project Info
- Language
- Blade
- Stars
- ⭐ 84,356
- Forks
- 24,734
- Today
- +6
- Ranking
- #2
- Collection
- Language
- Trending Date
- June 3, 2026
- Last Push
- 6/3/2026
🏷️ Topics
Laravel 5分钟快速开始
Laravel 是一个优雅的 PHP Web 框架,本指南将帮助你在5分钟内创建并运行一个 Laravel 应用。
🖥️ OS
⚙️ Runtime
🔧 Tools
📝 Steps
安装 Laravel 项目
使用 Composer 创建一个新的 Laravel 项目
创建名为 example-app 的 Laravel 项目
$ composer create-project laravel/laravel example-app进入项目目录
切换到新创建的项目文件夹
进入项目目录
$ cd example-app启动开发服务器
使用 Artisan 命令启动内置 PHP 开发服务器
启动开发服务器,默认监听 8000 端口
$ php artisan serve✅ 验证 Laravel 运行成功
在浏览器中访问 http://127.0.0.1:8000,看到 Laravel 欢迎页面即表示成功。
- ✓浏览器显示 Laravel 默认欢迎页面
- ✓页面包含 'Laravel' 标题和 'Documentation' 等链接
⚡ Quick Tips
🔍 Troubleshooting
❓ Composer 安装缓慢或失败
→ 使用国内镜像:composer config -g repos.packagist composer https://mirrors.aliyun.com/composer/
❓ php artisan serve 提示 'Command not found'
→ 确保 PHP 已添加到系统 PATH,或使用完整路径运行 PHP。
❓ 浏览器访问显示空白页
→ 检查 storage 和 bootstrap/cache 目录是否有写入权限,运行 chmod -R 775 storage bootstrap/cache
🎯 Next Steps
阅读官方文档
访问 https://laravel.com/docs 深入学习
创建路由和控制器
使用 php artisan make:controller 创建控制器,并在 routes/web.php 定义路由