一、安装
1.cd 到项目文件夹
2.composer create-project --prefer-dist laravel/laravel 项目名
二、启动
在项目里面输入
php artisan serve
(php artisan serve —port=端口号,这样可以指定端口号)
三、文件夹介绍

app:逻辑代码,control、model都是在这里
config:配置文件
database:数据库管理
Public:公开的对外文件
Resources:模板文件
Routes:路由,里面的web.php做网站会经常使用
Storage:日志缓存,需要确保用户对这个文件夹的读写权限
tests:测试用例
vendor:第三方包
composer.json:说明这个项目使用了哪些第三方包
四、修改配置
1.修改.env文件,改成自己的数据库

2.验证
cd到项目目录,输入 php artisan migrate:install,如果出现“Migration table created successfully.”,就代表成功配置,进入数据库会看到

网友评论