Laravel Hello World

1. resources/views 下创建一个test view. (test.blade.php)    

Blade view files use the .blade.php file extension and are typically stored in the resources/views directory

2. 更改routes/web.php 里的

Route::get('/', function () {

    return view('welcome');

});

更改 welcome 为 我们的test.

3. 启动服务./artisan serve

4. 查看我们的view.

http://127.0.0.1:8000/

*

The Routes Directory

The routes directory contains all of the route definitions for your application. By default, several route files are included with Laravel: web.php, api.php, console.php and channels.php.

The web.php file contains routes that the RouteServiceProvider places in the webmiddleware group, which provides session state, CSRF protection, and cookie encryption. If your application does not offer a stateless, RESTful API, all of your routes will most likely be defined in the web.php file.

The api.php file contains routes that the RouteServiceProvider places in the apimiddleware group, which provides rate limiting. These routes are intended to be stateless, so requests entering the application through these routes are intended to be authenticated via tokens and will not have access to session state.

The console.php file is where you may define all of your Closure based console commands. Each Closure is bound to a command instance allowing a simple approach to interacting with each command's IO methods. Even though this file does not define HTTP routes, it defines console based entry points (routes) into your application.

The channels.php file is where you may register all of the event broadcasting channels that your application supports.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容