<?php
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
//直接调用视图模板
Route::get('/', function () {
return view('welcome.welcome');
});
//调用控制器中的方法
Route::get('test1','PeopelController@say');
Route::get('name','User@getName');
//直接在路由中使用某个方法
Route::get('hello',function (){
return '你好';
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
//
});

Laravel创建Route的更多相关文章

  1. laravel named route

    laravel中一般对于路由的使用方法是在routes.php中定义一个路由,在view中如果要引用一个url则直接通过<a href="url/">来使用. 但是随着 ...

  2. laravel创建新model数据的两种方法

    laravel中的CRUD操作中,通过对代表数据表中row的model对象操作,来更新数据库表. 对于创建新的row的操作,有两种功能上相同的方法: 1.create: $user = User::c ...

  3. Laravel创建Model

    它已被用于CI框架.最近学习使用Laravel框架,要总结一些遇到的问题是一个创纪录,供以后调用.此外,我希望能够碰到同样的问题的朋友的帮助. 在Laravel数据库表是根据Laravel写好的程序去 ...

  4. laravel创建定时任务

    官方文档给出的教程已经很详细了,这里给出一些补充帮助大家理解. 英文文档:https://laravel.com/docs/5.2/scheduling 中文文档:https://laravel-ch ...

  5. [Laravel] 02 - Route and MVC

    前言 一.良心资料 英文 Laravel 框架:https://laravel.com/ 教程:https://laracasts.com/series/ laravel-from-scratch-2 ...

  6. Laravel创建模型

    laravel中创建模型 <?php /** * Created by PhpStorm. * 新建模型 * User: chuang * Date: 17-1-15 * Time: 上午9:1 ...

  7. Laravel创建项目和安装PHPStorm IDE插件

    一.win10下安装composer1.下载composer.phar,放入php的安装目录https://getcomposer.org/download/1.4.2/composer.phar 2 ...

  8. laravel 创建授权策略

    用户只能编辑自己的资料 在完成对未登录用户的限制之后,接下来我们要限制的是已登录用户的操作,当 id 为 1 的用户去尝试更新 id 为 2 的用户信息时,我们应该返回一个 403 禁止访问的异常.在 ...

  9. Laravel 创建数据库

    1.根目录输入 php artisan migrate 2.创建表 php artisan migrate:make create_authors_table --table authors --cr ...

随机推荐

  1. 理解JS里的偏函数与柯里化

    联系到上篇博客讲的bind完整的语法为: let bound = func.bind(context, arg1, arg2, ...); 可以绑定上下文this和函数的初始参数.举例,我们有个乘法函 ...

  2. Python 自用代码(某方标准类网页源代码清洗)

    用于mongodb中“标准”数据的清洗,数据为网页源代码,须从中提取: 标准名称,标准外文名称,标准编号,发布单位,发布日期,状态,实施日期,开本页数,采用关系,中图分类号,中国标准分类号,国际标准分 ...

  3. Android EditText输入字数限制总结(包含中文输入内存溢出的解决方法)

    转载请注明,大飞:http://blog.csdn.net/rflyee/article/details/38856539 限定EditText输入个数的解决方式非常多,可是一般主要考虑两点.也就是处 ...

  4. 使用网桥模式(bridge networking mode)配置KVM-QUME虚拟机网络

    (1)linux要工作在网桥模式,所以必须安装两个RPM包.即:bridge-utils和tunctl.它们提供所需的brctl.tunctl命令行工具.能够使用yum在线安装: [root@serv ...

  5. Mycat探索之旅(5)----常用的分片规则

    分片枚举 通过在配置文件中配置可能的枚举id,自己配置分片,本规则适用于特定的场景,比如有些业务需要按照省份或区县来做保存, 而全国省份区县固定的,这类业务使用本条规则,配置如下: <table ...

  6. re中match和search的不同

    re.match与re.search的区别:re.match只匹配字符串的开始,如果字符串开始不符合正则表达式,则匹配失败,函数返回None:而re.search匹配整个字符串,直到找到一个匹配.

  7. Android 必知必会 - 依据包名推断 App 执行状态

    假设移动端訪问不佳,请訪问: 掘金版 Github 版 获取指定包名的 APP 是否还在后台执行,推断 APP 是否存活. 背景 能够依据 App 是否有 Service 分两类情况处理: 没有 Se ...

  8. LeetCode——Anagrams

    Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be ...

  9. Problem-1001:Sum Problem

    Sum Problem Sample code : #include <stdio.h> int main() { int i,n; int sum; while(scanf(" ...

  10. SVN钩子 之 pre-commit

    http://files.cnblogs.com/lyl6796910/pre-commit%E9%92%A9%E5%AD%90.rar 我用的是Windows版本的SVN:VisualSVN Ser ...