(Laravel) 使用artisan时遇到的问题 (更新中)

[ ]

The content is recoverd from Wordpress Blog, for more details please check HERE

November 4, 2015

VOID001

运行 php artisan migrate 的时候 报错(错误信息见下面) 的解决方法

报错信息如下

[IlluminateDatabaseQueryException]                                          SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (`migration` va  
  rchar(255) not null, `batch` int not null) default character set utf8 collate utf8\_unicode\_ci) 
 
 [PDOException] 
 SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' 

这是因为配置里面少了 一个参数 “migrations” 的值, 加上这个参数

"migrations"    =>  "migration"

之后问题就解决了 ~~~

 

执行db:seed 时,遇到问题(问题见下文)

主要错误信息:

PHP Fatal error:  Class User contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (IlluminateAuthUserInterface::getRememberToken, IlluminateAuthUserInterface::setRememberToken, IlluminateAuthUserInterface::getRememberTokenName) in /home/void001/NEUP-Net-Depart/larastudy/app/models/User.php on line 26

参考这篇文章:http://laravel.com/docs/5.1/upgrade#upgrade-4.1.26

在User.php 中加入 :

public function getRememberToken()
{
    return $this->remember\_token;
}

public function setRememberToken($value)
{
    $this->remember\_token = $value;
}

public function getRememberTokenName()
{
    return 'remember\_token';
}

再次运行php artisan db:seed 就可以了~


PHP, Web Develop C. Linux, kernel, Laravel, PHP, Python, Shell, Web, wine


Historical Comments

Post navigation ————— NEXT
[Laravel] 配置phpstorm支持laravel语法补全
PREVIOUS [Laravel] laravel目录下执行 php composer.phar install遇到的各种问题的解决 Comments are closed.

统计信息nanodesu~~~

当前在线人数 (。・ω・)ノ゙ 0
修罗酱真诚欢迎更多的朋友来我的WOWO做客哦~ Search for: Search #### Recent Posts

Back