初めての Larevel (4) アプリケーションを作成していて、それが作成された日付を表示したいのですが、この問題が発生しています:Unexpected data found. Unexpected data found. Unexpected data found. Data missing
ブレード テンプレートでこれを実行しようとすると
@extends('layout')
@section('content')
<h3>Name: {{ $user->name }}</h3>
<p>Email: {{ $user->email }}</p>
<p>Bio: {{ $user->bio }}</p>
@endsection()
@section('sidebar')
<p><small>{{ $user->created_at }}</small></p>
@endsection()
@stop
そして私のコントローラー
<?php
class UserController extends BaseController
{
public $restfull = true;
public function get_index() {
//$users = User::all();// gets them in the order of the database
$users = User::orderBy("name")->get(); // gets alphabetic by name
$v = View::make('users');
$v->users = $users;
$v->title = "list of users";
return $v;
}
public function get_view($id) {
$user = User::find($id);
$v = View::make('user');
$v->user = $user;
$v->title = "Viewing " . $user->name;
return $v;
}
}
?>
取り出すとすぐに機能します:
<p><small>{{ $user->created_at }}</small></p>"
これらの値にアクセスする方法があれば、チェックしたところ、テーブルに存在します。
これは私のテーブルのスキーマです
CREATE TABLE "users" ("id" integer null primary key autoincrement, "email" varchar null, "name" varchar null, "bio" varchar null, "created_at" datetime null, "updated_at" datetime null);