Php 如何解决迁移我的Voyager(admin panal)BadMethodCallException date\u time\u集不存在时发生的此异常
// C:\wamp64\www\NewsApp\vendor\laravel\framework\src\illumb\Support \Traits\Macroable.php:104 100| */ 101 |公共函数u调用($method,$parameters) 102| { 103 | if(!static::hasMacro($method)){ 104 |抛出新的BadMethodCallException(sprintf( 105 |“方法%s::%s不存在”。,静态::类, $method 106| )); 107| } 108| //2019_10_28_194406_创建_帖子_table.phpPhp 如何解决迁移我的Voyager(admin panal)BadMethodCallException date\u time\u集不存在时发生的此异常,php,laravel,voyager,Php,Laravel,Voyager,// C:\wamp64\www\NewsApp\vendor\laravel\framework\src\illumb\Support \Traits\Macroable.php:104 100| */ 101 |公共函数u调用($method,$parameters) 102| { 103 | if(!static::hasMacro($method)){ 104 |抛出新的BadMethodCallException(sprintf( 105 |“方法%s::%s不存在”
Exception trace:
1 Illuminate\Database\Schema\Blueprint::__call("date_time_set")
C:\wamp64\www\NewsApp\database\migrations
\2019_10_28_194406_create_posts_table.php:20
2 CreatePostsTable::{closure}
(Object(Illuminate\Database\Schema\Blueprint))
C:\wamp64\www\NewsApp\vendor\laravel\framework\src
\Illuminate\Database\Schema\Builder.php:166
Please use the argument -v to see more details.
您在带有行的迁移文件上出错
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePostsTable extends Migration
{
/**
* Run the migrations.
*
* @return void'category_id'
*/
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('content');
$table->date_time_set('Date');
$table->text('image') ->nullable();
$table->integer('votes_up') -> nullable();
$table->integer('votes_down') ->nullable();
//relationships
$table->integer('user_id');
$table->integer('category_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('posts');
}
}
改为:
$table->date_time_set('Date');
请分享
2019\u 10\u 28\u 194406\u create\u posts\u table.php的内容
Exception trace:
1 Illuminate\Database\Schema\Blueprint::__call("date_time_set")
C:\wamp64\www\NewsApp\database\migrations
\2019_10_28_194406_create_posts_table.php:20
2 CreatePostsTable::{closure}
(Object(Illuminate\Database\Schema\Blueprint))
C:\wamp64\www\NewsApp\vendor\laravel\framework\src
\Illuminate\Database\Schema\Builder.php:166
Please use the argument -v to see more details.
$table->dateTime("date");