Blogger Information
Blog 5
fans 0
comment 0
visits 6384
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
laravel框架路由分离
family的博客
Original
720 people have browsed it

laravel5.2框架中文手册地址: https://laravelacademy.org/laravel-docs-5_2

laravel框架安装地址: https://d.laravel-china.org/docs/5.5/installation#installing-laravel

安装好laravel框架之后首先在根目录下的.env(若无.env文件,也有可能是.env.example)进行配置的更改:

无标题_看图王.png

QQ图片20190807150040.png在app/Providers目录下找到RouteServiceProvider.php文件,对其进行一下修改:QQ图片20190807150040.pngQQ图片20190807150327.png

更改此文件时一定要注意app_path()函数中的路径是否正确,否则会报找不到文件的错误。

接着在根目录下创建routes文件夹并在此目录下创建api.php、console.php、web.php,具体代码:

api.php

QQ图片20190807155118.png

console.php

QQ图片20190807155207.png

web.php文件存放定义路由的代码

建议修改完成之后可简单编写一个网页和路由进行验证。

另配置要求:

PHP 版本 >= 5.5.9

PHP 扩展:OpenSSL

PHP 扩展:PDO

PHP 扩展:Mbstring

PHP 扩展:Tokenizer


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post