Laravel从数据库中获取时间戳

时间:2017-09-06 13:11:43

标签: php laravel eloquent

我似乎无法从雄辩的模型中获得create_at timstamp,但对于其他列似乎并非如此。 id。有人可以帮我解决这个问题吗?

数据表

enter image description here

代码

//getting the collection
$collection = Scan::findOneById($scan->id);

//getting the first object(There is only one)
$storedScan = $collection->first();

//Util to get the type and prints it to console
Utils::printType($storedScan->id);
Utils::printType($storedScan->create_at);

输出

Type: integer

Type: NULL

1 个答案:

答案 0 :(得分:1)

数据库列名为create d _at