【发布时间】:2015-01-23 09:32:29
【问题描述】:
我在 laravel php 框架中编写了一个简单的网络应用程序来存储家庭关系。这是代码:relationship.blade.php
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<title>Form!</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style type="text/css">
div {
position: absolute;
top: 40px;
width: 713px;
/* margin-right: 20px; */
/* padding-right: 20px; */
left: 190px;
}
</style>
</head>
<body>
<p style="position: absolute; top: 40px; left: 478px;">Enter your name and relationship with other people in the family</p>
<div class="formController">
{{ Form::open() }}
{{ Form::token() }}
{{ Form::textField('username', 'Name:') }}
{{ Form::label('text', 'Relationship: '); }}
{{ Form::select('size', array('F' => 'Father', 'M' => 'Mother', 'S' => 'Sister', 'B' => 'Brother'), 'S'); }} <br>
{{ Form::submit('Click Me!'); }}
{{ Form::close() }}
</div>
</body>
</html>
Routes.php
<?php
Route::get('/', function()
{
return View::make('hello');
});
Route::get('/relationship', function()
{
return View::make('relationship');
});
RelationshipController.php
<?php
class RelationshipController extends BaseController {
public function showRelation()
{
return View::make('Relationship');
}
}
Relationship.php(这是我编写代码将表单数据推送到 neo4j DB 的模型)
<?php
class Duck extends NeoEloquent {
//protected $fillable = array('name', '', 'password');
public function index($name, $options) {
$formData = Neo4j::makeNode();
$formData->setProperty('name',$name)
->setProperty('relationship',$options)
->save();
}
}
但是当我点击表单中的submit 按钮时,它会显示一条错误消息,例如Whoops, looks like something went wrong. 我该如何解决?并且数据不会存储在 neo4j 数据库中。
【问题讨论】:
-
laravel的日志里写了什么?
-
这里是 laravel 日志:pastebin.com/wa1zkSLs
-
您了解日志中的错误信息吗?请不要认为我的话是冒犯性的,我欢迎大家使用 neo4j,当然还有 php,因为它是我最喜欢的语言,但几乎所有关于 SO 的最后问题都表明您对正在使用的应用程序级堆栈缺乏了解。没有任何问题显示 Neo4j 问题。我建议你可以深入阅读 Laravel 文档,同时如果你想熟悉 Neo4j,你可以随时使用 Neo4j 浏览器或控制台。