Laravel 安装指南

你应该懂得 PHP 网站运行的基础知识,并且有了一个完善的开发环境。

  1. 安装
composer create-project laravel/laravel learnlaravel5 5.2.31

composer create-project laravel/laravel=5.2.* --prefer-dist

  1. 运行
cd learnlaravel5/public
php -S 0.0.0.0:1024

这时候访问 http://127.0.0.1:1024 就是这个样子的

  1. 创建Auth 系统

Laravel 利用 PHP5.4 的新特性 trait 内置了非常完善好用的简单用户登录注册功能,适合一些不需要复杂用户权限管理的系统,例如公司内部用的简单管理系统。

cd ..

在learnlaravel5文件下

php artisan make:auth
Created View: /Applications/MAMP/htdocs/learnlaravel5/resources/views/auth/login.blade.php
Created View: /Applications/MAMP/htdocs/learnlaravel5/resources/views/auth/register.blade.php
Created View: /Applications/MAMP/htdocs/learnlaravel5/resources/views/auth/passwords/email.blade.php
Created View: /Applications/MAMP/htdocs/learnlaravel5/resources/views/auth/passwords/reset.blade.php
Created View: /Applications/MAMP/htdocs/learnlaravel5/resources/views/auth/emails/password.blade.php
Created View: /Applications/MAMP/htdocs/learnlaravel5/resources/views/layouts/app.blade.php
Created View: /Applications/MAMP/htdocs/learnlaravel5/resources/views/home.blade.php
Created View: /Applications/MAMP/htdocs/learnlaravel5/resources/views/welcome.blade.php
Installed HomeController.
Updated Routes File.
Authentication scaffolding generated successfully!

在浏览器输入127.0.0.1:1024

访问 http://fuck.io:1024/login可以看到


参考资料:

2016 版 Laravel 系列入门教程

http://www.golaravel.com/post/2016-ban-laravel-xi-lie-ru-men-jiao-cheng-yi/