Laravel 5 系列入门教程(四)【最适合中国人的 Laravel 教程】【完结】

2015-3-11   /   阅读数:76799   /   分类: Laravel

本教程示例代码见:https://github.com/johnlui/Learn-Laravel-5  

大家在任何地方卡住,最快捷的解决方式就是去看我的示例代码。

本文是本系列教程的完结篇,我们将一起给 Page 加入评论功能,让游客在前台页面可以查看、提交、回复评论,同时我们将在后台完善评论管理功能,可以删除、编辑评论。Page 和评论将使用 Eloquent 提供的“一对多关系”。最终,我们将得到一个个人博客系统的雏形,并布置一个大作业,供大家实战练习。

1. 初识 Eloquent

Laravel Eloquent ORM 是 Laravel 中非常重要的部分,也是 Laravel 能如此流行的原因之一。中文文档在:

1. http://laravel-china.org/docs/5.0/eloquent

2. http://www.golaravel.com/laravel/docs/5.0/eloquent/

在前面的教程中已经建立好的 learnlaravel5/app/Page.php 就是一个 Eloquent Model 类:

<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Page extends Model {

	//

}

若想进一步了解 Eloquent,推荐阅读系列文章:深入理解 Laravel Eloquent

2. 创建 Comment 模型

首先我们要新建一张表来存储 Comment,命令行运行:

php artisan make:model Comment

成功以后,修改 migration 文件 learnlaravel5/database/migrations/***_create_comments_table.php 的相应位置为:

Schema::create('comments', function(Blueprint $table)
{
	$table->increments('id');
	$table->string('nickname');
	$table->string('email')->nullable();
	$table->string('website')->nullable();
	$table->text('content')->nullable();
	$table->integer('page_id');
	$table->timestamps();
});

之后运行:

php artisan migrate

去数据库里瞧瞧,comments 表已经躺在那儿啦。

3. 建立“一对多关系”

修改 Page 模型:

<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Page extends Model {

  public function hasManyComments()
  {
    return $this->hasMany('App\Comment', 'page_id', 'id');
  }

}

搞定啦~ Eloquent 中模型间关系就是这么简单。

模型间关系中文文档:http://laravel-china.org/docs/5.0/eloquent#relationships

扩展阅读:深入理解 Laravel Eloquent(三)——模型间关系(关联)

4. 前台提交功能

修改 Comment 模型:

<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Comment extends Model {

  protected $fillable = ['nickname', 'email', 'website', 'content', 'page_id'];

}

增加一行路由:

Route::post('comment/store', 'CommentsController@store');

运行以下命令创建 CommentsController 控制器:

php artisan make:controller CommentsController

修改 CommentsController:

<?php namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;

use Redirect, Input;

use App\Comment;

class CommentsController extends Controller {

	public function store()
	{
		if (Comment::create(Input::all())) {
			return Redirect::back();
		} else {
			return Redirect::back()->withInput()->withErrors('评论发表失败!');
		}

	}

}

修改视图 learnlaravel5/resources/views/pages/show.blade.php:

@extends('_layouts.default')

@section('content')
  <h4>
    <a href="/">⬅️返回首页</a>
  </h4>

  <h1 style="text-align: center; margin-top: 50px;">{{ $page->title }}</h1>
  <hr>
  <div id="date" style="text-align: right;">
    {{ $page->updated_at }}
  </div>
  <div id="content" style="padding: 50px;">
    <p>
      {{ $page->body }}
    </p>
  </div>
  <div id="comments" style="margin-bottom: 100px;">

    @if (count($errors) > 0)
      <div class="alert alert-danger">
        <strong>Whoops!</strong> There were some problems with your input.<br><br>
        <ul>
          @foreach ($errors->all() as $error)
            <li>{{ $error }}</li>
          @endforeach
        </ul>
      </div>
    @endif

    <div id="new">
      <form action="{{ URL('comment/store') }}" method="POST">
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
        <input type="hidden" name="page_id" value="{{ $page->id }}">
        <div class="form-group">
          <label>Nickname</label>
          <input type="text" name="nickname" class="form-control" style="width: 300px;" required="required">
        </div>
        <div class="form-group">
          <label>Email address</label>
          <input type="email" name="email" class="form-control" style="width: 300px;">
        </div>
        <div class="form-group">
          <label>Home page</label>
          <input type="text" name="website" class="form-control" style="width: 300px;">
        </div>
        <div class="form-group">
          <label>Content</label>
          <textarea name="content" id="newFormContent" class="form-control" rows="10" required="required"></textarea>
        </div>
        <button type="submit" class="btn btn-lg btn-success col-lg-12">Submit</button>
      </form>
    </div>

<script>
function reply(a) {
  var nickname = a.parentNode.parentNode.firstChild.nextSibling.getAttribute('data');
  var textArea = document.getElementById('newFormContent');
  textArea.innerHTML = '@'+nickname+' ';
}
</script>

    <div class="conmments" style="margin-top: 100px;">
      @foreach ($page->hasManyComments as $comment)

        <div class="one" style="border-top: solid 20px #efefef; padding: 5px 20px;">
          <div class="nickname" data="{{ $comment->nickname }}">
          @if ($comment->website)
            <a href="{{ $comment->website }}">
              <h3>{{ $comment->nickname }}</h3>
            </a>
          @else
            <h3>{{ $comment->nickname }}</h3>
          @endif
            <h6>{{ $comment->created_at }}</h6>
          </div>
          <div class="content">
            <p style="padding: 20px;">
              {{ $comment->content }}
            </p>
          </div>
          <div class="reply" style="text-align: right; padding: 5px;">
            <a href="#new" onclick="reply(this);">回复</a>
          </div>
        </div>

      @endforeach
    </div>
  </div>
@endsection

前台评论功能完成。

查看效果:

Image


Image

5. 后台管理功能

修改基础视图 learnlaravel5/resources/views/app.blade.php 为:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Laravel</title>

	<link href="/css/app.css" rel="stylesheet">

	<!-- Fonts -->
  <link href='http://fonts.useso.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'>
</head>
<body>
	<nav class="navbar navbar-default">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
					<span class="sr-only">Toggle Navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#">Learn Laravel 5</a>
			</div>

			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav">
					<li><a href="/admin">后台首页</a></li>
				</ul>
				<ul class="nav navbar-nav">
					<li><a href="/admin/comments">管理评论</a></li>
				</ul>

				<ul class="nav navbar-nav navbar-right">
					@if (Auth::guest())
						<li><a href="/auth/login">Login</a></li>
						<li><a href="/auth/register">Register</a></li>
					@else
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ Auth::user()->name }} <span class="caret"></span></a>
							<ul class="dropdown-menu" role="menu">
								<li><a href="/auth/logout">Logout</a></li>
							</ul>
						</li>
					@endif
				</ul>
			</div>
		</div>
	</nav>

	@yield('content')

	<!-- Scripts -->
	<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>
</body>
</html>

修改后台路由组(增加了一行):

Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => 'auth'], function()
{
  Route::get('/', 'AdminHomeController@index');
  Route::resource('pages', 'PagesController');
  Route::resource('comments', 'CommentsController');
});

创建 Admin\CommentsController :

php artisan make:controller Admin/CommentsController

Admin/CommentsController 要有 查看所有、查看单个、POST更改、删除四个接口:

<?php namespace App\Http\Controllers\Admin;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;

use App\Comment;

use Redirect, Input;

class CommentsController extends Controller {

	public function index()
	{
		return view('admin.comments.index')->withComments(Comment::all());
	}

	public function edit($id)
	{
		return view('admin.comments.edit')->withComment(Comment::find($id));
	}

	public function update(Request $request, $id)
	{
		$this->validate($request, [
			'nickname' => 'required',
			'content' => 'required',
		]);
		if (Comment::where('id', $id)->update(Input::except(['_method', '_token']))) {
			return Redirect::to('admin/comments');
		} else {
			return Redirect::back()->withInput()->withErrors('更新失败!');
		}
	}

	public function destroy($id)
	{
		$comment = Comment::find($id);
		$comment->delete();

		return Redirect::to('admin/comments');
	}

}

接下来创建两个视图:

learnlaravel5/resources/views/admin/comments/index.blade.php:

@extends('app')

@section('content')
<div class="container">
  <div class="row">
    <div class="col-md-10 col-md-offset-1">
      <div class="panel panel-default">
        <div class="panel-heading">管理评论</div>

        <div class="panel-body">

        <table class="table table-striped">
          <tr class="row">
            <th class="col-lg-4">Content</th>
            <th class="col-lg-2">User</th>
            <th class="col-lg-4">Page</th>
            <th class="col-lg-1">编辑</th>
            <th class="col-lg-1">删除</th>
          </tr>
          @foreach ($comments as $comment)
            <tr class="row">
              <td class="col-lg-6">
                {{ $comment->content }}
              </td>
              <td class="col-lg-2">
                @if ($comment->website)
                  <a href="{{ $comment->website }}">
                    <h4>{{ $comment->nickname }}</h4>
                  </a>
                @else
                  <h3>{{ $comment->nickname }}</h3>
                @endif
                {{ $comment->email }}
              </td>
              <td class="col-lg-4">
                <a href="{{ URL('pages/'.$comment->page_id) }}" target="_blank">
                  {{ App\Page::find($comment->page_id)->title }}
                </a>
              </td>
              <td class="col-lg-1">
                <a href="{{ URL('admin/comments/'.$comment->id.'/edit') }}" class="btn btn-success">编辑</a>
              </td>
              <td class="col-lg-1">
                <form action="{{ URL('admin/comments/'.$comment->id) }}" method="POST" style="display: inline;">
                  <input name="_method" type="hidden" value="DELETE">
                  <input type="hidden" name="_token" value="{{ csrf_token() }}">
                  <button type="submit" class="btn btn-danger">删除</button>
                </form>
              </td>
            </tr>
          @endforeach
        </table>


        </div>
      </div>
    </div>
  </div>
</div>
@endsection

learnlaravel5/resources/views/admin/comments/edit.blade.php:

@extends('app')

@section('content')
<div class="container">
  <div class="row">
    <div class="col-md-10 col-md-offset-1">
      <div class="panel panel-default">
        <div class="panel-heading">编辑评论</div>

        <div class="panel-body">

          @if (count($errors) > 0)
            <div class="alert alert-danger">
              <strong>Whoops!</strong> There were some problems with your input.<br><br>
              <ul>
                @foreach ($errors->all() as $error)
                  <li>{{ $error }}</li>
                @endforeach
              </ul>
            </div>
          @endif

          <form action="{{ URL('admin/comments/'.$comment->id) }}" method="POST">
            <input name="_method" type="hidden" value="PUT">
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <input type="hidden" name="page_id" value="{{ $comment->page_id }}">
            Nickname: <input type="text" name="nickname" class="form-control" required="required" value="{{ $comment->nickname }}">
            <br>
            Email:
            <input type="text" name="email" class="form-control" required="required" value="{{ $comment->email }}">
            <br>
            Website:
            <input type="text" name="website" class="form-control" required="required" value="{{ $comment->website }}">
            <br>
            Content:
            <textarea name="content" rows="10" class="form-control" required="required">{{ $comment->content }}</textarea>
            <br>
            <button class="btn btn-lg btn-info">提交修改</button>
          </form>

        </div>
      </div>
    </div>
  </div>
</div>
@endsection

后台管理功能完成,查看效果:

Image


Image

6. 大作业

依赖于 Page 的评论功能已经全部完成,个人博客系统雏形诞生。在本系列教程的最后,布置一个大作业:构建出 Article 的前后台,并且加上 Article 与 Comment 的一对多关系,加入评论和评论管理功能。在做这个大作业的过程中,你将会反复地回头去看前面的教程,反复地阅读中文文档,会仔细阅读我的代码,等你完成大作业的时候,Laravel 5 就真正入门啦~~


教程(四)代码快照:https://github.com/johnlui/Learn-Laravel-5/archive/tutorial_4.zip


Laravel 5 系列入门教程【最适合中国人的 Laravel 教程】到此结束,谢谢大家!

WRITTEN BY

avatar

评论:

alex
2015-12-27 16:17
我按照博主的代码写完以后,样式很难看。后来把博主代码复制过来,样式还是没改变
newhand
2016-01-03 23:00
@alex:有一个样式是googleapis的网址的,好像是谷歌的。。。国内没上墙访问不了的。。可能是这个原因吧
Zenas
2016-05-15 16:27
@newhand:我的问题也是样式,但是是后台显示评论那部分,我的 评论内容一旦过长,将超出设定的区域,
我知道出错的代码应该是这个位置 index.blade.php里
@foreach ($comments as $comment)
            <tr class="row">
              <td class="col-lg-4">
                {{ $comment->content }}
              </td>
              <td class="col-lg-2">
                @if ($comment->website)
                  <a href="{{ $comment->website }}">
                    <h4>{{ $comment->nickname }}</h4>
                  </a>
                @else
                  <h3>{{ $comment->nickname }}</h3>
                @endif
                {{ $comment->email }}
              </td>
              <td class="col-lg-4">
                <a href="{{ URL('pages/'.$comment->page_id) }}" target="_blank">
                  {{ App\Page::find($comment->page_id)->title }}
                </a>
              </td>
              <td class="col-lg-1">
                <a href="{{ URL('admin/comments/'.$comment->id.'/edit') }}" class="btn btn-success">编辑</a>
              </td>
              <td class="col-lg-1">
                <form action="{{ URL('admin/comments/'.$comment->id) }}" method="POST" style="display: inline;">
                  <input name="_method" type="hidden" value="DELETE">
                  <input type="hidden" name="_token" value="{{ csrf_token() }}">
                  <button type="submit" class="btn btn-danger">删除</button>
                </form>
              </td>
            </tr>
          @endforeach


这段代码,就是第一个commens那个部分
kgoing
2016-02-17 15:20
@alex:将default.blade.php中的app.css保险起见,写成绝对路径就可以了。
haoxuan
2015-12-23 13:51
博主是否可以加上权限这块呢,就是类型rbac的
Echo
2015-12-11 15:28
PO主的后台首页是什么样的,唯独后台首页我这里出错说文件不存在,评论管理可以。
风起
2015-12-09 14:07
感谢博主,看哇受益匪浅。
NewMen
2015-11-27 12:09
看完了 第一个接触的框架 有些蒙圈,谢谢博主,享受了福利,留个足迹
NewMen1
2015-12-21 14:08
@NewMen:哈哈
anzichen
2015-11-20 11:12
老师好,为什么老师最后一步可以直接进入后台管理功能,但是我的却要输入用户名和密码,我试过在表中插入一行用户,但是提示记录不匹配
wangszh
2015-11-14 13:12
你好,老师,按照你的教程走了一遍,感觉很有收获,想完成老师的作业,创建article的前后台,在后台文章列表页面想显示user->name 就根据老师的评论管理改了一个 App\User::find($article->user_id)->name 结果报错,想问下老师改怎么写?
JohnLui
2015-11-14 13:16
@wangszh:报的是什么错你倒是贴一下呀。。。
wangszh
2015-11-16 10:45
@JohnLui:周末没看到老师的回复,错误提示 :ErrorException in 4320b28ce042c0b07a2bd5f5b75672d5 line 25:
Trying to get property of non-object (View: C:\wamp\www\learnlaravel5\resources\views\admin\articles\index.blade.php)
JohnLui
2015-11-16 10:53
@wangszh:所以错误很明显了呀,自己排查吧。
wangszh
2015-11-16 10:57
@JohnLui:希望老师给看一下 ,这个写法有没有问题?
wangszh
2015-11-16 11:16
@JohnLui:或者是 想把user_id显示为user-name应该怎么写 ? 麻烦老师了
wangszh
2015-11-16 15:42
@JohnLui:App\User::find($article->user_id)->name 这样写之后发现sql语句没有传入id ,string 'select * from `users` where `users`.`id` = ? limit 1' (length=52) 麻烦老师帮帮忙提点一句,刚开始学习,很多东西不懂
黄传备
2015-12-02 18:23
@wangszh:怎样,弄好了吗,我这也是同样的问题
xiaohan
2015-10-24 20:59
老师,你好,我在用户密码重设出了个问题,在没登录时可以访问路由http://localhost:8000/password/email,也显示了password视图。
但是 我登录再访问就跳转到/home,并报错NotFoundHttpException in RouteCollection.php line 161
这是怎么回事?
JohnLui
2015-10-25 00:26
@xiaohan:这是正常的
xiaohan
2015-10-25 12:21
@JohnLui:是这样的,我现在已经登录了,去点修改密码的链接(或者直接访问路由),然后它直接跳转到/home了,而且报错,理论上应该是要会打开http://localhost:8000/password/email 并且显示auth/password.blade.php视图。而当我没有登录用户的时候,直接访问http://localhost:8000/password/email,却可以正常显示出上面的视图。
xiaohan
2015-10-25 20:47
@xiaohan:我在Stack Overflow上查到的方法是说要为登录的用户单独创建路由和控制器
From the ResetsPasswords trait, the answer is:

Password::sendResetLink(['email' => Auth::user()->email], function (Illuminate\Mail\Message $message) {
    $message->subject('Your Password Reset Link');
});
但是我不清楚具体该怎么做,希望老师指导一下。
wangwt
2015-11-27 10:07
@xiaohan:是不是自带的PasswordController使用了guest中间件的原因?
ttt
2015-10-17 16:14
受不了了,这部教程做完了 怎么管理首页还是老样子?
莫莫莫
2015-10-14 20:23
请教老师,为什么我edit修改提交的时候,会报下面的这个错误,,create就没有
MethodNotAllowedHttpException in compiled.php line 7717:
in compiled.php line 7717
at RouteCollection->methodNotAllowed(array('GET', 'HEAD', 'PUT', 'PATCH', 'DELETE')) in compiled.php line 7713
at RouteCollection->getRouteForMethods(object(Request), array('GET', 'HEAD', 'PUT', 'PATCH', 'DELETE')) in compiled.php line 7691
at RouteCollection->match(object(Request)) in compiled.php line 6965
at Router->findRoute(object(Request)) in compiled.php line 6937
at Router->dispatchToRoute(object(Request)) in compiled.php line 6929
at Router->dispatch(object(Request)) in compiled.php line 1935
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 8952
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 2438
at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17
at VerifyCsrfToken->handle(object(Request), object(Closure)) in compiled.php line 8944
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 12083
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in compiled.php line 8944
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 10785
at StartSession->handle(object(Request), object(Closure)) in compiled.php line 8944
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 11789
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in compiled.php line 8944
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 11738
at EncryptCookies->handle(object(Request), object(Closure)) in compiled.php line 8944
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 2478
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in compiled.php line 8944
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 8935
at Pipeline->then(object(Closure)) in compiled.php line 1891
at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 1880
at Kernel->handle(object(Request)) in index.php line 53
at require_once('/Users/kevin/learnlaravel5/public/index.php') in server.php line 21
sjjcarrie
2015-10-09 19:22
return Redirect::back()->withInput()->withErrors('保存失败!');
这个保存失败为什么没有在页面显示
asc
2015-10-09 14:54
很好的一个教程,感谢博主
otme
2015-10-05 12:48
讲的很棒!准备做作业!
wign
2015-11-02 10:37
@otme:很棒,赞
BingoTrai
2015-09-27 12:17
博主,能讲下auth的实现吗?
authcontroller就一个构造函数
public function __construct(Guard $auth, Registrar $registrar)
    {
        $this->auth = $auth;
        $this->registrar = $registrar;

        $this->middleware('guest', ['except' => 'getLogout']);
    }
不知道他是怎么实现的。
JohnLui
2015-09-27 13:08
@BingoTrai:功能代码都在 use AuthenticatesAndRegistersUsers; 里。这是 PHP 的新特性 Traits:http://php.net/manual/zh/language.oop5.traits.php
hi_tp
2015-09-24 15:20
什么时候出点进阶的.队列那些看得懵懵懂懂的.
ZellDincht
2015-09-11 14:27
老师请问,您的例子中如果要实现分页,怎么写呢?

看了手册没有实现出来,希望老师帮忙!

        public function index()
    {
        return view('home')->withPages(Page::orderBy('created_at', 'desc')->get());
    }

需要use哪个命名空间呢?
ZellDincht
2015-09-11 15:01
@ZellDincht:我谷歌了解决了,但是是这样子的:
use DB;
....

        public function index()
    {    
        $pages = DB::table('pages')->orderBy('created_at', 'desc')->simplePaginate(20);
        return view('home')->withPages($pages);
    }

但是我还是想知道,利用App\Page 这个模型实例,如何进行分页呢?
JohnLui
2015-09-11 16:33
@ZellDincht:仔细读一下中文文档的 分页 篇,上面写的很清楚。
ZellDincht
2015-09-11 17:03
@JohnLui:谢谢博主,我的确看得不仔细。

        use App\Page;

        public function index()
    {
        $pages = Page::orderBy('id', 'desc')->paginate(15);
        return view('admin.index')->withPages($pages);
    }
ZellDincht
2015-09-10 17:16
有一个问题

<form action="{{ URL('admin/comments/'.$comment->id) }}" method="post">
       <input type="hidden" name="_method" value="PUT">
       <input type="hidden" name="_token" value="{{ csrf_token() }}">
       <input type="hidden" name="page_id" value="{{ $comment->page_id }}">
       Nickname: <input type="text" name="nickname" class="form-control" required="required" value="{{ $comment->nickname }}">
       <br/>
       Email: <input type="text" name="email" class="form-control" value="{{ $comment->email }}">
       <br>
       Website: <input type="text" name="website" class="form-control" value="{{ $comment->website }}">
       <br>
       <textarea name="content" rows="10" class="form-control">{{ $comment->content }}</textarea>
       <br>
       <button class="btn btn-lg btn-info">提交修改</button>
</form>

这个表单中,隐藏域的 _method = "PUT" 有什么作用啊?
JohnLui
2015-09-11 11:35
@ZellDincht:Laravel 用 POST 接口实现所有非 GET 方法。
ZellDincht
2015-09-11 14:29
@JohnLui:谢谢老师。

您的例子我练了几遍了,渐渐有了感觉。

因为laravel很强大,所以感觉很多还不懂,需要学习
ZellDincht
2015-09-10 17:14
这里学到了很多知识,谢谢博主。
张小尘
2015-08-30 19:35
大神
laravel_初学者
2015-08-26 17:24
博主,请问下多个数据库查询结果要怎么传给视图呀

发表评论:

© 2011-2019 岁寒  |  Powered by Emlog